Skip to content

Instantly share code, notes, and snippets.

@XiaochenCui
Last active August 20, 2019 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XiaochenCui/5c42ea6bbdf85c5cf317553687504d0e to your computer and use it in GitHub Desktop.
Save XiaochenCui/5c42ea6bbdf85c5cf317553687504d0e to your computer and use it in GitHub Desktop.
gdb cheat sheet

Layout

  • layout split : Displays source, disassembly and command windows.
  • layout regs : Displays register window.
  • ctrl-x + a : reset layout

Registers

  • i r <register_name> : print a single register, e.g i r rax, i r eax
  • x/Nx addr : Display a hex dump of N words starting at virtual address addr. If N is omitted, it defaults to 1. addr can be any expression.
  • x/Ni addr : Display the N assembly instructions starting at addr. Using $eip as addr will display the instructions at the current instruction pointer.

Tui Mode

  • Ctrl-p : previous command

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment