Basic Breakpoints
1. Set a breakpoint
Click a line number. for instance, select line 91, the call to
set_values(). TotalView displays a
sign, both in the Source Pane at line 91 and in the Action Points tab where all action points in a program are listed.
NOTE: A breakpoint can be set if the line number is boxed in the Source Pane:
2. Delete/disable/enable a breakpoint
To delete the breakpoint, click the
Stop icon in the Source Pane, and then re-add it by clicking again. You can also select it in the Action Points tab, right-click for a context menu, and select
Delete.
To disable a breakpoint, click its icon in the Action Points tab. The icon dims to show it is disabled:
Click it again to re-enable it. Again, you can also disable or re-enable a breakpoint using the context menu.
3. Run the program
Click the
Go button in the toolbar.
All panes in the Process Window report that the thread is running, or that it must be stopped for frame display. At this point, the program is waiting for user input.
Enter a number into the console, then click
Go again.
The program halts execution at the breakpoint.
4. Set a breakpoint in assembler code
You can also set a breakpoint in assembler code to view specific memory allocation.
Select
View > Source As > Both to view both source and assembler code.
Set a breakpoint in some assembler code, such as the instruction immediately following the existing breakpoint.
The Source Pane and Action Points tab display two breakpoints, one in source code and one in assembler code.
5. Set a breakpoint at a particular location
In a complex program, it may be easier to set a breakpoint using the At Location dialog, which allows you to specify where you want the breakpoint without having to first find the source line in the Source Pane. Using this dialog, you can set breakpoints on all methods of a class or all virtual functions, a useful tool for C++ programs.
NOTE: This dialog acts like a toggle, meaning that it sets a breakpoint if none exists at the specified location, or deletes an existing breakpoint at that location.
Select
Action Point> At Location and then enter
wave to set a breakpoint at the function
wave().
The breakpoint is set and added to the Action Points tab. If a breakpoint already exists at that location, this action toggles the setting to delete the breakpoint.