From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] The gcore command hangs without a terminal
Date: Tue, 27 Mar 2007 16:40:00 -0000 [thread overview]
Message-ID: <20070327163915.GA4742@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20070327162041.GA3452@caradoc.them.org>
Hi Daniel,
the patch was more an optimization, it is not a GDB bug, as I see it now.
On Tue, 27 Mar 2007 18:20:41 +0200, Daniel Jacobowitz wrote:
> On Sun, Feb 25, 2007 at 01:26:42PM +0100, Jan Kratochvil wrote:
> > Hi,
> >
> > The function `attach_command' sets up the terminal by calling
> > target_terminal_inferior (). This makes gcore(1) to lock up when being run
> > without its controlling terminal.
> >
> > I do not find a reason for this terminal setup as GDB does not share its
> > input/output with the application in the mode of external attached program.
>
> 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.
> 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.
Thanks,
Jan
next prev parent reply other threads:[~2007-03-27 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-25 12:26 Jan Kratochvil
2007-03-27 16:21 ` Daniel Jacobowitz
2007-03-27 16:40 ` Jan Kratochvil [this message]
2007-03-27 16:44 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070327163915.GA4742@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox