From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3739 invoked by alias); 11 Oct 2006 13:44:40 -0000 Received: (qmail 3729 invoked by uid 22791); 11 Oct 2006 13:44:39 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-03.spheriq.net (HELO lon-del-03.spheriq.net) (195.46.50.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Oct 2006 13:44:32 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-03.spheriq.net with ESMTP id k9BDiTtE006336 for ; Wed, 11 Oct 2006 13:44:29 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-01.spheriq.net with ESMTP id k9BDiSDJ028677 for ; Wed, 11 Oct 2006 13:44:28 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 k9BDiNHZ002512 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Wed, 11 Oct 2006 13:44:26 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 BCFC9DA4E for ; Wed, 11 Oct 2006 13:44:22 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 586E7473AE for ; Wed, 11 Oct 2006 13:44:22 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CIC24156 (AUTH stubbsa); Wed, 11 Oct 2006 14:44:20 +0100 (BST) Message-ID: <452CF534.4060209@st.com> Date: Wed, 11 Oct 2006 13:44:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: GDB Patches Subject: [PATCH] Don't give spurious warnings when using thread specific breakpoints Content-Type: multipart/mixed; boundary="------------050107020809080408030403" 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-10/txt/msg00110.txt.bz2 This is a multi-part message in MIME format. --------------050107020809080408030403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 501 When creating a thread specific breakpoint GDB will warn about other breakpoints set on the same address even when they are specific to another thread. The attached patch prevents it warning about breakpoints from other threads. When a non-thread specific breakpoint is created, or already exists, the warning is still given, but is annotated with the thread information. When not using thread specific breakpoints the behaviour should remain unaltered. :ADDPATCH breakpoint.c: Andrew Stubbs --------------050107020809080408030403 Content-Type: text/plain; name="threadbreak.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="threadbreak.patch" Content-length: 2742 2006-10-11 Andrew Stubbs * breakpoint.c (describe_other_breakpoints): Add thread parameter. Only display breakpoints set on the same thread or globally. Annotate display with thread number where appropriate. Index: src/gdb/breakpoint.c =================================================================== --- src.orig/gdb/breakpoint.c 2006-10-11 14:23:37.000000000 +0100 +++ src/gdb/breakpoint.c 2006-10-11 14:29:25.000000000 +0100 @@ -102,7 +102,7 @@ static void breakpoint_adjustment_warnin static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr, enum bptype bptype); -static void describe_other_breakpoints (CORE_ADDR, asection *); +static void describe_other_breakpoints (CORE_ADDR, asection *, int thread); static void breakpoints_info (char *, int); @@ -3781,13 +3781,14 @@ maintenance_info_breakpoints (char *bnum /* Print a message describing any breakpoints set at PC. */ static void -describe_other_breakpoints (CORE_ADDR pc, asection *section) +describe_other_breakpoints (CORE_ADDR pc, asection *section, int thread) { int others = 0; struct breakpoint *b; ALL_BREAKPOINTS (b) - if (b->loc->address == pc) /* address match / overlay match */ + if (b->loc->address == pc /* address match / overlay match */ + && (thread == -1 || b->thread == -1 || b->thread == thread)) if (!b->pending && (!overlay_debugging || b->loc->section == section)) others++; if (others > 0) @@ -3797,12 +3798,17 @@ describe_other_breakpoints (CORE_ADDR pc else /* if (others == ???) */ printf_filtered (_("Note: breakpoints ")); ALL_BREAKPOINTS (b) - if (b->loc->address == pc) /* address match / overlay match */ + if (b->loc->address == pc /* address match / overlay match */ + && (thread == -1 || b->thread == -1 || b->thread == thread)) if (!b->pending && (!overlay_debugging || b->loc->section == section)) { others--; - printf_filtered ("%d%s%s ", - b->number, + printf_filtered ("%d", b->number); + if (b->thread == -1 && thread != -1) + printf_filtered (" (all threads)"); + else if (b->thread != -1) + printf_filtered (" (thread %d)", b->thread); + printf_filtered ("%s%s ", ((b->enable_state == bp_disabled || b->enable_state == bp_shlib_disabled || b->enable_state == bp_call_disabled) @@ -4959,7 +4965,7 @@ create_breakpoints (struct symtabs_and_l struct symtab_and_line sal = sals.sals[i]; if (from_tty) - describe_other_breakpoints (sal.pc, sal.section); + describe_other_breakpoints (sal.pc, sal.section, thread); b = set_raw_breakpoint (sal, type); set_breakpoint_count (breakpoint_count + 1); --------------050107020809080408030403--