AUTHOR: GPL(C) Mohsin Ahmed, http://www.cs.albany.edu/~mosh vim:ft=c:tags^=~/tags/debug.tag: moshtag=dbx,dbxrc DBX Equivalents for Common GDB Commands moshtag=gdb-dbx |========================|==============================|=============================| |GDB | DBX | WINDOWS ntsd,wdeb386,windbg| |========================|==============================|=============================| |break line | stop at line | F9 | |break func | stop in func |bp func A-F9 | |break *addr | stopi at addr |br,ba A-F9 | |break ... if expr | stop ... -if expr |bp f "j cond 'r';'g'" A-F9 | |cond n | stop ... -if expr | | |tbreak | stop ... -temp |bp f "bc" F9 F5 F9 | |watch expr | stop expr [slow] | | |watch var | stop modify &var [fast] | | | | stop change var | A-F9 | |catch x | intercept x | | |info break | status |bl A-F9 | |info watch | status | | |clear | clear | | |clear fun | delete n |bc | |delete | delete all |bc * A-F9 | |disable | handler -disable all |bd * C-F9 | |disable n | handler -disable n | | |enable | handler -enable all |be | |enable n | handler -enable n | | |ignore n cnt | handler -count n cnt |bp n cnt A-F9 | |========================|==============================|=============================| |set args | runargs | A-F7| |run | run args |g C-S-F5| |continue | cont |g (go) F5 | |stepi | stepi |t | |step | step | F11 | |next | next |p F10 | |jump line | cont at line |p =addr / g =addr R-Mouse| |finish | step up |bp retaddr+4 F12 | |return (now) | pop |g =retaddr | |until line | stop at line -temp;cont |bp func;g | |C-j | !! | (repeat) | |========================|==============================|=============================| |commands n | when ... { cmds; } |bp n "cmds" | |backtrace n | where n |kb ks kv | |frame n | frame n | | |info reg reg | print $reg |r | |signal num | cont sig num | | |set var=expr | assign var=expr |e (enter bytes),f (fill) | |x/fmt addr | x addr/fmt |d[abcw] addr (display) A-6| |disassem addr | dis addr |u C-F11,A-8| |shell cmd | sh cmd [if needed] | | |info func regex | funcs regexp |X (ntsd) | |ptype type | whatis -t type | | |define cmd | function cmd |zs,zl,zd (default cmd) | |handle sig | stop sig sig | | |info signals | status; catch |di (display IDT) | |attach pid | debug - pid | | |attach pid | debug a.out pid | | |file file | [unnecessary] | | |exec file | debug file | | |core file | debug a.out corefile | | |set editing on | set -o emacs | | |set language x | language x | | |set prompt x | PS1=x | | |set history size x | HISTSIZE=x | | |set print object on | dbxenv output_dynamic_type on| | |show commands | history | | |dir name | pathmap name | | |show dir | pathmap |lm | |info line [] (dbx) WHEN [] { ;} (dbx) TRACE [] EVENT = at at : in inclass modify
MODIFIER = -if -in -count ACTION = dbx or ksh commands. ============================================================ (dbx) STATUS # bl .. shows all traces,stops,whens (dbx) DELETE # bc .. delete one of above by number (dbx) CLEAR # bc .. delete one of above on given lineno or current line. Example BreakPoints: (dbx) STOP AT main.c:221 -if argc == 2 (dbx) STOP IN free -count 1000 (dbx) STOP IN malloc -if $o0 > 10000 (dbx) STOP CHANGE var (dbx) STOP IN free -temp # once only. (dbx) WHEN IN main -if argc==1 { print argv[argc-1] ;} (dbx) TRACE IN malloc -if $o0 == 16 # print all mallocs of size 16. Other useful commands: (dbx) CALL (ARGS) (dbx) PRINT (ARGS) (dbx) DUMP # show all local vars (dbx) DISPLAY # watch at all stops, (dbx) UNDISPLAY (dbx) check -leaks (dbx) showleaks (dbx) check -all (dbx) help rtc (dbx) fix files # edit and continue, not recommended. ============================================================