University of Virginia Department of
    Computer Science
dbx - source-level debugger
	
     dbx [ -c  dbx cmd ] [ -e ] [ -Idir ] [ -kbd ] [ -q ] [ -r ] [ -s startup ] [ -sr startup ] [ execfile [ corefile | process-id ]  ] [ -C ] [ -notempl ]


Description

Dbx is a utility for source-level debugging and execution of programs written in C++, ANSI C, FORTRAN , and Pascal. dbx accepts the same commands as debugger(1), but uses a standard terminal (tty) interface. For a full overview of dbx and Debugger features see the Debugging a Program user guide.
execfile is an executable file, produced by a compiler, with the -g option to include a symbol table. This symbol table contains the names of all the source files used to create the execfile (all of which may be browsed), as well as wide range of debugging information. Debugging support is limited for any parts of a program not compiled with the -g option.
Initially, symbol table information is stored piecemeal in each of the object files the compiler creates. (If compilation does not create an object file, all debugging information is stored in the execfile . ) Distributing the debugging information in the object files allows dbx to read and load debugging information as it is needed. This feature is called Auto-Read. If you need to move object files from their original location, make sure that dbx knows where to find them. (See the use and pathmap commands.) If it is not feasible to keep program .o files around, you can disable Auto-Read by compiling using the - xs option. -xs instructs the compiler to have the linker place all debugging information in the program executable.
If, when starting dbx , no execfile is specified, use the debug command to specify a program to be debugged. If you know a process ID but not the execfile , you can use the (dash) as the execfile and give the process ID option to attach the process to dbx .
If a corefile argument is specified, you can use dbx to examine the state of the program when the core file was produced.
dbx executes commands in the .dbxinit file immediately before it reads the symbol table. dbx first searches for .dbxinit in the current directory. If .dbxinit does not exist in the current directory, dbx looks in the user's home directory.

Runtime Checking (RTC) is a fully integrated feature of the dbx ; it uses the full capabilities of the dbx including setting breakpoints and examining variables. With RTC , you can automatically detect runtime errors in an application during the development phase. Compiling with the -g flag provides source line number correlation in the error messages. RTC can check programs compiled with the optimization - O flag. You do not have to recompile, relink, or modify the makefile to use RTC.
For proper operation, RTC requires dynamic linking with libc , use of the standard libc malloc/free/realloc , and does not support attachment to a running process.
To use RTC , start dbx with the -C option or either set the environment variable SW_RTC or specify the -C option each time you start dbx.

Options

Some of the "useful" options are the following:

Basic commands

The basic commands to know are: run, to run the program being debugged; where, to obtain a stack trace with line numbers; print, to display variables; and stop, to set breakpoints.
Other commands are the following:

Environment

dbx checks the environment variable EDITOR for the name of the text editor to use with the edit command.

See also



HelpNet
HelpNet was created by the 1995 incoming graduate class. It is only occasionally updated.
Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214
Web Comments: webteam@cs.virginia.edu
Admissions Inquiries: inquiry@cs.virginia.edu
Site directory, Other addresses
Server statistics
© Created by the CS Web Team