From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10967 invoked by alias); 1 Aug 2011 18:50:16 -0000 Received: (qmail 10953 invoked by uid 22791); 1 Aug 2011 18:50:14 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 18:49:56 +0000 Received: from mailhub3.br.ibm.com (mailhub3.br.ibm.com [9.18.232.110]) by e24smtp02.br.ibm.com (8.14.4/8.13.1) with ESMTP id p71K2lkp029860 for ; Mon, 1 Aug 2011 17:02:47 -0300 Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p71IpRxo1081560 for ; Mon, 1 Aug 2011 15:51:48 -0300 Received: from d24av05.br.ibm.com (loopback [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p71Imstr020064 for ; Mon, 1 Aug 2011 15:48:55 -0300 Received: from [9.12.226.56] ([9.12.226.56]) by d24av05.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p71ImqUq019981; Mon, 1 Aug 2011 15:48:53 -0300 Subject: Re: [obvious] Remove unused argument in insert_bp_location From: Thiago Jung Bauermann To: Tom Tromey Cc: gdb-patches ml In-Reply-To: <1312223647.2658.1.camel@hactar> References: <1312144543.13977.3.camel@hactar> <1312223647.2658.1.camel@hactar> Content-Type: text/plain; charset="UTF-8" Date: Mon, 01 Aug 2011 18:50:00 -0000 Message-ID: <1312224529.2658.3.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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-08/txt/msg00018.txt.bz2 On Mon, 2011-08-01 at 15:34 -0300, Thiago Jung Bauermann wrote: > On Mon, 2011-08-01 at 08:41 -0600, Tom Tromey wrote: > > I don't think this patch is really equivalent to the previous code. > > > > To me it seems that *disabled_breaks was being used as a persistent flag. > > That is, the caller doesn't check its value, but subsequent calls to > > insert_bp_location do -- the value is not reset in the ALL_BP_LOCATIONS > > loop in insert_breakpoint_locations. > > Oh, you're right. It prevents those warnings from being shown for every > bp_location in a shared library. I'll revert the patch and extend the > documentation of insert_bp_location. > > That's one of the problems of hacking on a Sunday. Thanks for checking. Just reverted it. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2011-08-01 Thiago Jung Bauermann Revert: 2011-07-31 Thiago Jung Bauermann * breakpoint.c (insert_bp_location): Remove disabled_breaks argument. Update callers. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.605 diff -u -r1.605 breakpoint.c --- breakpoint.c 31 Jul 2011 20:31:16 -0000 1.605 +++ breakpoint.c 1 Aug 2011 18:41:34 -0000 @@ -1573,7 +1573,7 @@ /* Insert a low-level "breakpoint" of some type. BL is the breakpoint location. Any error messages are printed to TMP_ERROR_STREAM; and - HW_BREAKPOINT_ERROR is used to report problems. + DISABLED_BREAKS, and HW_BREAKPOINT_ERROR are used to report problems. Returns 0 for success, 1 if the bp_location type is not supported or -1 for failure. @@ -1582,6 +1582,7 @@ static int insert_bp_location (struct bp_location *bl, struct ui_file *tmp_error_stream, + int *disabled_breaks, int *hw_breakpoint_error) { int val = 0; @@ -1715,12 +1716,16 @@ val = 0; bl->shlib_disabled = 1; observer_notify_breakpoint_modified (bl->owner); - fprintf_unfiltered (tmp_error_stream, - "Cannot insert breakpoint %d.\n", - bl->owner->number); - fprintf_unfiltered (tmp_error_stream, - "Temporarily disabling shared " - "library breakpoints:\n"); + if (!*disabled_breaks) + { + fprintf_unfiltered (tmp_error_stream, + "Cannot insert breakpoint %d.\n", + bl->owner->number); + fprintf_unfiltered (tmp_error_stream, + "Temporarily disabling shared " + "library breakpoints:\n"); + } + *disabled_breaks = 1; fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", bl->owner->number); } @@ -1908,6 +1913,7 @@ struct bp_location *bl, **blp_tmp; int error = 0; int val = 0; + int disabled_breaks = 0; int hw_breakpoint_error = 0; struct ui_file *tmp_error_stream = mem_fileopen (); @@ -1941,8 +1947,8 @@ && ptid_equal (inferior_ptid, null_ptid)) continue; - val = insert_bp_location (bl, tmp_error_stream, - &hw_breakpoint_error); + val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, + &hw_breakpoint_error); if (val) error = val; } @@ -2049,7 +2055,7 @@ struct bp_location *bl, **blp_tmp; int val; struct ui_file *tmp_error_stream; - int dummy = 0; + int dummy1 = 0, dummy2 = 0; struct inferior *inf; struct thread_info *tp; @@ -2073,7 +2079,7 @@ if (bl->inserted) { bl->inserted = 0; - val = insert_bp_location (bl, tmp_error_stream, &dummy); + val = insert_bp_location (bl, tmp_error_stream, &dummy1, &dummy2); if (val != 0) { do_cleanups (old_chain);