At the moment, when handling target remote | whatever gdb does not do anything with 'whatever''s stderr. This is not good, because when using MI, frontend might not even look at stderr at all, so messages from 'whatever' get lost. This patch fixes that. The fix is only for Linux, I plan to do the same with mingw support, but only if this patch is considered 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-base.c (generic_readchar): Check if there's anything in stderr channel and route that to gdb_stderr.