From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22940 invoked by alias); 12 Jan 2006 16:25:25 -0000 Received: (qmail 22905 invoked by uid 22791); 12 Jan 2006 16:25:24 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 12 Jan 2006 16:25:21 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-04.spheriq.net with ESMTP id k0CGP60k013772 for ; Thu, 12 Jan 2006 16:25:15 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-02.spheriq.net with ESMTP id k0CGP5lX031102 for ; Thu, 12 Jan 2006 16:25:05 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k0CGP2RK026389 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 12 Jan 2006 16:25:04 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 363D8DA44; Thu, 12 Jan 2006 16:24:56 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id B4BC34754F; Thu, 12 Jan 2006 16:28:21 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 59C887599D; Thu, 12 Jan 2006 16:28:21 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6E3F34754E; Thu, 12 Jan 2006 16:28:20 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CHD08595 (AUTH stubbsa); Thu, 12 Jan 2006 16:24:53 GMT Message-ID: <43C6825C.9020909@st.com> Date: Thu, 12 Jan 2006 16:25:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Disable thread specific breakpoints when thread dies References: <43723446.7000903@st.com> <20051113184515.GG3599@nevyn.them.org> <437875B0.4000007@st.com> <20051114155659.GA25717@nevyn.them.org> <437A19DE.6040905@st.com> <437B47A1.4040705@st.com> <20051117034811.GB3057@nevyn.them.org> <437CA66B.9060201@st.com> In-Reply-To: <437CA66B.9060201@st.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.2.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00126.txt.bz2 Ping. Since valid_thread_id did not work am I OK to commit this one. It has been on hold since mid Novemeber. Thanks Andrew Andrew Stubbs wrote: > Daniel Jacobowitz wrote: > >> On Wed, Nov 16, 2005 at 02:52:17PM +0000, Andrew STUBBS wrote: >> >>> + /* There is no point inserting thread-specific breakpoints if the >>> + thread no longer exists. */ >>> + if (b->owner->thread != -1 >>> + && !target_thread_alive(thread_id_to_pid(b->owner->thread))) >>> + continue; >> >> >> >> You shouldn't need to use the target method here. Does valid_thread_id >> work? >> >> Also, please remember the space before opening parentheses. > > > The thread still seems to have a valid ID after it has died. You can > even do 'b 8 t 4' after the program has exited. It does give an error > for threads which never existed though. > > Here is the patch again with the spaces fixed. > > Andrew > > > > ------------------------------------------------------------------------ > > 2005-11-17 Andrew Stubbs > > * breakpoint.c (insert_breakpoints): Check that a thread exists > before inserting thread specific breakpoints. > > Index: src/gdb/breakpoint.c > =================================================================== > --- src.orig/gdb/breakpoint.c 2005-11-17 15:47:04.000000000 +0000 > +++ src/gdb/breakpoint.c 2005-11-17 15:47:42.000000000 +0000 > @@ -1142,6 +1142,12 @@ insert_breakpoints (void) > if (!breakpoint_enabled (b->owner)) > continue; > > + /* There is no point inserting thread-specific breakpoints if the > + thread no longer exists. */ > + if (b->owner->thread != -1 > + && !target_thread_alive (thread_id_to_pid (b->owner->thread))) > + continue; > + > /* FIXME drow/2003-10-07: This code should be pushed elsewhere when > hardware watchpoints are split into multiple loc breakpoints. */ > if ((b->loc_type == bp_loc_hardware_watchpoint