[AuckLUG] gdb with input/output in a separate window

John O'Gorman john at og.co.nz
Sat Jul 28 16:21:05 NZST 2007


This is one for old-timers?

I'm trying to debug an app which I am porting to Aubit4GL+PostgreSQL

What I want to do is run the app under the gdb program with its output
going to and from a separate terminal.

What I have tried so far:

1. Started 2 terminal sessions and invoked the tty command within each.
They show up as say /dev/pts/0 and /dev/pts/1

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> ...

This initially appears to work OK. The expected output from prog.4ae
appears in /dev/pts/1 and the gdb dialogue continues on the /dev/pts/0

But after a while confusion occurs. Stuff typed in the 2nd window gets
taken by the running shell (bash). Also gdb seems to lose interest in
its I/O and needs a CTRL-C to prod it back into talking.

Any ideas? I think I need a way to suspend the running shell on the 2nd
window so that only the app running under gdb is doing I/O there.

regards
John O'Gorman




More information about the AuckLUG mailing list