This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] The gcore command hangs without a terminal


On Tue, Mar 27, 2007 at 06:39:16PM +0200, Jan Kratochvil wrote:
> > Unfortunately I think this is the wrong place to fix it.  You're
> > commenting out a call to target_terminal_inferior, but there are lots
> > of other calls to this function - including one any time we continue
> > the program.
> 
> If we `continue' the inferior it may access its terminal and so we must set it
> up for the inferior.  It is right there.  But the `gcore' command IMO does not
> need to access the inferior's terminal as it never lets the inferior to run.
> Accessing the inferior's terminal should be postponed to the time where the
> inferior could use it.

If we attach to a program, it should have its own controlling
terminal, not the same as GDB's.  So why should we do anything with
the terminal at all?  Perhaps all the terminal operations should be
suppressed if we're attached.

> > target_terminal_inferior is a call eventually to terminal_inferior.
> > This checks gdb_has_a_terminal ().  How are you calling GDB without a
> > controlling terminal that still lets gdb_has_a_terminal () return
> > true?  That's probably the right place to fix it.
> 
> You are right there is primarily a bug in the customer's application (which
> spawns the `gcore' command).  It should either provide no terminal or
> a terminal with appropriate access rights.

An alternative would be to detect whatever had gone wrong in GDB and
avoid fiddling with the terminal if this happens.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]