RFA: patch to top.c to prevent gdb from being thrown into the background

J. Johnston jjohnstn@redhat.com
Tue Oct 21 21:27:00 GMT 2003


The attached patch fixes a current problem with gdb regarding attaching to a 
background process in the same terminal window the background process was 
started in.

In the particular example, the attach started issuing messages regarding the 
symbols loaded from shared libraries.  Because the number of shared libraries 
was quite large in this case, a page break occurred which caused readline() to 
be called.  The first readline() made a call to tcsetattr() which pushed gdb 
into the background under Linux.

There is a separate problem regarding whether the output of the shared library 
loads should be unfiltered in which case the problem would not have occurred, 
but I am creating a separate thread for that issue.

The fix is simply to call terminal_ours() before calling readline() in 
gdb_readline_wrapper().  I have tested on i686 linux.

Ok to commit?

2003-10-21  Jeff Johnston  <jjohnstn@redhat.com>

	* top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling
	readline.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: top.c.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031021/4bb279cb/attachment.ksh>


More information about the Gdb-patches mailing list