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.
If your program is launched from a starter program such as srun or yod, use the drerun command rather than drun to start your program. If you use drun, default arguments to the process are suppressed; drerun passes them on.
The following example uses the totalviewcli command to start the CLI. This is followed by dload and drun commands. Since this was not the first time the file was run, breakpoints exist from a previous session.
In this listing, the CLI prompt is “
d1.<>”. The information preceding the greater-than symbol (>) symbol indicates the processes and threads upon which the current command acts. The prompt is discussed in
“About the CLI Prompt”.
% totalviewcli
d1.<> dload arraysAlpha #load the arraysAlpha program
1
d1.<> dactions # Show the action points
No matching breakpoints were found
d1.<> dlist -n 10 75
75 real16_array (i, j) = 4.093215 * j+2
76 #endif
77 26 continue
78 27 continue
79
80 do 40 i = 1, 500
81 denorms(i) = x'00000001'
82 40 continue
83 do 42 i = 500, 1000
84 denorms(i) = x'80000001'
d1.<> dbreak 80 # Add two action points
1
d1.<> dbreak 83
2
d1.<>
drun # Run the program to the action point
This two-step operation of loading and running supports setting action points before execution begins, as well as executing a program more than once. At a later time, you can use drerun to restart your program, perhaps sending it new 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 a new process. The new process is in addition to any existing processes for the program because the CLI does not shut down older processes when starting the new one.
The dkill command terminates one or more processes of a program started by using a dload, drun, or drerun command. The following example continues where the previous example left off:
d1.<> dkill # kills process
d1.<> drun # runs program from start
d1.<> dlist -e -n 3 # shows lines about current spot
79
80@> do 40 i = 1, 500
81 denorms(i) = x'00000001'
d1.<>
dwhat master_array # Tell me about master_array
In thread 1.1:
Name: master_array; Type: integer(100);
Size: 400 bytes; Addr: 0x140821310
Scope: ##arraysAlpha#arrays.F#check_fortran_arrays
(Scope class: Any)
Address class: proc_static_var
(Routine static variable)
d1.<> dgo # Start program running
d1.<> dwhat denorms # Tell me about denorms
In thread 1.1:
Name: denorms; Type: <void>; Size: 8 bytes;
Addr: 0x1408214b8
Scope: ##arraysAlpha#arrays.F#check_fortran_arrays
(Scope class: Any)
Address class: proc_static_var
(Routine static variable)
d1.<>
dprint denorms(0) # Show me what is stored
denorms(0) = 0x0000000000000001 (1)
d1.<>
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 isn’t displayed after you press Enter, you know that the CLI is still executing.