From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28210 invoked by alias); 1 Apr 2011 15:45:04 -0000 Received: (qmail 28081 invoked by uid 22791); 1 Apr 2011 15:45:01 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e7.ny.us.ibm.com (HELO e7.ny.us.ibm.com) (32.97.182.137) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Apr 2011 15:44:56 +0000 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p31FNOpX000805 for ; Fri, 1 Apr 2011 11:23:24 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 236D238C8039 for ; Fri, 1 Apr 2011 11:44:48 -0400 (EDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p31FiseV410332 for ; Fri, 1 Apr 2011 11:44:55 -0400 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p31Fisc8001053 for ; Fri, 1 Apr 2011 09:44:54 -0600 Received: from [9.12.227.3] ([9.12.227.3]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p31FiqhS000952 for ; Fri, 1 Apr 2011 09:44:52 -0600 Subject: Re: [RFC] Cleanup breakpoint_re_set_one From: Thiago Jung Bauermann To: gdb-patches ml In-Reply-To: <1300742094.2557.10.camel@hactar> References: <1300742094.2557.10.camel@hactar> Content-Type: text/plain; charset="UTF-8" Date: Fri, 01 Apr 2011 15:45:00 -0000 Message-ID: <1301672688.2511.3.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER 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: 2011-04/txt/msg00009.txt.bz2 Hi, On Mon, 2011-03-21 at 18:14 -0300, Thiago Jung Bauermann wrote: > Tested with no regressions on ppc-linux and ppc64-linux. WDYT? This is a refreshed version of the patch, which applies on today's CVS HEAD. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2011-04-01 Thiago Jung Bauermann * breakpoint.c (addr_string_to_sals): Cleanup logic of the conditon expressions in the error handling code. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3b1367b..6d7c234 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10979,33 +10979,26 @@ addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found) sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, NULL, ¬_found); } - if (e.reason < 0) - { - int not_found_and_ok = 0; - /* For pending breakpoints, it's expected that parsing will - fail until the right shared library is loaded. User has - already told to create pending breakpoints and don't need - extra messages. If breakpoint is in bp_shlib_disabled - state, then user already saw the message about that - breakpoint being disabled, and don't want to see more - errors. */ - if (not_found - && (b->condition_not_parsed - || (b->loc && b->loc->shlib_disabled) - || b->enable_state == bp_disabled)) - not_found_and_ok = 1; - - if (!not_found_and_ok) - { - /* We surely don't want to warn about the same breakpoint - 10 times. One solution, implemented here, is disable - the breakpoint on error. Another solution would be to - have separate 'warning emitted' flag. Since this - happens only when a binary has changed, I don't know - which approach is better. */ - b->enable_state = bp_disabled; - throw_exception (e); - } + + /* For pending breakpoints, it's expected that parsing will + fail until the right shared library is loaded. User has + already told to create pending breakpoints and don't need + extra messages. If breakpoint is in bp_shlib_disabled + state, then user already saw the message about that + breakpoint being disabled, and don't want to see more + errors. */ + if (e.reason < 0 && (!not_found || (!b->condition_not_parsed + && !(b->loc && b->loc->shlib_disabled) + && b->enable_state != bp_disabled))) + { + /* We surely don't want to warn about the same breakpoint + 10 times. One solution, implemented here, is disable + the breakpoint on error. Another solution would be to + have separate 'warning emitted' flag. Since this + happens only when a binary has changed, I don't know + which approach is better. */ + b->enable_state = bp_disabled; + throw_exception (e); } if (!not_found)