From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb@sourceware.org
Subject: Re: About handle_inferior_event new_thread_event
Date: Mon, 29 Jun 2009 17:56:00 -0000 [thread overview]
Message-ID: <20090629175628.GA2823@caradoc.them.org> (raw)
In-Reply-To: <200906291229.12382.pedro@codesourcery.com>
On Mon, Jun 29, 2009 at 12:29:12PM +0100, Pedro Alves wrote:
> seems to me that this is intended to have targets report new
> threads to the core by reporting e.g., TARGET_WAITKIND_STOP
> with any fake signal. If the stop was due to a new thread event
> in the target side (as oposed to a signal that should really cause
> a stop), then the resume really lets the thread go free on the target
> side. If otherwise, the stop was due to a real signal (a SIGTRAP, a
> SIGSEGV, etc.), then the resume causes the target to report the signal
> again (that's what happens on linux, for example), and so, handle_inferior
> event is again called to handle the same signal, only the second
> time, the thread is already listed, so the event goes on to be
> handled as usual.
>
> I've always been curious as to which target relies on this, since
> the remote target always adds threads to the thread list
> before reporting events to the core (possibly due to the fact that
> there are targets where resuming with TARGET_SIGNAL_0 when stopped
> at a signal doesn't retrigger the pending signal). Maybe this was
> something that was intended to be documented? Anyone knows the
> history behind this?
I don't know - but I do know that this code has never worked reliably
for Linux; we used to get crashes or internal errors from unset
LWP-private state any time we went through here. I'd rather all
targets were required to do thread accounting on their own.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2009-06-29 17:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 11:28 Pedro Alves
2009-06-29 17:56 ` Daniel Jacobowitz [this message]
2009-06-29 18:45 ` Pedro Alves
2009-06-29 18:06 ` Michael Snyder
2009-06-29 18:13 ` Pedro Alves
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=20090629175628.GA2823@caradoc.them.org \
--to=drow@false.org \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
/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