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.

Defining Eval Points and Conditional Breakpoints<br />

Defining Eval Points and<br />

Conditional Breakpoints<br />

<strong>TotalView</strong> lets you define eval points. These are action points at which you<br />

have added a code fragment that <strong>TotalView</strong> executes. You can write the<br />

code fragment in C, Fortran, or assembler.<br />

Assembler support is currently available on the HP Alpha Tru64 UNIX, IBM AIX, and<br />

SGI IRIX operating systems. You can enable or disable <strong>TotalView</strong>’s ability to compile<br />

eval points.<br />

When running on many AIX systems, you can speed up the performance of compiled<br />

expressions by using the –use_aix_fast_trap command when you start <strong>TotalView</strong>. For<br />

more information, see the <strong>TotalView</strong> Release Notes. Search for “fast trap”.<br />

Topics in this section are:<br />

� “Setting Eval Points” on page 367<br />

� “Creating Conditional Breakpoint Examples” on page 368<br />

� “Patching Programs” on page 368<br />

� “About Interpreted and Compiled Expressions” on page 370<br />

� “Allocating Patch Space for Compiled Expressions” on page 371<br />

You can do the following when you use eval points:<br />

� Include instructions that stop a process and its relatives. If the code<br />

fragment can make a decision whether to stop execution, it is called a<br />

conditional breakpoint.<br />

� Test potential fixes for your program.<br />

� Set the values of your program’s variables.<br />

� Automatically send data to the Visualizer. This can produce animated<br />

displays of the changes in your program’s data.<br />

You can set an eval point at any source line that generates executable code<br />

(marked with a box surrounding a line number) or a line that contains<br />

assembler-level instructions. This means that if you can set a breakpoint,<br />

you can set an eval point.<br />

At each eval point, <strong>TotalView</strong> or your program executes the code contained<br />

in the eval point before your program executes the code on that line.<br />

Although your program can then go on to execute this source line or<br />

instruction, it can do the following instead:<br />

� Include a goto in C or Fortran that transfers control to a line number in<br />

your program. This lets you test program patches.<br />

� Execute a <strong>TotalView</strong> function. These functions let you stop execution,<br />

create barriers, and countdown breakpoints. For more information on<br />

these statements, see “Using Built-in Variables and Statements” on page 394.<br />

366 Chapter 16: Setting Action Points

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

Saved successfully!

Ooh no, something went wrong!