dbreak
Defines a breakpoint
Format:
Creates a breakpoint at a source location
dbreak source-loc [ -p | -g | -t ] [ [ -l lang ] -e expr ]
Creates a breakpoint at an address
dbreak -address addr [ -p | -g | -t] [ [ -l lang ] -e expr ]
Arguments:
source-loc
The breakpoint location specified as a line number or as a string containing a file name, function name, and line number, each separated by # characters; for example, #file#line. Defaults are constructed if you omit parts of this specification. For more information, see Qualifying Symbol Names.
-address addr
The breakpoint location specified as an absolute address in the address space of the program.
-p
Tells TotalView to stop the process that hit this breakpoint. You can set this option as the default by setting the STOP_ALL state variable to process.
-g
Tells TotalView to stop all processes in the process's control group when the breakpoint is hit. You can set this option as the default by setting the STOP_ALL state variable to group.
-t
Tells TotalView to stop the thread that hit this breakpoint. You can set this option as the default by setting the STOP_ALL state variable to thread.
-l lang
Sets the programming language used when you are entering expression expr. The languages you can enter are c, c++, f7, f9, and asm (for C, C++, FORTRAN 77, Fortran 9x, and assembler). If you do not specify a language, TotalView assumes that you wrote the expression in the same language as the routine at the breakpoint.
-e expr
When the breakpoint is hit, TotalView will evaluate expression expr in the context of the thread that hit the breakpoint. The language statements and operators you can use are described in the TotalView Users Guide.
Description:
The dbreak command defines a breakpoint or evaluation point that TotalView triggers when execution arrives at the specified location. The ID of the new breakpoint is returned.
Each thread stops when it arrives at a breakpoint.
Specifying a procedure name without a line number tells the CLI to set an action point at the beginning of the procedure. If you do not name a file, the default is the file associated with the current source location.
The CLI may not be able to set a breakpoint at the line you specify. This occurs when a line does not contain an executable statement.
If you try to set a breakpoint on a line at which the CLI cannot stop execution, it sets one at the nearest following line where it can halt execution.
When the CLI displays information on a breakpoint's status, it displays the location where execution will actually stop.
If the CLI encounters a stop group breakpoint, it suspends each process in the group as well as the process containing the triggering thread. The CLI then shows the identifier of the triggering thread, the breakpoint location, and the action point identifier.
One possibly confusing aspect of using expressions is that their syntax differs from that of Tcl. This is because you will need to embed code written in Fortran, C, or assembler within Tcl commands. In addition, your expressions will often include TotalView intrinsic functions. For example, if you want to use the TotalView $tid built-in function, you will need to type it as \$tid.
Command alias:
You may find the following aliases useful:
Alias |
Definition |
Meaning |
b |
{break} |
Sets a breakpoint. |
bt |
{dbreak t} |
Sets a breakpoint just on the thread of interest. |
Examples:
For all examples, assume the current process set is d2.< when the breakpoint is defined.
dbreak 12
Suspends process 2 when it reaches line 12. However, if the STOP_ALL state variable is set to group, all other processes in the group are stopped. In addition, if you have set the SHARE_ACTION_POINT state variable to true, the breakpoint is placed in every process in the group.
dbreak -address 0x1000764
Suspends process 2 when address 0x1000764 is reached.
b 12 -g
Suspends all processes in the current control group when line 12 is reached.
dbreak 57 -l f9 -e {goto $63}
Causes the thread that struck the breakpoint to transfer to line 63. The host language for this statement is Fortran 90 or Fortran 95.
dfocus p3 b 57 -e {goto $63}
In process 3, sets the same evaluation point as the previous example.