Mail Archives: djgpp/1995/02/06/14:51:29
I am having a problem with gdb that I need help with. I have a gdb command
which I want to execute anytime a particular function is called (this funtion
is called when the GNAT compiler reaches an unhandled exception, at which point
I print out a backtrace which I process into a nice form in a later program).
The problem is this. I want the output from the program to go to the
terminal, but I want to gdb output (ie, the backtrace) to go to a file. I do
this on unix by redirecting the output from the gdb command to a file, but
sending the output of the "run" command inside of gdb to the terminal, ie:
unix_prompt > gdb > myfile
gdb > run > /dev/tty
This works great on unix. But when I run with go32, the run command appears
to be completely ignored. I can't redirect the output anywhere. Even if I
could, I don't know the name of the tty.
I then tried to send all output to a filter program which would strip out any
gdb stuff and send the user's output to the screen, ie:
go32 -d gdb myprog | myfilter.exe
However, gdb does not appear to write any output to the filter until after it
has finished running. Then, any gdb output appears before any program output,
even though the program output was written first.
Can anyone help me split the gdb output from the program output, so that I can
send the program output to the tty?
Thanks in advance.
Chuck Kann
ckann AT seas DOT gwu DOT edu
- Raw text -