From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20284 invoked by alias); 31 Jul 2011 20:36:09 -0000 Received: (qmail 20130 invoked by uid 22791); 31 Jul 2011 20:36:08 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp05.br.ibm.com (HELO e24smtp05.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 31 Jul 2011 20:35:54 +0000 Received: from /spool/local by br.ibm.com with XMail ESMTP for from ; Sun, 31 Jul 2011 17:35:47 -0300 Received: from mailhub3.br.ibm.com ([9.18.232.110]) by br.ibm.com ([10.172.0.141]) with XMail ESMTP; Sun, 31 Jul 2011 17:35:45 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6VKcFdw3395774 for ; Sun, 31 Jul 2011 17:38:15 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6VCZivr018633 for ; Sun, 31 Jul 2011 09:35:44 -0300 Received: from [9.18.198.68] ([9.18.198.68]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p6VCZiB6018630 for ; Sun, 31 Jul 2011 09:35:44 -0300 Subject: [obvious] Remove unused argument in insert_bp_location From: Thiago Jung Bauermann To: gdb-patches ml Content-Type: text/plain; charset="UTF-8" Date: Sun, 31 Jul 2011 20:44:00 -0000 Message-ID: <1312144543.13977.3.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit x-cbid: 11073120-2362-0000-0000-0000045DC3D4 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-07/txt/msg00832.txt.bz2 Hi, I noticed that disabled_breakpoints is not used. It's both an input and output parameter. All callers set it to zero, and none of them checks its value on return. Committed the following (there were no regressions on i386-linux). -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2011-07-31 Thiago Jung Bauermann * breakpoint.c (insert_bp_location): Remove disabled_breaks argument. Update callers. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 00fe748..edfa661 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1573,14 +1573,13 @@ should_be_inserted (struct bp_location *bl) /* Insert a low-level "breakpoint" of some type. BL is the breakpoint location. Any error messages are printed to TMP_ERROR_STREAM; and - DISABLED_BREAKS, and HW_BREAKPOINT_ERROR are used to report problems. + HW_BREAKPOINT_ERROR is used to report problems. NOTE drow/2003-09-09: This routine could be broken down to an object-style method for each breakpoint or catchpoint type. */ 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; @@ -1714,16 +1713,12 @@ insert_bp_location (struct bp_location *bl, val = 0; bl->shlib_disabled = 1; observer_notify_breakpoint_modified (bl->owner); - 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, + "Cannot insert breakpoint %d.\n", + bl->owner->number); + fprintf_unfiltered (tmp_error_stream, + "Temporarily disabling shared " + "library breakpoints:\n"); fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", bl->owner->number); } @@ -1914,7 +1909,6 @@ insert_breakpoint_locations (void) 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 (); @@ -1948,8 +1942,8 @@ insert_breakpoint_locations (void) && ptid_equal (inferior_ptid, null_ptid)) continue; - val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, - &hw_breakpoint_error); + val = insert_bp_location (bl, tmp_error_stream, + &hw_breakpoint_error); if (val) error = val; } @@ -2052,7 +2046,7 @@ reattach_breakpoints (int pid) struct bp_location *bl, **blp_tmp; int val; struct ui_file *tmp_error_stream; - int dummy1 = 0, dummy2 = 0; + int dummy = 0; struct inferior *inf; struct thread_info *tp; @@ -2076,7 +2070,7 @@ reattach_breakpoints (int pid) if (bl->inserted) { bl->inserted = 0; - val = insert_bp_location (bl, tmp_error_stream, &dummy1, &dummy2); + val = insert_bp_location (bl, tmp_error_stream, &dummy); if (val != 0) { do_cleanups (old_chain);