The content of this document may be incorrect or out dated.
Get started using the debugger DBX
Dbx can be a very helpful debugger. It works on C, FORTRAN, and Pascal code. In order to use dbx, you must compile your code with the -g flag. This flag causes the compiler to include a symbol table that dbx needs. Type:
man ccfor more details.
The basic list of dbx commands are:
- Start execution of a program.
- stop at line-number
- Insert a breakpoint at the given line number. When a running program reaches a breakpoint, execution stops and control returns to the debugger.
- stop in function-name
- Insert a breakpoint at the first line of the named function. Commonly, the command stop in main is used to stop at the beginning of the program.
- Continue execution after a breakpoint.
- print expression
- Display the value of an expression.
- Execute a single line in the program. If the current statement calls a function, the function is single-stepped.
- Execute a single line in the program, but treat function calls as a single line. This command is used to skip over function calls.
- List the source programs.
- Print the list of currently active functions.
SummaryIf you get a core dump:
- (Re)compile with -g
- Run (and get coredump)
- dbx a.out core
- "where" tells you on what line (or close to it) you died
For more information, type:
% man dbx
Last modified: 2007/05/24 14:28:6.721000 GMT-4 by
Created: 2007/05/24 14:28:6.721000 GMT-4 by brian.r.brinegar.1.
Type in a few keywords describing what information you are looking for in the text box below.