"target remote | " stderr

Vladimir Prus ghost@cs.msu.su
Sun Feb 11 16:56:00 GMT 2007


Daniel Jacobowitz wrote:

> On Wed, Jan 31, 2007 at 05:34:21PM +0300, Vladimir Prus wrote:
>> Implementing for MinGW required modifying libiberty so that
>> it can catch stderr to a pipe. Here's a patch for gdb that
>> relies on the libiberty patch. Does this sound OK
>> provided libiberty patch is approved?
> 
> Do we automatically get a non-blocking pipe on mingw, or do we have to
> set it ourselves?  

We have to set it ourself, unfortunately. I had one test case working
fine, but got gdb hanging on some other.

The attached patch works around the blocking issues, and more extensively
tested. OK?

- Volodya

        Pass stderr of program run with "target remote |"
        via gdb_stderr.
        * serial.c (serial_open): Set error_fd to -1.
        * serial.h (struct serial): New field error_fd.
        * ser-pipe.c (pipe_open): Create another pair
        of sockets.  Pass stderr to gdb.
        * ser-mingw.c (pipe_windows_open): Pass
        PEX_STDERR_TO_PIPE to pex_run.  Initialize
        sd->error_fd.
        * ser-base.c (generic_readchar): Check if there's
        anything in stderr channel and route that to gdb_stderr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remote_stderr_try2__gdb_mainline.diff
Type: text/x-diff
Size: 5688 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070211/05f68245/attachment.bin>


More information about the Gdb-patches mailing list