[AuckLUG] gdb with input/output in a separate window
Michal Ludvig
michal at logix.cz
Sat Jul 28 20:18:30 NZST 2007
John O'Gorman wrote:
> This is one for old-timers?
Doh!
> 2. Fire up gdb on dev/pts/0 with the arg -tty /dev/pts/1
> e.g.
> $ gdb -tty /dev/pts/1 prog.4ae
> gdb> run
> gdb> ...
A different approach. Or two, actually:
1) Run your program on one terminal, get its PID and run "gdb --attach
that-pid prog.4ae". As the target is your program I assume you can make
it print its PID and wait for a keypress on start before doing anything
useful. That will give you time to --attach it.
2) Or run your program under gdbserver and attach and control it from
gdb over loopback (localhost) interface. That could help in case you
couldn't (or are not willing to) add that waiting for keypress.
The difference between #1 and #2 is that in #1 your program is already
running at the time you attach it, while in #2 you are able to control
it from the very beginning.
In both cases you get the TTY separation of gdb and your program
natively as each of them is invoked on a different terminal.
HTH,
Michal
More information about the AuckLUG
mailing list