Detecting Pointer Boundary Violations

When your source code contains pointer references, it is useful to check these references against their assigned buffer boundaries in order to debug memory errors. The Intel® Debugger is able to recognize pointer boundaries and detect pointer boundary violations in the source code. When the debugger detects a violation of pointer boundaries, it automatically stops the application execution at the location where the violation occured and the Console window displays the associated source code.

For example:

Boundary exception: Accessing memory outside pointer boundaries.
 	main () at /home/test/bin/main.c:8
  8	        x[i] = 'A' + i;

Tip

To display the address and boundaries of a given pointer, enter the debugger command IDB SHOW BOUNDS EXPR into the Console window, where EXPR is the pointer name.

The boundaries are displayed, if this information is available at the current state of the application execution.

Note

To enable this feature, you must compile your source code with the option -check-pointers. Refer to the Intel® Compiler documentation for more information.

See Also


Submit feedback on this help topic