30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Defining Eval Points and Conditional Breakpoints<br />

<strong>TotalView</strong> evaluates code fragments in the context of the target program.<br />

This means that you can refer to program variables and branch to places in<br />

your program.<br />

If you call a function from in an eval point and there’s a breakpoint within that function,<br />

<strong>TotalView</strong> will stop execution at that point. Similarly, if there’s an eval point in the<br />

function, <strong>TotalView</strong> also evaluates that eval point.<br />

For information on what you can include in code fragments, refer to “Using<br />

Programming Language Elements” on page 385.<br />

Eval points only modify the processes being debugged—they do not modify<br />

your source program or create a permanent patch in the executable. If you<br />

save a program’s action points, however, <strong>TotalView</strong> reapplies the eval point<br />

whenever you start a debugging session for that program. For information<br />

about how to save your eval points, see“Saving Action Points to a File” on<br />

page 380.<br />

You should stop a process before setting an eval point in it. This ensures that the eval<br />

point is set in a stable context.<br />

Setting Eval Points<br />

This section contains the steps you must follow to create an eval point.<br />

These steps are as follows:<br />

1 Display the Action Point > Properties Dialog Box. You can do this, for<br />

example, by right-clicking a icon and selecting Properties or by<br />

selecting a line and then invoking the command from the menu bar.<br />

2 Select the Evaluate button at the top of the dialog box.<br />

3 Select the button (if it isn’t already selected) for the language in which you<br />

plan to write the fragment.<br />

4 Type the code fragment. For information on supported C, Fortran, and<br />

assembler language constructs, see “Using Programming Language Elements”<br />

on page 385.<br />

5 For multi-process programs, decide whether to share the eval point<br />

among all processes in the program’s share group. By default, <strong>TotalView</strong><br />

selects the Plant in share group check box for multi-process programs,<br />

but you can override this by clearing this setting.<br />

6 Select the OK button to confirm your changes.<br />

If the code fragment has an error, <strong>TotalView</strong> displays an error message.<br />

Otherwise, it processes the code, closes the dialog box, and places<br />

an icon on the line number in the Source Pane.<br />

CLI: dbreak –e<br />

dbarrier –e<br />

The variables that you refer to in your eval point can either have a global<br />

scope or be local to the block of the line that contains the eval point. If you<br />

declare a variable in the eval point, its scope is the block that contains the<br />

<strong>TotalView</strong> <strong>Users</strong> <strong>Guide</strong>: version 8.7 367

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

Saved successfully!

Ooh no, something went wrong!