Basic Debugging
This chapter illustrates some basic debugging tasks and is based on the shipped program, expression, located in the directory installdir/toolworks/totalview.version/platform/examples.
NOTE: We recommend that you follow the procedure in the README.TXT file in the examples directory to create a local copy of the examples and rebuild them in your environment.
This program takes expressions input by the user and evaluates them. For the purposes of this example, we’ll instead redirect the standard input to read a file, expr.tst, also located in the examples directory. This file includes three simple expressions:
2+3
2*(4/5)
(1/2)-(3/4)
The first steps when debugging programs with TotalView are similar to those using other debuggers:
Use the
-g option to compile the program.
Start the program under TotalView control.
Start the debugging process, including setting breakpoints and examining your program’s data.