Defines an array slice—that is, a portion of the array—to print. If the programming language is C or C++, use a backslash (\) when you enter the array subscripts. For example,
“\[100:110\]”.
Displays statistical data about an array. When using this switch, the expression provided to
dprint must resolve to an array. The
–slice switch may be used with
–stats to select a subset of values from the array to calculate statistics on.
Returns the results of dprint –stats as data in the form of a Tcl nested associative array rather than as output to the console. See the description section for the structure of the array.
A variable whose value is displayed. The variable can be local to the current stack frame or it can be global. If the displayed variable is an array, you can qualify the variable’s name with a slice that displays a portion of the array,
A source-language expression to evaluate and print. Because expression must also conform to Tcl syntax, you must enclose it within quotation marks it if it includes any blanks, and in braces (
{}) if it includes brackets (
[ ]), dollar signs (
$), quotation marks (
"), or other Tcl special characters.
The dprint command evaluates and displays a variable or an expression. The CLI interprets the expression by looking up the values associated with each symbol and applying the operators. The result of an expression can be a scalar value or an aggregate (array, array slice, or structure).
If an event such as a $stop, SEGV, breakpoint occurs, the
dprint command throws an exception that describes the event. The first exception subcode returned by
TV::errorCodes is the
susp-eval-id (a suspension-evaluation-ID). You can use this to manipulate suspended evaluations with the
dflush and
TV::expr commands. For example:
If you use the –nowait option, TotalView evaluates the expression in the background. It also returns a
susp-eval-id that you can use to obtain the results of the evaluation using
TV::expr.
As the CLI displays data, it passes the data through a simple more processor that prompts you after it displays each screen of text. At this time, you can press the Enter key to tell the CLI to continue displaying information. Entering
q stops printing.
Since the dprint command can generate a considerable amount of output, you might want to use the
capture command to save the output to a variable.
TotalView lets you cast variables and cast a variable to an array. If you are casting a variable, the first array address is the address of the variable. For example, assume the following declaration:
TotalView assumes the first array address is the address of what bp is pointing to. So, the following command displays the array:
You can also use the dprint command to obtain values for your computer’s registers. For example, on most architectures,
$r1 is register 1. To obtain the contents of this register, type:
You must precede the dollar sign ($) with a backslash to escape it since the register’s name includes the
$. This
$ is not the standard indicator that tells Tcl to fetch a variable’s value.
Appendix A ,“Architectures” lists the mnemonic names assigned to registers.
Displays the values of variable scalar_y in all processes and threads in the current focus.
Displays the value of argv, along with the first string to which it points.
Prints the value of argv[argc-1]. If the execution point is in
main(), this is the last argument passed to
main().
Displays the values of variable scalar_y for the threads in process 1.
Displays the values of the array arrayx for the second thread in process 1.
If main() is in the current scope, prints the program’s arguments followed by the program’s environment strings.
Evaluates a function without waiting. Later, you can obtain the results using TV::expr. The number displayed immediately after the command, which is “1”, is the
susp-eval-id. The following example shows how to get this result: