58

When debugging with GDB, i usually using layout src to check my code. But when i open it, i don't know how to close it. It seems that there are some other layout, and when open a new layout, it will split the window, but i still can not found a command to merge the splitted windows.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Frank Cheng
  • 5,928
  • 9
  • 52
  • 80

2 Answers2

85

You can always leave or enter TUI at any time durring debug session. For example you can do it with ctrl+x a key binding. 25.2 TUI Key Bindings.

ks1322
  • 33,961
  • 14
  • 109
  • 164
  • I'm living a VM linux on Windows. When enter into TUI mode, all `ctrl-x ..` do not work. So that I can't quit TUI using `ctrl-x a`. I'm looking for a command like `focus src` to let me leave TUI. – Hong May 30 '15 at 07:16
  • 1
    I found a solution from http://stackoverflow.com/questions/8953720/multiple-problems-with-gdbs-tui-mode. I used to enter into TUI mode by firstly running gdb then hit `ctrl-x a`, in which situation `ctrl-x a` doesn't let me out. While if I start gdb with `gdb a.out -tui`, all things work fine. – Hong May 30 '15 at 07:26
  • ctrk-x a does not work if you are on byobu, used q to quit TUI. – Anil Gupta Jul 12 '20 at 15:12
20

vi Readline input bug

In GDB 7.7, Ctrl-x + a does not work if you have in your ~/.inputrc:

set editing-mode vi
set keymap vi

If I remove those lines it works.

This seems to be mentioned at in the following bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=15163

I have requested a workaround at https://sourceware.org/ml/gdb/2015-06/msg00009.html 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: https://github.com/cyrus-and/gdb-dashboard which is simply more powerful and less buggy.

See also: http://superuser.com/questions/180512/how-to-turn-off-gdb-tui

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985