Starting Your Program
The CLI lets you start debugging operations in several ways. To execute your program from within the CLI, enter a dload command followed by the drun command. The following example uses the totalviewcli command to start the CLI. This is followed by dload and drun commands. As this was not the first time the file was run, breakpoints exist from a previous session.
Note: In this listing, the CLI prompt is "d1.<>". The information preceding the ">" symbol indicates the processes and threads upon which the current command acts. The prompt is discussed in Command and Prompt Formats.
%
totalviewcli
IRIX6 MIPS TotalView 5X.0.0-7
Copyright 1999-2000 by Etnus, LLC. ALL RIGHTS RESERVED.
Copyright 1999 by Etnus, Inc.
Copyright 1996-1998 by Dolphin Interconnect Solutions, Inc.
Copyright 1989-1996 by BBN Inc.
tcl_library is set to "/opt/totalview/lib"
d1.<> dload arrays # load the "arrays" program
Mapping 430 bytes of ELF string data from 'arrays'...done
Digesting 42 ELF symbols from 'arrays'...done
Skimming 1825 bytes of DWARF '.debug_info' symbols from
'arrays'...done
Indexing 408 bytes of DWARF '.debug_frame' symbols from
'arrays'...done
...
Loading 1122 bytes of DWARF '.debug_info' information for
arrays.F...done
1
d1.<>
dactions # show action points
2 action points for process 1:
1 addr=0x1000114c [arrays.F#53] Enabled
2 addr=0x10000f34 [arrays.F#29] Enabled
d1.<>
drun # run "arrays" until first action point
Created process 1/10715, named "arrays"
Thread 1.1 has appeared
d1.<>
Thread 1.1 hit breakpoint 2 at line 29 in
"check_fortran_arrays_"
This two-step operation of loading then running allows you to set action points before execution begins. It also means that you can execute a program more than once, keeping TotalView state settings (such as the location of action points) in effect. At a later time, you can use the drerun command to tell the CLI to restart program execution, perhaps sending it new command-line arguments. In contrast, reentering the dload command tells the CLI to reload the program into memory (for example, after editing and recompiling the program). The dload command always creates new processes.
The dkill command terminates one or more processes of a program started by using dload, drun, or drerun. The following contrived example continues where the previous example left off:
d1.<>
dkill # kill process
Process 1 has exited
d1.<>
drun # runs "arrays" from beginning
Created process 1/10722, named "arrays"
Thread 1.1 has appeared
d1.<> Thread 1.1 hit breakpoint 2 at line 29 in
"check_fortran_arrays_"
dlist
-e -n 3 #Shows lines about execution point
Loading 168 bytes of DWARF '.debug_info' information
for /comp2/mtibuild//targ64_m4/libftn/lseek64_.s...done
Loading 760 bytes of DWARF '.debug_info' information for
vtan.c...done
Loading 1864 bytes of DWARF '.debug_info' information for
ns_passwd.c...done
28 do 10 i = 1, 100
29@> master_array (i) = i * i * i
30 0 continue
d1.<>
dwhat master_array # Show me information
Loading 901 bytes of DWARF '.debug_info' information for
main.c...done
In thread 1.1:
Name: master_array; Type: integer*4(100); Size: 400 bytes;
Addr: 0xffffffac90
Address class: auto_var (Local variable)Loading 188 bytes of
DWARF '.debug_info' information for
/xlv55/irix/lib/libc/libc_64_M4/csu/crt1tinit.s...done
d1.<>
drun # Notice the error message
drun: Process 1 already exists. Kill it first, or use rerun.
d1.<>
dkill # kill processes again
Process 1 has exited
d1.<>
drun
Created process 1/10730, named "arrays"
Thread 1.1 has appeared
d1.<> Thread 1.1 hit breakpoint 2 at line 29 in
"check_fortran_arrays_"
Notice that messages from the CLI and TotalView are interleaved (sometimes inconveniently) throughout the interaction. The occurs because the CLI prompt lets you know that the CLI is ready to accept another command. In contrast, the CLI displays messages about your program's state when something happens within the executing process. This means that you are almost always going to have interactions like this.
Note: You can minimize the amount of information that the CLI displays by setting the VERBOSE state variable to ERROR. See dset for more information.
Because information is interleaved, you may not realize that the prompt has appeared. It is always safe to use the Enter key to have the CLI redisplay its prompt. If a prompt is not displayed after you press Enter, then you know that the CLI is still executing.