TotalView CLI Summary Sheet

October 1, 2001

CLI Commands TotalView CLI Guide

The CLI prompt shows the focus of the command (similar to being in a window).
Default focus is the first thread of process 1. Example:

The focus is described: where width specifies the objects to which the command is applied.
width_letter can be:
t
Thread width
p
Process width
g
Group width
a
All processes
d
Default width
where group_indicator can be:
group_letter
C
Control group
D
Default control group
S
Share group
W
Workers group
L
Lockstep group
group_number
group_name
Tid can be "<" which represents the lowest number worker thread.

General
Type help for information on all commands.
Use !! to repeat most recent command.

Initialization/Termination
dattach alias at
Brings currently executing processes under CLI control.

ddetach alias det
Detaches from the processes.

dkill alias k
Terminates execution of target processes.

dload alias lo
Loads debugging information.

drerun alias rr
Restarts processes.

drun alias r
Start or restarts processes.

exit, quit
Exits from TotalView, ending the debugging session.

Program Information
ddown alias d
Moves down the call stack.

dlist alias l
Displays code relative to current list location.

l source.c
- lists first 20 lines of source.c
l
- lists next 20 lines
l source.c#80
- lists lines 80-99 from source.c
l -n 10
- lists 10 lines
l -n -10
- lists 10 lines before current line

dprint alias p
Prints the value of a variable or expression.
Example: print the first 100 values of a malloc-ed array:
for {set i 0} {$i < 100} {incr i} {p ptr\[$i\]}

dptsets
Shows status of processes and threads in an array of P/T expressions.

dstatus alias st
Shows current status of processes and threads.

dup alias u
Moves up the call stack.

dwhat alias wh
Determines what a name refers to.

dwhere alias w
Display locations in the call stack.

Execution Control
dcont alias co
Continues execution and waits for execution to stop.

dfocus alias f
Changes the target of future CLI commands to this P/T set.
Similar to clicking on a different process window.

f a st
- prints status of everyone
f 1.3 p mysum
- prints mysum for thread 3, proc 1
f 1.3
- switches focus to thread 3, proc 1

dgo alias g
Resumes execution of target processes.

dgroups alias gr
manipulates and manages groups.
dgroups -add [ -g gid ] [ id-list ]
Adds members to thread and process groups
dgroups -delete [ -g gid ]
Deletes groups
dgroups -intersect [ -g gid ] [ id-list ]
Intersects a group with a list of processes and threads
dgroups [ -list ] [ pattern]
Prints process and thread group information
dgroups -new [ thread_or_process ] [ -g gid ] [ id-list ]
Creates a new thread or process group
dgroups -remove [ -g gid ] [ id-list ]
Removes members for thread or process groups

dhalt alias h
Suspends execution of target processes.

dhold alias hp
Suspends execution of target processes.

dnext alias n
Steps source lines, stepping over subroutines.

dnexti alias ni
Steps machine instructions, stepping over subroutines.

dout alias ou
Runs out from current subroutine.

dstep alias s
Steps lines, stepping into subroutines.

dstepi alias si
Steps machine instructions, stepping into subroutines.

dunhold alias uhp, uht
Releases a process/thread.

duntil alias un
duntil line-number
Runs to a line
duntil -address addr
Runs to an address
duntil proc-name
Runs into a function

dwait
Blocks command input until target processes stop.

dworker alias wof, wot>
Adds or removes a thread from a workers group

Action Points
dactions alias ac
dactions [ ap-id-list ] [ -at source-loc ] [ -enabled | -disabled ]
Displays information, saves, and reloads action points
dactions -save [ filename ]
Saves action points to a file
dactions -load [ filename ]
Loads previously saved action points

dbarrier alias ba, baw, BAW
dbarrier source-loc [ -stop_when hit { group | process | none } ] [ -stop_when_done { group | process | none } ]
Creates a barrier breakpoint at a source location
dbarrier -address addr [ -stop_when_hit { group | process | none } ] [ -stop_when_done { group | process | none } ]
Creates a barrier breakpoint at an address

dbreak alias b
dbreak source-loc [ -p | -g | -t ] [ [ -l lang ] -e expr ]
Creates a breakpoint at a source location
dbreak -address addr [ -p | -g | -t] [ [ -l lang ] -e expr ]
Creates a breakpoint at an address

ddelete alias de
Deletes specific action points.

ddisable, denable alias di, en
Disables action points; re-enables specific action points.

dwatch alias wa
dwatch variable [ -length byte-count ] [ -p | -g | -t ] [ [ -l lang ] -e expr ] [ -t type ]
Defines a watchpoint for a variable
dwatch -address addr [-length byte-count [ -p | -g | -t ] [ [ -l lang ] -e expr ] [ -t type ]
Defines a watchpoint for an address

Environment Commands
alias
Creates or views pseudonyms for commands.

capture
Allows output from commands that print results to be set to a variable.

dlappend
Appends list elements to a TotalView variable.

dset
Changes or views debugger state variable.

dunset
Restores default settings of Totalview state variables.

help alias he
Displays help information.

stty
Sets terminal properties.

unalias
Removes a previously defined alias.

Other Commands
dassign alias as
Changes the value of a scalar variable.

dcheckpoint
Creates a checkpoint image of processes (SGI only).

drestart
Restarts a checkpoint.

Helper Functions
rpath [root] [filter]
Recursively sets a directory search path, CLI_EXECUTABLE_PATH.
If [root] is not specified, start at the current directory.
[filter] is a regular expression that removes unwanted entries.
If it is not specified, the macro automatically filters out CVS/RCS/SCCS directories.

Sample startup of poe job, comments are preceded by "#"
tv5cli
set tx_exec_file tx_mpi_shared
set tx_nprocs 4
set tx_nodes 1
#
#Load poe, remember the pid number
#
set poe_dpid [dload poe]
#
#Start the test program and stop it before it executes any code
#
dset TV::parallel_stop yes
drun $tx_exec_file -procs $tx_nprocs -nodes $tx_nodes
dwait
#
#group status
#
dfocus g dstatus
#
#list executable
#
dfocus p2
dlist 
#
#Set a barrier breakpoint
#
dbarrier 38 -stop_when_hit process -stop_when_done group
#
#Run to that breakpoint
#
dfocus g dcont