sdb: symbolic debugger

Setting and deleting breakpoints

Breakpoints can be set at any line in a function compiled with the -g option. The command format is as follows:

The first form sets a breakpoint at line 12 in the current file. The line numbers are relative to the beginning of the file as printed by the source-file display commands. The second sets a breakpoint at the first line of proc. The last sets a breakpoint at the current line.

Similarly, breakpoints are deleted with the d command:

In addition, if the command d is given alone, the breakpoints are deleted interactively. Each breakpoint location is printed, and a line is read from the user. If the line begins with a y or a d, the breakpoint is deleted.

The B command prints a list of the current breakpoints and the D command deletes all breakpoints. It is sometimes desirable to have sdb automatically perform a sequence of commands at a breakpoint and then have execution continue. This is achieved with another form of the b command:

   *12b t;x/
This causes both a trace back and the value of x to be printed each time execution gets to line 12. The a command is a variation of the above command. There are two forms:
The first prints the function name and its arguments each time it is called, and the second prints the source line each time it is about to be executed. For both forms of the a command, execution continues after the function name or source line is printed.
Next topic: Running the program
Previous topic: A controlled environment for program testing

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003