How to close layout SRC windows in gdb?

Solution 1:

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.

Solution 2:

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