Debugging a Program With dbx

Scenario 4: Comparing Data Graphs from Different Runs of Same Program

Data graphs persist between different runs of the same program. Graphs from previous runs will not be overwritten unless they are manually updated or automatic updating is turned on.

  1. Load the C or Fortran example program.

  2. Set a breakpoint at the end of the program.

  3. Start the program, running the program to the breakpoint.

  4. Type vec into the expressions text field, and choose Data Graph Expression.

  5. A graph of the vec array appears (as a sine curve).

  6. Now you can edit the program (for example, replace sin with cos). Use fix and continue to recompile the program and continue (click the Fix tool bar button).

  7. Restart the program.

  8. Because automatic updating is turned off, the previous graph does not get updated when the program reaches the breakpoint.

  9. Choose Data Graph Expression (vec is still in the Expressions text field), a graph of the current vec values appear alongside the graph of the previous run.

  10. The data from the two runs can now be compared. The graph of the previous run will only change if it is updated manually using the update button, or if automatic updating is turned on.