5
votes

I am using gdb 7.7.1 on ubuntu, GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1.

My terminal is Konsole 2.13.2.

The problem I am having is, when I go to the TUI mode, after one or two debugger sessions - session, I mean, set breakpoint, run, step over a while and finally kill it by "kill" command - the output starts messed up. Supposedly each output should go to a new line, but now they just all scramble, one immediately after another one.

I attach a screenshot.

I have to quit GDB, open a new terminal tab and start gdb again.

I tried "ctrl-x-a" back and forth, does not help; neither does "ctrl-l".

A while back, I was using another terminal, it also had this problem.

Any help is appreciated.

enter image description here

1
Workaround: (1) run konsole --hold -e "tty" to create a new window. Note the tty name it prints out. (2) in your original window, type gdb -tui -ex "tty /dev/pts/nameofthetty" yourprogram. That will redirect your program's io to the other window instead of overwriting your tui windows. - Mark Plotnick

1 Answers

1
votes

It appears that your tty settings changed, in much the same way that tty -onlcr might change them (tty onlcr restores the default). Perhaps the code you're debugging changes tty settings, and doesn't get a chance to restore them because of a crash.

As suggested in a comment, using a separate window might provide a workaround.