From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13821 invoked by alias); 9 Aug 2008 01:32:16 -0000 Received: (qmail 13813 invoked by uid 22791); 9 Aug 2008 01:32:15 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 01:31:34 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0FC71983EF; Sat, 9 Aug 2008 01:31:32 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E22E59809F; Sat, 9 Aug 2008 01:31:31 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KRdIo-0007Nw-Rc; Fri, 08 Aug 2008 21:31:30 -0400 Date: Sat, 09 Aug 2008 01:32:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: [3/7] Adjust the bsd-uthread target Message-ID: <20080809013130.GA28372@caradoc.them.org> Mail-Followup-To: Pedro Alves , Mark Kettenis , gdb-patches@sourceware.org References: <200808080236.04076.pedro@codesourcery.com> <200808082151.m78LpP2T028239@brahms.sibelius.xs4all.nl> <200808082341.23994.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808082341.23994.pedro@codesourcery.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00228.txt.bz2 On Fri, Aug 08, 2008 at 11:41:23PM +0100, Pedro Alves wrote: > The "exited" state is what you get *after* you delete_thread the current > thread (inferior_ptid). We don't delete the thread from the thread list > in that case, but instead tag it as "exited". It means the thread list > is still holding reference to a thread that has already exited. > If you're seeing an event with a ptid equal to an "exited" thread, > this is the OS reusing the ptid, but, it's a new thread, which > should get a new gdb thread id, so things like thread > specific breakpoints don't think this was the same thread, both the > CLI user or MI see a "new thread event", etc. add_thread handles > that case internally. This means it is now safe to delete_thread > (inferior_ptid), regarding context-switching, and infrun state. It > wasn't a couple of weeks ago. How many of the call sites for in_thread_list want to see exited threads? Maybe there should be another predicate (I'd suggest thread_alive except target_thread_alive would confuse things...) -- Daniel Jacobowitz CodeSourcery