NextGen TotalView for HPC User Guide : PART II Debugging Tools and Tasks : Chapter 5 Setting and Managing Action Points (Breakpoints) : Evalpoints : Patching Programs : Correcting Code
Correcting Code
The following example contains a coding error: the function returns the maximum value instead of the minimum value:
1 int minimum (int a, int b)
2 {
3 int result; /* Return the minimum */
4 if (a < b)
5 result = b;
6 else
7 result = a;
8 return (result);
9 }
Correct this error by adding the following code to an evalpoint at line 4:
if (a < b) goto 7; else goto 5;
This effectively replaces the if statement on line 4 with the code in the evalpoint.