Skip to content

Instantly share code, notes, and snippets.

@ashelly
Last active July 19, 2023 18:44
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 ashelly/74b59a13929c95783b72fe415e18e0ba to your computer and use it in GitHub Desktop.
Save ashelly/74b59a13929c95783b72fe415e18e0ba to your computer and use it in GitHub Desktop.
gdb debugging setup

redirect output to another terminal

  • In target terminal type tty
  • copy the result (should be something like /dev/pts/0
  • in gdb window type tty <pasted-result>

tui mode

  • enable
    tui enable

  • show command and source window
    layout src

  • show command, src, and asm window
    layout split

  • switch active scroll window
    focus cmd
    focus src
    C-x o

threading

  • Prevent other threads from running when single-stepping
    set scheduler-locking step
  • Folow into children set follow-fork-mode child

  • Follow parent set follow-fork-mode parent

  • Don't detach from unfollowed (suspend it) set detach-on-fork off

    • see other forks info inferiors
    • release other forks to run detactch inferiors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment