[RFA] Fix GDB's handling of the inferior controlling terminal.

Thiago Jung Bauermann bauerman@br.ibm.com
Mon Mar 10 17:44:00 GMT 2008


Hi,

With the current CVS version, if the user specifies a different terminal
for the inferior to run on, GDB doesn't set it as the inferior's
controlling terminal.

This leads to some problems. For instance, the inferior will not
get SIGINT sent to the terminal. Also, if the inferior is GDB itself,
the following message is shown in the inferior GDB's debugging session:

[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]

The attached patch makes GDB set the inferior's controlling terminal,
fixing both of the symptoms above. If the user specifies a different
inferior terminal, GDB will now create a new session right after forking
to run the inferior, and use the TIOCSCTTY ioctl to set the controlling
terminal.

Ran testsuite, no regressions found. Is this ok?
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: controlling-tty-fix.diff
Type: text/x-patch
Size: 4445 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080310/1e2f48d9/attachment.bin>


More information about the Gdb-patches mailing list