Totalview® for HPC User Guide : PART II Debugging Tools and Tasks : Chapter 8 Setting Action Points : Defining Eval Points and Conditional Breakpoints
Defining Eval Points and Conditional Breakpoints
TotalView supports eval points. These are action points at which you have added a code fragment that TotalView executes. You can write the code fragment in C, Fortran, or assembler.
NOTE >> Assembler support is currently available on the IBM AIX operating systems. You can enable or disable TotalView’s ability to compile eval points.
NOTE >> When running on many AIX systems, you can improve the performance of compiled expressions by using the -aix_use_fast_trap command when starting TotalView. For more information, see the TotalView Release Notes, available from the Rogue Wave web site. Search for “fast trap.”
Topics in this section are:
"Setting Eval Points"
"Creating a Pending Eval Point"
"Creating Conditional Breakpoint Examples"
"Patching Programs"
"About Interpreted and Compiled Expressions"
"Allocating Patch Space for Compiled Expressions"
You can do the following when you use eval points:
Include instructions that stop a process and its relatives. If the code fragment can make a decision whether to stop execution, it is called a conditional breakpoint.
Test potential fixes for your program.
Set the values of your program’s variables.
Automatically send data to the Visualizer. This can produce animated displays of the changes in your program’s data.
You can set an eval point at any source line that generates executable code (marked with a box surrounding a line number) or a line that contains assembler-level instructions. This means that if you can set a breakpoint, you can set an eval point.
At each eval point, TotalView or your program executes the code contained in the eval point before your program executes the code on that line. Although your program can then go on to execute this source line or instruction, it can do the following instead:
Include a goto in C or Fortran that transfers control to a line number in your program. This lets you test program patches.
Execute a TotalView function. These functions can stop execution and create barriers and countdown breakpoints. For more information on these statements, see "Using Built-in Variables and Statements".
TotalView evaluates code fragments in the context of the target program. This means that you can refer to program variables and branch to places in your program.
NOTE >> If you call a function from an eval point and there’s a breakpoint within that function, TotalView will stop execution at that point. Similarly, if there’s an eval point in the function, TotalView also evaluates that eval point.
Eval points only modify the processes being debugged—they do not modify your source program or create a permanent patch in the executable. If you save a program’s action points, however, TotalView reapplies the eval point whenever you start a debugging session for that program.
NOTE >> You should stop a process before setting an eval point in it. This ensures that the eval point is set in a stable context.
 
RELATED TOPICS 
 
Saving eval points
Writing code for an expression
TotalView’s expression system
Using built-in TotalView statements to control execution