DBX QUICK INFO
================================
Compile with the -g option: % cc -g mypgm.c
Print your program with
line numbers: % cat -n mypgm.c | lpr -Pqms
Edit & view your program with % vi mypgm.c
line numbers: :set nu (inside vi)
To invoke dbx: % dbx a.out
(dbx) quit Gets out of dbx
(dbx) sh temporarily gets back to UNIX (shell)
(dbx) list List source code
(dbx) list 15,25 lists lines 15 through 25
(dbx) list funcname lists 10 lines of named function
(dbx) stop at 57 put a break point on line 57
(dbx) run start execution
(dbx) run arg1 arg2 arg3 start execution with these arguments
(dbx) run < file1 > file2 start ex. using file I/O redirection
(dbx) rerun Restart execution (can use < and args, too)
(dbx) where print line number which it will do next
(dbx) status show breakpoints
(dbx) clear 57 clear the breakpoint at line 57
(dbx) step advance only 1 line, i.e. do next line & stop
(dbx) cont continue execution from this point to next
breakpoint
(dbx) next execute the next line but don't step "into" a
function's code; just do it and proceed to
next line
(dbx) print x print variable x
You can print almost any C variable, array, or struct:
print table[i]
print ptr->part1
print x.part1
If a program is running, you can press CONTROL-C to interrupt it. Dbx will
give you the (dbx) prompt. Use "where" to find out where you are. You can
cont from there.