debugging with GNU DeBugger (GDB)

25年 1月 2日 Thursday
192 words
1 minutes

TUI mode

debugging with TUI is more comfy for me personally, as you can view the source code and the disassembled version at the same time on different two window!

trivia fact that you might didn't know when using TUI mode:

  • select some text by pressing shift first.
  • search command in history is done as the same as bash's keybinding, Ctrl + r and Ctrl + s, see the GDB manual section 33.2.5 Command Line Editing > Readline Interaction > Searching for Commands in the History
  • arrow up and down is replaced by Ctrl + p and Ctrl + n respectively, see the GDB manual section 25.2 Text User Interface > TUI Key Bindings
  • I haven't figured out how to clear window command on TUI mode, yet (stackoverflow solution isn't working anymore).
  • enable or disable (toggle) TUI mode: Ctrl + x + a

commands

  • next - skip a subroutine
  • step - enter a subroutine
  • stepi - execute exactly one assembly instruction
  • finish - execute until reach end of subroutine or stack frame
  • display - if an old value of a variable changed, print the old and new values
  • p *<array>@<len> - print an <array> and specify the length with <len>
  • more to explore: breakpoint tracepoint checkpoint watchpoint

Title:debugging with GNU DeBugger (GDB)

Author:ReYuki

Link:https://www.reyuki.site/posts/gdb [copy]

Last updated:


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt it, as long as you give appropriate credit, don’t use it for commercial purposes, and distribute your contributions under the same license. Provided under license CC BY-NC-SA 4.0