Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dbx(1) — SunOS 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

f77(1)

pc(1)

DBX(1)  —  USER COMMANDS

NAME

dbx − source-level debugger for C, FORTRAN 77 and Pascal programs

SYNOPSIS

dbx [ −r ] [ −i ] [ −I dir ] [ −k ] [ −kbd ] [ objfile [ corefile ] ]

DESCRIPTION

 

Dbx is a utility for source-level debugging and execution of programs written in C FORTRAN 77 and Pascal.  It accepts the same commands as dbxtool(1), using a standard terminal interface rather than the window system.

Objfile is an object file produced by cc(1), f77(1) or pc(1) (or a combination of them) with the appropriate flag (−g) specified to produce symbol information in the object file.  IMPORTANT: every stage of the compilation process, including the linking phase, must include the −g option. 

If no objfile is specified, use the dbx debug command to specify the program to be debugged.  The object file contains a symbol table which includes the names of all the source files translated by the compiler to create it.  These files are available for perusal while using the debugger. 

If a file named core exists in the current directory or a corefile is specified, dbx can be used to examine the state of the program when it faulted. 

Debugger commands in the file .dbxinit are executed immediately after the symbolic information is read, if that file exists in the current directory, or in the user’s home directory if .dbxinit doesn’t exist in the current directory. 

OPTIONS

−rExecutes objfile immediately.  Parameters follow the object file name (redirection is handled properly).  If the program terminates successfully, dbx exits.  Otherwise, dbx reports the reason for termination and waits for user response.  Dbx reads from /dev/tty when −r is specified and standard input is a file or pipe. 

−iForces dbx to act as though standard input is a terminal or terminal emulator. 

−I dirAdds dir to the list of directories that are searched when looking for a source file.  Normally dbx looks for source files in the current directory and in the directory where objfile is located.  The directory search path can also be set with the use command. 

−kKernel debugging. 

−kbdDebugs a program that sets the keyboard into up/down translation mode.  This flag is necessary if the program you are debugging uses up/down encoding. 

USAGE

Refer to Dbx in Program Debugging Tools for the Sun

FILES

a.outdefault object file
coredefault core file
~/.dbxinitinitial commands

SEE ALSO

cc(1)C compiler
f77(1)FORTRAN compiler
pc(1)Pascal compiler
Program Debugging Tools for the Sun

BUGS

Dbx does not correctly handle C variables that are local to compound statements.  When printing these variables it often gives incorrect results. 

Dbx does not handle FORTRAN entry points well — it treats them as if they were independent routines. 

Dbx does not handle assigning to FORTRAN complex types correctly (see the assign/set command). 

Some operations behave differently in dbx than in C. 

•Dbx has two division operators — / always yields a floating-point result and div always yields an integral result. 

•An array or function name does not signify the address of the array or function in dbx.  An array name signifies the entire array, and a function name signifies a call to the function with no arguments.  The address of an array can be obtained by taking the address of its first element, and the address of a function can be obtained by taking the address of its name. 

Casts do not work with FORTRAN 77 or Pascal. 

Executable code incorporated into a source file using an #include preprocessor directive confuses dbx . 

Using both the −R and the −g compiler options when compiling programs causes dbx to access incorrect addresses for the variable, which in turn causes −R to be store in the text segment. 

dbx is confused by the output of program generators such as yacc and lex. 

Sun Release 3.0β  —  Last change: 21 December 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026