Using the WDB GUI · Using Breakpoints Home and Help Icons Keyword Index Home Using Help
Line Graphic
Line Graphic

Contents

Keyword Index

Using the WDB GUI
Starting and Exiting the WDB GUI
Loading a Program and Changing Program Settings
Opening Source Files
Changing the Working Directory
Saving and Restoring Debug Sessions
Setting Source Paths
Setting Object Paths
Viewing Your Code
Browsing Functions
Setting Signal Handling
Finding Specific Text in Your Code
Using the Command View
Using the Watch View
Using Quick Watch
Using the Local Variables View
Using the Call Stack View
Using the Threads View
Using the Registers View
Examining Memory Use
Using the Program Console
{short description of image} Using Breakpoints
Advancing Through Your Program
Fixing Code from within the Debugger
Starting and Stopping the Debug Process
Setting Debugger Preferences
Customizing Colors and Fonts

Reference Information

Troubleshooting

Using Help



Bullet Overview
Bullet Inserting Breakpoints
{short description of image} Removing Breakpoints
Bullet Viewing and Modifying Breakpoints
Bullet Working with Deferred Breakpoints
Bullet Tips
Bullet See Also

Line Graphic

Overview

You can set breakpoints that will pause program execution just prior to the breakpoint location. In this way, you can evaluate variables, set breakpoints, view the call stack, or perform other debug actions at specific locations during the debug process.

In addition, you can specify:
  • commands you want to execute when a breakpoint is reached
  • conditions when the breakpoint is active
  • the number of times a breakpoint is to be ignored before execution is paused
Line Graphic

Inserting Breakpoints

To insert a breakpoint

  1. To the left of the text in the Source or Disassembly view, place your cursor at the line where you want to insert a breakpoint.
  2. Click M1. A breakpoint marker (a solid red octagon) appears in the left margin of the view, indicating that the breakpoint is set.

Or,

  1. In the text column of the Source or Disassembly view, place your cursor where you want to insert a breakpoint.
  2. Right-click to display the pop-up menu.
  3. Click Insert Breakpoint. A breakpoint marker (a solid red octagon) appears in the left margin of the view, indicating that the breakpoint is set.

    See Tips for other ways to set breakpoints.
NOTE: You may set a breakpoint in a file that is part of your executable but is not located in the source paths that you have specified. Add the appropriate source path in the Source File Paths dialog box.
{short description of image}

Removing Breakpoints

  1. In the Source or Disassembly view, place your cursor on the breakpoint symbol for the breakpoint you want to remove.
  2. Click M1 to remove the breakpoint.

Or,

  1. On the Edit menu, click Breakpoints.
  2. In the Breakpoints dialog box, from the Breakpoints list, select the breakpoint you want to remove.
  3. Click Remove. The selected breakpoint disappears from the list. To remove all the breakpoints that you have set, click Remove All.
  4. Click OK.

    See Tips for shortcuts for other ways to set breakpoints.
Line Graphic

Viewing and Modifying Breakpoints

The Breakpoints dialog box allows you to view and modify breakpoint attributes. You can also use this dialog box to add and remove breakpoints.


To bring up the Breakpoints dialog box

  1. Place the cursor on a breakpoint symbol.
  2. Click M2. The Breakpoints dialog appears with the breakpoint you clicked on selected.

Or,

  1. On the Edit menu, click Breakpoints.
  2. You can use the dialog box to view, modify, add, and remove breakpoints.
  3. Click OK to commit your changes and exit the dialog box.

You can use the Breakpoints dialog box to do the following:

To view a breakpoint's attibutes

  1. Select a breakpoint. The Breakpoints list in the Breakpoints dialog box lists all the breakpoints that are set. Click on a specific breakpoint in the list to view its attributes.

To modify a breakpoint's attibutes

  1. Select a breakpoint. The Breakpoints list in the Breakpoints dialog box lists all the breakpoints that are set. Click on a specific breakpoint in the list to view its attributes.

  2. You can modify any of the following attributes:

    • To change the breakpoint location, edit the text in the Break at text area.

      WARNING: If you erase the text in the Break at text area, the breakpoint will be removed.

    • If you want to break only under a certain condition, enter that condition in the Stop at breakpoint only if the following condition is true text area.

    • To enable or disable a breakpoint, toggle the Enabled check box to set the breakpoint as enabled or disabled. See Tips for shortcuts for enabling and disabling breakpoints.

      NOTE: In the left column of the Source or Disassembly view:
      • Enabled breakpoint indicates an enabled breakpoint
      • Disabled breakpoint indicates a disabled breakpoint

    • To break at a location only once, check the Temporary check box. Once a temporary breakpoint has been reached, it is removed automatically from the list.

    • To execute WDB commands when a breakpoint is reached, enter the commands in the Enter WDB commands to envoke at breakpoint text area. Type each command on a separate line. See Using the Command View for help on WDB commands.

    • To skip a breakpoint, enter the number of times you want to skip the breakpoint in the Number of breakpoint hits to ignore before stopping text box.

  3. Click OK to commit your changes.

    NOTE: The breakpoints you add, delete, or modify in this dialog box are not actually changed until you click OK.
Line Graphic

Working with Deferred Breakpoints

You set a deferred breakpoint when you set a breakpoint in a file or location that is part of a shared library but is not part of the current executable. This breakpoint will appear in the Breakpoints dialog list, but it will not actually be set until you load the shared library that contains the file.Line Graphic

Tips

  • To use pop-up menus to insert, remove, enable, and disable breakpoints:
    1. In the Source or Disassembly view, select a breakpoint or place your cursor where you want to insert a breakpoint.
    2. Right-click to display the pop-up menu.
    3. Click the command you want to invoke. The command will be automatically performed for the selected item without displaying the Breakpoints dialog box.
  • To use the toolbar to insert and remove breakpoints:
    • Click the Breakpoint toolbar button to Insert or Remove a breakpoint at the current cursor location.
  • You can automatically set breakpoints every time the WDB GUI starts by specifying them in the .gdbinit file. To automatically load breakpoints, add the following line to the .gdbinit file:

    break function_call

    See Creating the .gdbinit File for more information about the .gdbinit file.
  • You can save the breakpoints you have set by saving the debug session. You can later restore the breakpoints you have saved by restoring the debug session.
Line Graphic

See Also

Line Graphic

Return to Top