I use this one personally: gdb's cheat sheet or that link is not broken yet .. . I 've printed it at work.

Answer from yves Baumes on Stack Overflow
🌐
Darkdust
darkdust.net › files › GDB Cheat Sheet.pdf pdf
GDB Cheat Sheet.pdf
GDB cheatsheet - page 1 · © 2007 Marc Haisenko <[email protected]> Format · a · Pointer. c · Read as integer, print as character. d · Integer, signed decimal. f · Floating point number. o · Integer, print as octal. s · Try to treat as C string. t · Integer, print as binary (t = „two“).
🌐
GitHub
github.com › reveng007 › GDB-Cheat-Sheet
GitHub - reveng007/GDB-Cheat-Sheet
*(gdb) break main set a breakpoint on a function *(gdb) break 101 set a breakpoint on a line number *(gdb) break basic.c:101 set breakpoint at file and line (or function) *(gdb) info breakpoints show breakpoints *(gdb) delete 1 delete a breakpoint by number (gdb) delete delete all breakpoints (prompted) (gdb) clear delete breakpoints at current line (gdb) clear function delete breakpoints at function (gdb) clear line delete breakpoints at line (gdb) disable 2 turn a breakpoint off, but don't remove it (gdb) enable 2 turn disabled breakpoint back on (gdb) tbreak function|line set a temporary breakpoint (gdb) commands break-no ...
Starred by 21 users
Forked by 7 users
🌐
Gabriellesc
gabriellesc.github.io › teaching › resources › GDB-cheat-sheet.pdf pdf
GDB Cheat Sheet Basics $ gcc ­g ...
GDB Cheat Sheet · Basics · $ gcc ­g ... create an executable that can be debugged using GDB · $ gdb progName · start debugging progName · $ gdb ­­args progName args · start debugging progName, using command-line arguments args · (gdb) q · quit GDB ·
🌐
CS:APP
csapp.cs.cmu.edu › 3e › docs › gdbnotes-x86-64.pdf pdf
Summary of GDB commands for x86-64 Systems Command Effect
Summary of GDB commands for x86-64 Systems · Command Effect · Starting: gdb · gdb <file> Running and stopping · quit Exit gdb · run Run program · run 1 2 3 Run program with command-line arguments 1 2 3 · kill Stop the program · quit Exit gdb · Ctrl-d Exit gdb ·
🌐
Brown
cs.brown.edu › courses › cs033 › docs › guides › gdb.pdf pdf
CSCI0330 Intro Computer Systems Doeppner gdb Cheatsheet Fall 2018
gdb Cheatsheet · Fall 2018 · 1 Introduction · 1 · 2 Program Execution · 1 · 3 TUI (Text User Interface) Mode · 4 · 4 Viewing Variables, Registers and Memory · 4 · 5 More Information · 5 · 5.1 Official Documentation · 6 · 5.2 Tutorials · 6 · 6 Tips ·
🌐
USC CS and ECE
bytes.usc.edu › cs104 › wiki › gdb
GDB Cheat Sheet
Breakpoint 1, Skirmish (protectors=0x61a0a0, invaders=0x61a220, n=2, m=3, skirmishLine=1, numReserves=@0x7fffffffd970: 0, outputFile=...) at game_of_pointers_student2.cpp:110 110 bool protectorLost = false; (gdb) n 111 if (invader->weapon == protector->weapon) (gdb) print invader->weapon $3 = "axe" (gdb) print protector->weapon $4 = "axe" (gdb) n 113 if (invader->power < protector->power) (gdb) print invader->power $5 = 30 (gdb) print protector->power $6 = 100 (gdb) n 115 protectorLost = true; (gdb) c
Find elsewhere
🌐
TrebledJ's Pages
trebledj.me › posts › gdb-cheatsheet
GDB/GEF Cheatsheet - TrebledJ's Pages
September 11, 2023 - This is a curated collection of GDB/GEF commands which I find incredibly useful for dynamic analysis and reverse engineering. These are mainly personal notes and may be incomplete, but suggestions...
Top answer
1 of 3
43

I use this one personally: gdb's cheat sheet or that link is not broken yet .. . I 've printed it at work.

2 of 3
5
  +========================+==============================+=============================+
  |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                     | !!                           |<CR> (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 <n            | listi n                      |                             |
  |info source             | file                         |ln                           |
  |info sources            | files; modules               |                             |
  |forw regex              | search regexp                |lse regexp                   |
  |rev regex               | bsearch regexp               |                             |
  |.gdbinit                | .dbxrc (was .dbxinit)        |                             |
  |q                       | quit                         |q                            |
  +========================+==============================+=============================+
🌐
Stanford
web.stanford.edu › class › archive › cs › cs111 › cs111.1254 › gdb-cheat-sheet.html
CS111 GDB Cheat Sheet
GDB Cheat Sheet · Handout by John Ousterhout, with modifications by Nick Troccoli · This page contains some tips about how to use gdb. For more in-depth debugging tips, check out the CS107 debugging guide: Open CS107 Debugging Guide · To start gdb, type the command ·
🌐
GitHub
github.com › rustymagnet3000 › gdb
GitHub - rustymagnet3000/gdb: gdb cheat sheet
gef➤ print &changeme $2 = (int *) 0x601050 <changeme> gef➤ print changeme $3 = 0xff gef➤ print "foobar" $1 = "foobar" gef➤ print $1 $2 = "foobar" (gdb) p/x $foo $1 = 0x3 (gdb) p $foo $2 = 3 (gdb) p 5+5 $5 = 0xa p/d 0xffffd59c - 0xffffd560 $35 = 60 p/tz $eip // print leading zeroes $4 = 0x08049201 gef➤ x/s $esp 0xffffd570: "AAAA" gef➤ p $esp $1 = (void *) 0xffffd570 gef➤ p (char *) $esp $2 = 0xffffd570 "AAAA" (gdb) p $bar = "hello" $3 = "hello" (gdb) p/x $bar $4 = {0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0} (gdb) p $bar $5 = "hello"
Starred by 25 users
Forked by 4 users
🌐
Zachgrace
zachgrace.com › cheat_sheets › gdb
GDB Cheat Sheet · Zach Grace
GDB Cheat Sheet · This is a collection of commands I’ve found useful when working with GDB. Run an executable with args: gdb --args path/to/executable -every -arg you can=think < of · gdb -q --args ./bof $(/opt/metasploit-framework/tools/pattern_create.rb 1000) Set a breakpoint: break main ·
🌐
Scribd
scribd.com › document › 77009327 › Gdb-Cheat-Sheet
GDB Cheat Sheet | PDF | Computer Engineering | Software Development
This cheat sheet provides a summary of useful gdb commands for debugging C/C++ programs. It explains how to start gdb, set breakpoints, step through code, view variables and more.
🌐
HWS
math.hws.edu › eck › cs431 › f16 › about-gdb.html
About gdb
The rest of this document discusses gdb commands to do all these things. Remember that these commands are given at the (gdb) prompt while the debugger is running. The most common commands have one or two letter equivalents (such as "c", "s", and "n" for "continue", "step", and "next").
🌐
University of Washington
courses.cs.washington.edu › courses › cse351 › 17au › gdb
CSE 351 GDB
GDB cheat sheet · A handy dandy guide to the most commonly used GDB commands. Useful to have open while using GDB (and going through the other resources here). Intro to GDB · This very useful video shows you how to get started with GDB. Extensive tutorial ·
🌐
Wokwi Makers Blog
blog.wokwi.com › gdb-avr-arduino-cheatsheet
Arduino/AVR GDB Cheat Sheet
June 26, 2021 - List of common GDB commands for debugging AVR code + useful shortcuts
🌐
Reddit
reddit.com › r/c_programming › gdb cheatsheet
r/C_Programming on Reddit: gdb cheatsheet
February 17, 2018 - Jumping around between a handful of languages and debuggers, my brain can get mixed up. Glancing quickly at a cheatsheet is enough for me to re-familiarize myself with the debugger-at-hand. ... There's a large one in gdb/doc/refcard.tex.
🌐
Walls
cs4401.walls.ninja › notes › quick › gdb.html
CTF - Quick Notes: GDB Cheatsheet
Reload the binary: file foo, useful if you pop a shell with execv from inside of gdb.
🌐
Readthedocs
mdb.readthedocs.io › en › stable › gdbcheatsheet.html
gdb Cheat Sheet — mdb 1.0.0 documentation
gdb Cheat Sheet · View page source · Most valid gdb commands can be used in mdb (as long as they run in remote execution mode – but that’s nearly all the useful ones I can think of). The main exceptions are start and run and these wouldn’t work in MPI mode anyway because you cannot (as far as I know) restart and MPI application from within the process.