A breakpoint with associated code is an evalpoint. When your program reaches an evalpoint, NextGen TotalView for HPC executes the code. Evalpoints can contain print statements, commonly used in debugging, but, unlike print statements, don’t require that you recompile your program. They also let you patch your programs and route around code that you want replaced—for example, to branch around code that you don’t want your program to execute or to add new statements.
dbreak 597 -e { printf("The value of result is %d\n", result) };
Note that this breakpoint does not stop execution. Evalpoints do exactly what you tell them to do; you don’t have to stop program execution just to observe print statement output.
• Skip some code:
dbreak 50 -e {goto 63};
Any thread that reaches this breakpoint transfers to line 63.
• Stop a loop after a certain number of iterations:
dbreak 597 -e { if ( (i % 100) == 0)
{
printf("The value of i is %d\n", i);
$stop;
}
;
Uses programming language statements and a built-in debugger function to stop a loop every 100 iterations. It also prints the value of i.
dbreak 597 -e { $count 100 };
In contrast, this evalpoint just stops the program every 100 times a statement is executed.