top
products_top_active company_top_inactive right_margin_top
zero_bugs_logo

Breakpoint Types

The debugger supports code breakpoints (or simply breakpoints), and memory breakpoints (also called watchpoints).

A watchpoint is activated when a memory location is read or written, whereas a code breakpoint is activated when an instruction is being executed.

To set a code breakpoint, go to the Breakpoints menu, and select New Breakpoint. In the entry dialog, type either the fully qualified name of a function, or an address.

If the specified function is inside of a shared object that has not been loaded into memory yet, the debugger scans recursively the DT_NEEDED information in the main executable and all libraries, and locates the shared object that contains the specified function. It then creates a "deferred breakpoint", which becomes a true breakpoint once the shared object is loaded.

Shared objects which are loaded explicitly with dlopen are not listed in the DT_NEEDED area of the ELF program, so you need to provide the information to the debugger by using the View --> Modules menu, then click on the Add Shared Object button, at the bottom of the dialog box.

view modules

Note: The debugged program has to be stopped in the debugger in order to be able to set or modify breakpoints. When the program is running, the user interface controls for setting and editing breakpoints are disabled (grayed out).

Another way for inserting breakpoints is to use the right-click menu. You can insert a breakpoint at a given source line by right-clicking on it and selectind the Insert Breakpoint menu entry.

Setting Watchpoints

Note: watchpoints may not work correctly when running inside of a virtual machine, see Known Issues.

Watchpoints (or memory breakpoints) allow you to monitor when a program variable has changed value.

A watchpoint can be set by selecting the Breakpoints --> Watch... menu, or by right-clicking a variable (in either the local variables view or the expression evaluation view) and selecting Set Watchpoint from the contextual menu.

In the first case, the dialog that pops up will prompt you to enter the address that you wish to monitor. In the second case, the address is automatically assumed to be the address of the variable that you have clicked on. If the variable is local (stack-based), then the watchpoint will fire only when the current function is active.

See also: Modifying Breakpoints

See also: Conditional Breakpoints

See also: Article on Debugger Breakpoints and Wikipedia Definition of Breakpoint


intro documentation_stroke features sshots credits right_bottom

Home | Top | Up | Previous | Next | Community