Debugging a program


dbx can be used to debug programs written in C, C++, Pascal and Fortran.
Use "man dbx" to have a complete description of the debugger commands.
To start the debugger :
    > dbx prog_name
The most comm
only used commands are :
dbx> l n              List next n lines
     l n1,n2          List from line n1 to line n2
     l func           List function func
dbx> W                List 10 lines before & after

dbx> b #line          Set a break point at this source line number
dbx> stop variable    Stop if variable changes value
dbx> trace var at #line
                      Tracing a variable during execution
dbx> d n              Delete a break point or a trace event

dbx> run [args] [fout]
                      Run the program, passing the arguments
                      
dbx> cont             Continue execution
dbx> cont to #line    Continue up to this line number
dbx> n [n]            Execute next code line(s)
                      (doen't go into functions)
dbx> step [n]         idem, but go into functions
dbx> return [procedure]
                      Continue until a return to procedure is called
dbx> call func(parms)
                      Execute function func
                      
dbx> print var_name   Print value of var_name
dbx> printf "%x" var  --- idem in hexadecimal ---
dbx> status           List current break points & trace events
dbx> j                --- idem ---
dbx> sh command       Execute the specified shell command
dbx> q                Quit the debugger