gdb
Table of ContentsClose
1. Basics
- Pressing
retwill run the same command. b: set breakpointr: run
1.1. Printing info
Once in a breakpoint
[p]rint <expression>p/x <expr>: print in hex[i]nfo {[f]rame, [s]tack, [r]registers, [b]reak}
1.2. Disassembly/Assembly
[disassemble] <function name>display/I %pc: Display next instruction
1.3. Layout
layout nextand following withretwill allow you to loop though layouts.- Use
focus {cmd, src, asm}to change keyboard focus, otherwise arrow keys(eg. prev command/scroll) will not work - Layouts
nextwill display the next layout.prevwill display the previous layout.srcwill display the source and command windows.asmwill display the assembly and command windows.splitwill display the source, assembly, and command windows.regswill display the register, source, and command windows when in src layout.
1.4. Stepping
[s]tep: Into function calls[n]ext: Over functions calls, stepping by lines[b]ack[t]race/i stack/where: backtrace, prints stacktrace