It's called the TUI (no kidding). Start for example with gdbtui or gdb -tui ...
Please also see this answer by Ciro Santilli. It wasn't available in 2012 to the best of my knowledge, but definitely worth a look.
Answer from 0xC0000022L on Stack OverflowDoes anyone use GDB without the TUI? If so, how? What are the use cases for not using the TUI?
How do I explore this code with gdb?
Videos
It's called the TUI (no kidding). Start for example with gdbtui or gdb -tui ...
Please also see this answer by Ciro Santilli. It wasn't available in 2012 to the best of my knowledge, but definitely worth a look.
You can trigger it dynamically by push ctrl+x and ctrl+a.
I’ve typically only used my IDE’s native debugger, but I’ve switched to GDB predominately now.
By default, there is no TUI, I need to specify with —tui
I can’t really justify it? Even if I’m using GDB’s Python interpreter or looking at local variables.
You can enter / leave the TUI mode with one of this combinations:
- C-x C-a
- C-x a
- C-x A
This is typically (no need to lift the Ctrl key):
- Ctrl + X + A
Because of the bug Ulerich mentioned which breaks the mappings if you have vi mode in your .inputrc, I have requested a workaround here and Andrew Burgess replied that he had just submitted a well received patch to add:
tui enable
tui disable
So in future versions we should have commands as an alternative to the shortcuts.
I have later tested this on GDB 8.1 in Ubuntu 18.04 and it worked perfectly.
But then I saw the light and moved from TUI to GDB Dashboard which is simply more powerful and less buggy.
See also: https://stackoverflow.com/questions/8409540/how-to-close-layout-src-windows-in-gdb
Hello I recently started learning c and so I'm currently learning to use the gdb bebugger. I'm finding that when I run my code with the debugger I only get asm code instead the c I've written. I can't find any solutions to this on the web.
This is a walk through of what I'm doing:
gcc test.c -o debug
gdb ./debug
layout next
After I type layout next I get a screen of the code I've written but in asm. Is there a solution to this?
This code is from book I'm using to learn (Introduction to 64 bit Intel Assembly Language Programming for Linux).
segment . data a dq 175 b dq 4097 segment . text global main main : mov rax , [a] ; mov a into rax add rax, [b] ; add b to rax xor rax, rax ret
How do I compile it so that I can explore it with gdb on Fedora?
I've tried:
nasm -f elf64 -g -o add_ints.o add_ints.asm
And then
ld -o add_ints add_ints.o
But when I ran gdb on add_ints and tried r I got a segmentation fault.