* dcrt0.cc (jit_debug): New global.

(initial_env): Set jit_debug when we are automatically starting a gdb process.
* dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are being
debugged by our own captive gdb, as determined by jit_debug == true.
(dtable::init_std_file_from_handle): Detect errors when initializing a tty
early rather than at random points later.
* fhandler.h (fhandler_*::init): Return int to indicate success/failure.
* fhandler.cc (fhandler_base::init): Reflect change in return value.
* pipe.cc (fhandler_pipe::init): Ditto.
(fhandler_pipe::create_selectable): Don't say we're retrying when we aren't.
* fhandler_console.cc (fhandler_console::init): Ditto.  Return success/failure.
* fhandler_serial.cc (fhandler_serial::init): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
(fhandler_tty_slave::open): Make debugging output more detailed.
* tty.cc (tty_list::terminate): Don't close I/O handles before all slaves have
checked in.
(tty::slave_alive): Make a non-inlined function.  Check if tty pipe handles can
be created as an additional exists check.
* tty.h (tty::slave_alive): Just define here.
This commit is contained in:
Christopher Faylor
2009-07-03 18:05:51 +00:00
parent 3e62013829
commit 3c4f2024a1
11 changed files with 85 additions and 38 deletions

View File

@@ -559,7 +559,8 @@ fhandler_tty_slave::open (int flags, mode_t)
hMainProc, &from_master_local, 0, TRUE,
DUPLICATE_SAME_ACCESS))
{
termios_printf ("can't duplicate input, %E");
termios_printf ("can't duplicate input from %u/%p, %E",
get_ttyp ()->master_pid, get_ttyp ()->from_master);
__seterrno ();
return 0;
}
@@ -654,7 +655,7 @@ fhandler_tty_slave::cygserver_attach_tty (LPHANDLE from_master_ptr,
return 1;
}
void
int
fhandler_tty_slave::init (HANDLE, DWORD a, mode_t)
{
int flags = 0;
@@ -667,7 +668,7 @@ fhandler_tty_slave::init (HANDLE, DWORD a, mode_t)
if (a == (GENERIC_READ | GENERIC_WRITE))
flags = O_RDWR;
open (flags);
return open (flags);
}
int