Breakpoints are places in a program where the debugger stops the program execution intentionally. You can use these breaks, for example, to examine or adjust a program, or to execute only parts of a large program for debugging. The breakpoint does not end the program execution, it can be continued from the location it was stopped. Compared to statements you could enter into your code to stop a program, breakpoints have the advantage that they are not part of your code, instead they are fully administrated by the debugger interface. This can be more convenient and faster than editing stop statements in your code.
Breakpoints are working as an interface between you and the debugger. You can specifiy locations and conditions for the break and actions you want the debugger to perform after the break. When you set a breakpoint, you give all this information to the debugger, but it does not yet have any impact on the run-control of your program. It is only your request to the debugger to set a breakpoint at this place. The debugger evaluates your breakpoint request for realization. If it is realizable, the debugger creates one or more breakpoints that impact run-control and perform specified actions when they are hit.
The debugger creates only one breakpoint when the settings you give with the request are unambiguous, this means the debugger interprets the settings as being unique for only one location in your code. The debugger creates multiple breakpoints when the settings are ambiguous at the time you set the breakpoint, for example, when you request a breakpoint in overloaded functions, or when ambiguities occur during program execution, for example, when a new library is loaded. In the latter case, the breakpoint is created at run-time when the related code is loaded into the debugger. When the code is unloaded, the debugger removes that particular breakpoint again. You can delete and modify breakpoints realized by the debugger, however, you must be aware that the debugger probably will remove breakpoints or realize new ones depending on the breakpoint request settings and the program context. The changes will probably be lost in these cases. This means, to change the breakpoints permanently, you would have to modify your breakpoint request.
Having the debugger control the actual realization of a breakpoint has the advantage that you do not have to consider the program context or resolve ambiguities by yourself when you set a breakpoint. You only have to request the breakpoint and the debugger sets it for you or even creates several breakpoints that match your settings. This means, you can also set breakpoints out of the program context, for example at a line of code that is not yet loaded into the debugger.
You can set breakpoints at any code line with debug information or at a defined memory access. You can also set syncpoints to synchronize a set of threads.
You can define breakpoints as follows:
You can choose variables as breakpoints. This means that the program execution stops when the application accesses the variable according to the type of access, such as a write access. This is called a data breakpoint. Data breakpoints are also referred to as watchpoints.
You can specify conditions for a breakpoint. The program execution stops only if the conditions are true when the breakpoint is hit.
You can specify an action to be executed when a breakpoint is hit. The debugger evaluates the action in the context of the eventing thread.
You can specify a thread synchronization breakpoint (thread syncpoint) that creates a thread barrier. When any thread in a thread set reaches this barrier, it is frozen, and the debugger ignores any attempt to step or continue execution, until all other threads in the thread set have reached the thread syncpoint.
All specified breakpoints and their related information are displayed in the Breakpoints window.
You can set breakpoints in the Source window, the Assembler window, the Callstack window, or the Breakpoints window, or using the Create Breakpoint... menu.
Copyright © 2001-2011, Intel Corporation. All rights reserved.