www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/06/14:51:29

From: "Charles W. Kann" <ckann AT seas DOT gwu DOT edu>
Subject: Need help with gdb!
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Mon, 6 Feb 1995 11:17:23 -0500 (EST)
Cc: mfeldman AT seas DOT gwu DOT edu (Michael Feldman), banner AT cs DOT nyu DOT edu,
drupp AT cs DOT washington DOT edu

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019