1
votes

I'm running GNU Screen and gdb with TUI, and I'm having some issues relating to scrollback, so I want to send the output to a different screen window. What's the best way to do this?

Ideally i'd want the tui input and output (i.e. anything I do like 'print ' from gdb) to be on one window, and the output from printf's, etc to be on a different screen window.

Does anyone know how to do this?

(I'm actually doing remote debugging over gdb + serial, so it's connecting via target remote /dev/ttyS0 in my ~/.gbdinit).

1
Maybe redirect program's output (run ... > output_file) and do tail -F output_file on the other screen to read it?bikjub

1 Answers

0
votes

There are maybe a few ways to do this. I think the simplest is the "tty" command though. See "help tty".

Another approach is that taken by "screenify" -- use gdb's inferior call functionality to change the controlling tty (and various std* file descriptors) of the program.

Another approach is to just run your program in another tty and then use "attach".