30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Starting the CLI<br />

Figure 139: CLI xterm<br />

Window<br />

You can eliminate these problems if you use the stty sane CLI command. (If<br />

the sane option isn’t available, you have to change values individually.)<br />

If you start the CLI with the totalviewcli command, you can use all of the<br />

command-line options that you can use when starting <strong>TotalView</strong>, except<br />

those that have to do with the GUI. (In some cases, <strong>TotalView</strong> displays an<br />

error message if you try. In others, it just ignores what you did.<br />

Startup Example<br />

The following is a very small CLI script:<br />

#<br />

source make_actions.tcl<br />

#<br />

dload fork_loop<br />

dset ARGS_DEFAULT {0 4 –wp}<br />

dstep<br />

catch {make_actions fork_loop.cxx} msg<br />

puts $msg<br />

This script begins by loading and interpreting the make_actions.tcl file,<br />

which was described in Chapter 11, “Seeing the CLI at Work,” on page 213. It<br />

then loads the fork_loop executable, sets its default startup arguments,<br />

and steps one source-level statement.<br />

If you stored this in a file named fork_loop.tvd, you can tell <strong>TotalView</strong> to<br />

start the CLI and execute this file by entering the following command:<br />

totalviewcli –s fork_loop.tvd<br />

Information on command-line options is in the “<strong>TotalView</strong> Command Syntax”<br />

chapter of the <strong>TotalView</strong> Reference <strong>Guide</strong>.<br />

The following example places a similar set of commands in a file that you<br />

invoke from the shell:<br />

#!/bin/sh<br />

# Next line exec. by shell, but ignored by Tcl because: \<br />

exec totalviewcli –s "$0" "$@"<br />

202 Chapter 10: Using the CLI

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!