dbx Command Summary
Here is a local copy ofshort explanation of commandsanddbx faq.
Basic Dbx Shell Commands
| !! | execute the previous command |
| r | execute the previous command |
| !<num> | execute command number |
| ! -<num> | execute command <num> before the current |
| history | list a history of dbx commands |
| . | read (source) dbx commands from a file |
| run | start the current process |
| kill | kill the controlled process |
| debug | print name and arguments of program being debugged |
| debug <prog> [<core>] | debug <prog> with corefile <core>(optional) |
| debug <prog> <pid> | attach to process <pid> |
| detach | detaches dbx from the controlled process |
| runargs <args> | set the run arguments for the current program |
| runargs . . . [>|>>]file> | output redirection for a program |
| runargs . . . < <file> | input redirection for a program |
| print [-r] [-d]<statement> | prints<statement>. |
| <statement> can be a function call, a local variable, or a constant |
| (though not a macro, because the c preprocessor and dbx don't |
| work and play well together |
| -r | -r prints inherited members in C++ |
| -d | uses dynamic (RTTI) type information to determine the type of |
| <statement> |
| print <arr>[<first>..<last>:<stride>] | print an array slice |
| examine <addr> = [ <fmt> ] | display an address in a format |
| examine <addr1>, <addr2> / fmt | examine memory in the given format |
| display <expr> | display an expression |
| undisplay <num> | turn off displaying expression number <num> |
| (0 turns off all displays) |
| where | display the stack trace. |
| up | move up one stack frame |
| down | move down one stack frame |
| i | instruction (disassembly) |
| d,D | decimal (2 or 4 bytes) |
| o,O | octal (2 or 4 bytes) |
| x,X | hexadecimal (2 or 4 bytes) |
| b | octal (1 byte) |
| c | character |
| w | wide character |
| s | string |
| W | wide character string |
| f | hex and float (4 bytes, 6 digit prec.) |
| F | hex and float (8 bytes, 14 digit prec.) |
| g | same as `F' |
| E | hex and float (16 bytes, 14 digit prec.) |
| ld,lD | decimal (4 bytes, same as D) |
| lo,lO | octal (4 bytes, same as O) |
| lx,LX | hexadecimal (4 bytes, same as X) |
| Ld,LD | decimal (8 bytes) |
| Lo,LO | octal (8 bytes) |
| Lx,LX | hexadecimal (8 bytes) |
| stop <event><modifier> | stop execution when <event> occurs |
| trace <event><modifier> | print out a message when <event> happens. |
| tracei <event><modifier> | like above, but works on assembly instructions |
| when <event> <command><modifier> | execute <command> when <event>happens |
| dbxenv trace_speed <num> | pause <num> seconds between traces |
| clear [<lineno>] | clears events at <lineno> (defaults to current line) |
| status | Print trace's, when's, and stop's in effect |
| status <hid> | print the status of handler (event) <hid> |
| status -s | print all events in a form that dbx can read |
| (dbx) status -s > bpts |
| |
| (dbx) source bpts |
| delete <num> | delete handler <num> (0 deletes all handlers) |
| call <proc><[params]> | call <proc> with the given parameters |
| cont | continues execution |
| next | next instruction (skip calls) |
| nexti | next assembly instruction (skip calls) |
| step | next instruction (enter calls) |
| stepi | next assembly instruction (enter calls) |
| regs | display the registers |
| dbxenv follow_fork_mode <spec> | <spec> can be child, parent, or ask |
| if <spec> equals parent, stay with the parent after a call to fork(2) |
| if <spec> equals child, follow the child after a call to fork(2) |
| if <spec> equals ask, then ask which to follow after a call to fork(2) |
| assign<var> = <exp> | assign <exp> to <var> |
| in <func> | When the program enters <func> |
| at <line> | When <line> in the current file is about to be executed |
| at<filename>:<line> | When <line> in<filename> is about to be executed |
| inmethod <func> | Entry into any method named <func> |
| infunction <func> | Entry into any overloaded version of <func> |
| inclass <class> | Trigger in any member of <class> |
| inmember <class> | Entry into any member function of a class (c++ only) |
| inobject. . . [>|>>] | Trigger in any member of an instance of a class (c++ only) |
| modify<addr-expr> [,<size-expr>] | Trigger when the address range is written to |
| throw | A C++ exception has been thrown |
| throw <type> | A C++ exception of type <type> has been thrown. |
| -if <cond> | event only fires when <cond> is true |
| -in <func> | event only fires when in <func> |
| -count <n> | count up from 0; fire event and reset counter whennhas been reached |
| -temp | A temporary event. Delete event when fired |
| check <type> | checks for runtime errors specified by <type> (see below) |
| check <type> <places> | check for runtime errors in <places> where <places> |
| is a comma separated list of files, functions, or loadobjects. |
| this can be used to focus RTC on specific places. |
| uncheck <type> | stops checking for runtime errors. |
| showleaks [-v] | shows memory leaks (-v for verbose) |
| showmemuse [-v] | shows memory usage (-v for verbose) |
| suppress | History of suppress and unsuppress commands |
| suppress <errors> | Suppress <errors> everywhere. |
| suppress <errors> <places> | Suppress <errors> in <places> where <places> |
| is a comma separated list of files, functions, or loadobjects. |
| unsuppress <errors> | Stop suppressing <errors> everywhere. |
| unsuppress <errors> <places> | Stop suppressing <errors> in <places>. |
| baf | Bad free |
| duf | Duplicate free |
| maf | Misaligned free |
| mar | Misaligned read |
| maw | Misaligned write |
| oom | Out of memory |
| rua | Read from unallocated memory |
| rui | Read from uninitialized memory |
| wro | Write to read-only memory |
| wua | Write to unallocated memory |
| aib | Possible memory leak - only pointer points in the middle of the block |
| air | Possible memory leak - pointer to the block exists only in register |
| mel | Memory leak - no pointers to the block |
| -access | Stops the process whenever a memory access error occurs. |
| This checks forbaf, duf, maf, mar, maw, oom, rua, rui, wro, wua |
| If you setdbxenv rtc_autoto ``on'', then access errors will be |
| logged to a file rather than halting execution (controlled byrtc_error_log_filename) |
| -leaks | Generates a list of memory leaks when the program terminates. |
| checks foraib, air, mel. The report is not verbose by default, |
| controlled byrtc_mel_at_exit. Also, you can useshowleaksat any time |
| -memuse | Generates a list of blocks in use when the program terminates. Implies -leaks |
| This report is not verbose by default, and controlled byrtc_biu_at_exit |
| -all | Checks for memory usage and leaks |
All RTC checking types may be followed by either of the following two options:
| -frames <n> | Display <n> distinct stack frames when reporting leaks. |
| -match <m> | if two or more errors match <m> or more stack frames, then |
| they are reported as one error. |
| list | list the default number of lines in the current file |
| list <n> | list line number <n> in the current file |
| list +<n> | list the next <n> lines in the current file |
| list<n1>, [+]<n2> | list lines from <n1> to <n2> (or the next <n2> lines if +<n2>) |
| list<filename>:<n> | list line <n> in filename. |
| list -i | intermix assembly lines between source lines |
| list -w | list a window of 10 lines. |
| edit<filename> | edit (in$EDITOR)<filename> |
| edit <proc> | edit file containing procedure <proc> |
| dis<addr> [/<count>] | disassemble <count> instructions at <addr> |
| whereis <func> | Returns the file containing <func> |
| whatis <name> | returns the type of <name>. Example: ``whatis main'' would |
| return ``void main(int argc, char **argv)'' |
| collector | collect information about performance. |
| __cb_prompt | A ksh function that gets called before the prompt is displayed |
| dalias | set (or list) a dbx alias |
| ignore <signal> | ignore signal named/numbered <signal> |
| (un)intercept<typename> | (do not) intercept throws of type<typename> |
| (un)intercept -a | (do not) intercept all throws |
| (un)intercept -x<typename> | (Do not) intercept throws of type<typename>(use with above) |
| (un)intercept | list intercepted types |
| fix | fix the current file. |
| fix | Fix list of files |
| fix -f | Force fixing of a file, even if it has not been modified. |
| fix -a | Fix all modified files |
| fix -g | strip -O flags and replace with -g flags |
| fix -c | print compilation line |
| fix -n | no execution (list what would have been done) |
| fix -v | verbose mode |
| fix +v | non-verbose mode |
| __cb_fix_comp | dbxenvvariable that controls compilation options |
| __cb_fix_link | dbxenvvariable that controls link options |
| fix_verbose | dbxenvvariable that printing of the compilation line during a ``fix'' (default off) |
| fix-pitfalls | the section ofhelpthat lists ``fix'''s limitations. |