From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18932 invoked by alias); 29 Jun 2009 17:56:41 -0000 Received: (qmail 18908 invoked by uid 22791); 29 Jun 2009 17:56:39 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Jun 2009 17:56:32 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 71244108CB; Mon, 29 Jun 2009 17:56:30 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 56A62108B0; Mon, 29 Jun 2009 17:56:30 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MLL5g-0000kb-MN; Mon, 29 Jun 2009 13:56:28 -0400 Date: Mon, 29 Jun 2009 17:56:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb@sourceware.org Subject: Re: About handle_inferior_event new_thread_event Message-ID: <20090629175628.GA2823@caradoc.them.org> Mail-Followup-To: Pedro Alves , gdb@sourceware.org References: <200906291229.12382.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906291229.12382.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00305.txt.bz2 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