Load the Program to Debug
On this page:
Loading the Program
Before starting TotalView, you must add TotalView to your PATH variable. For information on installing TotalView, see Installation and Licensing.
1. Start TotalView.
totalview
The Start Page launches.
2. Select Debug a Program to open the Program Session window.
3. Provide a name for the session in Session Name field. This can be any string.
4. In the File Name field, browse to and select the expression program, located in the directory install-dir/toolworks/totalview.version/platform/examples.
5. In the Standard Input Redirection field, browse to and select the expr.tst file, also located in the examples directory. This provides the input required by the program. Leave all other fields and options as is.
6. Click Load Session to load the program into TotalView.
Note that this is the same as entering the path to the standard input file and program name as arguments when starting TotalView:
totalview -stdin expr.tst expression
(This invocation assumes that your examples directory is known to TotalView or that you are invoking TotalView from within the examples directory.)
|
Loading programs |
|
|
Starting a session from your shell |
|
|
Modifying arguments in an existing session |
Initial Display
At startup, TotalView displays your program’s code in the central area’s Source pane, along with its default views: the Processes & Threads, Lookup File or Function, Action Points, Call Stack, Local Variables, Documents, and Data View.
Figure 18. TotalView’s Default Views
The Processes & Threads view lists all processes and threads under TotalView control. You can use the Window > Views menu item to customize the displayed views.
Since the program has been created but not yet executed, there is no process or thread listed here.
The Lookup File or Function view takes any keyword search and returns a file or function from within your program’s files.
The Documents view displays all open files in the order in which their tabs appear in the central area.
The Replay Bookmarks view displays bookmarks created to mark a point in program execution history.
Action Points displays any breakpoints you set.
The Call Stack view shows the backtrace of the thread that is currently in focus once the program is running.
The Local Variables view displays information on the current thread’s variables.
The Source view in the central area displays your source code’s main() function before execution.
Several views are also visible at the bottom: Data View, Command Line, and Logger.
Data View enables you to evaluate expressions to observe your data while your program is running.
Command Line, which, when selected, displays a prompt for entering CLI commands:
Logger which, when selected, displays logging output from TotalView:
Optional: The Input/Output view displays stdout and stderr, and supports entering input directly into the user interface rather than only through the terminal. This view is turned off by default. To display it, select Window > Views > Input/Output.
|
Processes & Threads view |
|
|
Call Stack panel |
|
|
Action Points |
|
|
The CLI |