This page was last modified 2009-12-15 19:13:27 by Puchu.Net user Choco
. (Show history)
|execute next function
|step into function
|step out of function
|start running program with arguments
|print backtrace of stack frames
|switch stack frames
|inspect specified thread
dis break ?
enable break ?
|enable disabled breakpoint
delete break ?
0xd to a memory address replaces the instruction with a breakpoint.
|print value of variable
|show type of variable
|print variable structure
set print pretty on
|print variables one per line, easier to read
|print value of variable automatically when a breakpoint is hit
dis display ?
|disable watching variable
enable display ?
|enable disabled variable watching
|list variables being watched
delete display ?
|delete watched variable
|dump specified amount of memory at address|
(gdb) x/16x 0xbfbf06ac
0xbfbf06ac: 0x08496b13 0x0963e848 0x00000000 0x088d5dcf
0xbfbf06bc: 0x0000008f 0x088d5d0c 0x088d5dcf 0x088b4401
0xbfbf06cc: 0x088d5d0c 0x097b5e38 0x082716b0 0xb34d94f8
0xbfbf06dc: 0xb7c1d3e1 0xbfbf0718 0xb7c214f0 0xb7cfe160
|dump register values
disas ? ?
|disassembles between address ranges
Other commands that may be useful:
info local, and
mem ? ? ro 32
|define read-only memory region between two addresses using 32-bit memory access
dis mem ?
|disable memory region
enable mem ?
|enable disabled memory region
|list defined memory regions
delete mem ?
|delete defined memory region
dump ihex filename ? ?
|dump memory to file in Intel hex format
dump binary filename ?
|dump expression to file in binary format
- To ignore SIGPIPE:
handle SIGPIPE nostop noprint pass.
- Remote debugging by executing
gdbserver x.x.x.x:xxxx ..., and connect with command
target remote x.x.x.x:xxxx. Since program is already running, use
continue instead of
- If library symbols are missing, use
set solib-search-path ... or
set solib-absolute-prefix ... to load symbols from target.
- If backtrace isn't going back as far as you like, try
set heuristic-fence-post 100000.
- Older versions of gdb is useless when debugging multi-threaded application. 6.8 seems to work well?
Document is accessible from
© 2002-2010 Sean Yang, Karen Yang, Don Yang and/or respective authors,
all rights reserverd.
This material may contain (biased) opinions,
inappropriate materials for numerous individuals,
work of other authors from the internet,
links that refer to other web documents and resources, or
origial work that cannot be use for personal or commercial purposes.
Please respect the work of original authors.