7

I am doing my first steps with GDB in TUI mode.

During the debug session I see that each line outputted to console occurs in a single line (in the picture you see 222222 highlighted in red). It is like having an output pane of one single line.

On top of that, each \n doesn't cleanup that line so all the strings do overwrite each other making my output very confusing.

Can you help me a bit with this issue or point me to some key command to look for in order to have a clean output?

I also highlighted another area (in the picture 1111111) because the first string is outputted there and then all other on the frame of the source code window.

alt text

1 Answer 1

12

You can always refresh tui screeen every time your program outputs something with Ctrl+L key binding. Or you can temporarily swith to normal mode, step and watch program output and switch back to tui mode (Ctrl+X A). See all key bindings here.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks a lot! With CTRL+L & out TUI mode looks better. Can I ask you one more question? Do you know a way to create an area in GDB screen similar to the VSStudio OUTPUT PANE? I would like an area of the screen dedicated entirely to the console output and at the same time doing my debug/viewing my code.
As far as I know there is no such feature in gdb as OUTPUT PANE. But it is possible to redirect all program output to another terminal with gdb's TTY command: sourceware.org/gdb/current/onlinedocs/gdb/…
Hi Ks1322! Thanks a lot! I did some research since I don't have this /dev/ttyb in Ubuntu. #A. I open a new terminal, give "tty" command to return e.g. "/dev/pts/0" #B. In another terminal where I lunch "gdb"and give "tty /dev/pts/0" to see my output in the first terminal: supre cool! Everything seems fine except for this message "warning: GDB: Failed to set controlling terminal: Operation not permitted". It seems not really affecting my debugging session by the way but I am not sure 100%. Do you know what it could be?
Maby this will help you: stackoverflow.com/questions/2346919/… ? Maby this warning is Ubuntu specific? I dont observe it on my Fedora 12 system.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.