Olivier Diotte
Olivier Diotte

Reputation: 443

How to fix GDB TUI size problems?

When switching the TUI mode on and off (with Ctrl+x, a), gdb often gets stuck using only half the screen (so the cmd and src windows take only 1/4 of the screen each) and winheight cmd + 5 won't work.

How can I prevent or fix this?

Upvotes: 4

Views: 2612

Answers (2)

mkk
mkk

Reputation: 675

I had similar issue when I was working on Windows, connecting through Putty to my server where gdb was running.

I found out that gdb took from Putty information about terminal resolution (or putty delivered it to gdb?). Unfortunately, when Putty window was maximised, the information send/received described normal (restored) window size.

To solve it I just restored putty window to normal size, manually resized it to look as maximised and maximised once again. After switching TUI off and on I could work with whole the screen.

Upvotes: 2

Olivier Diotte
Olivier Diotte

Reputation: 443

This is apparently a problem related to readline.

Someone apparently already looked into it: http://patchwork.sourceware.org/patch/6398/ so hopefully it should be fixed in newer versions of gdb.

In the meantime, the following kludge can be used to fix the problem when it happens:

  1. Toggle the TUI mode until you get the problem
  2. Open another terminal on the computer where gdb is running and send SIGWINCH to the gdb process with a command like pkill -SIGWINCH gdb
  3. Toggle the TUI mode a couple of times and gdb should pick up on the "new" height.

Upvotes: 4

Related Questions