From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26585 invoked by alias); 15 Nov 2005 17:27:35 -0000 Received: (qmail 26568 invoked by uid 22791); 15 Nov 2005 17:27:32 -0000 Received: from lon-del-01.spheriq.net (HELO lon-del-01.spheriq.net) (195.46.50.97) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 15 Nov 2005 17:27:32 +0000 Received: from lon-out-02.spheriq.net ([195.46.50.130]) by lon-del-01.spheriq.net with ESMTP id jAFHRRMO029036 for ; Tue, 15 Nov 2005 17:27:27 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-02.spheriq.net with ESMTP id jAFHRP5U030550 for ; Tue, 15 Nov 2005 17:27:27 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 jAFHROpX007881 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 15 Nov 2005 17:27:25 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 00239DA44; Tue, 15 Nov 2005 17:27:19 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 49C1447536; Tue, 15 Nov 2005 17:30:18 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 02A6875969; Tue, 15 Nov 2005 17:30:17 +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 1991647528; Tue, 15 Nov 2005 17:30:16 +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 CGZ30219 (AUTH "andrew stubbs"); Tue, 15 Nov 2005 17:27:17 GMT Message-ID: <437A19DE.6040905@st.com> Date: Tue, 15 Nov 2005 18:55: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> In-Reply-To: <20051114155659.GA25717@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------010203060308040103060500" 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/msg00207.txt.bz2 This is a multi-part message in MIME format. --------------010203060308040103060500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 363 Daniel Jacobowitz wrote: > I'm thinking about a check in insert_breakpoints, just before calling > insert_bp_location. By the !breakpoint_enabled. This may have other > side effects, so it would need testing. This seems to work. I have run the regression testsuite on both i686-pc-linux-gnu native and sh-elf cross. There were no extra failures. OK? Andrew --------------010203060308040103060500 Content-Type: text/plain; name="thread-break-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="thread-break-2.patch" Content-length: 1036 2005-11-15 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-14 18:58:50.000000000 +0000 +++ src/gdb/breakpoint.c 2005-11-15 14:01:40.000000000 +0000 @@ -1142,6 +1142,15 @@ 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))) + { + printf_unfiltered ("Not placing breakpoint %d due to death of thread %d\n", b->owner->number, 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 --------------010203060308040103060500--