From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6464 invoked by alias); 17 Nov 2005 15:52:53 -0000 Received: (qmail 6266 invoked by uid 22791); 17 Nov 2005 15:52:46 -0000 Received: from lon-del-04.spheriq.net (HELO lon-del-04.spheriq.net) (195.46.50.101) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 17 Nov 2005 15:52:46 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-04.spheriq.net with ESMTP id jAHFqe6m029773 for ; Thu, 17 Nov 2005 15:52:41 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-03.spheriq.net with ESMTP id jAHFqVUM029498 for ; Thu, 17 Nov 2005 15:52:35 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-02.spheriq.net with ESMTP id jAHFqSTJ022532 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 17 Nov 2005 15:52:30 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 A6AF6DA44; Thu, 17 Nov 2005 15:51:38 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id CD6E347439; Thu, 17 Nov 2005 15:54:37 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9090575994; Thu, 17 Nov 2005 15:54:37 +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 0C6A74741A; Thu, 17 Nov 2005 15:54:35 +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 CGZ46501 (AUTH "andrew stubbs"); Thu, 17 Nov 2005 15:51:34 GMT Message-ID: <437CA66B.9060201@st.com> Date: Thu, 17 Nov 2005 16:34:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) 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> In-Reply-To: <20051117034811.GB3057@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------010805040809040907080805" 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.1.07 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: 2005-11/txt/msg00285.txt.bz2 This is a multi-part message in MIME format. --------------010805040809040907080805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 712 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 --------------010805040809040907080805 Content-Type: text/plain; name="thread-break-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="thread-break-2.patch" Content-length: 911 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 --------------010805040809040907080805--