From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18927 invoked by alias); 4 Mar 2011 19:58:52 -0000 Received: (qmail 18919 invoked by uid 22791); 4 Mar 2011 19:58:51 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Mar 2011 19:58:45 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 94C4513019; Fri, 4 Mar 2011 11:58:42 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 83F63CD972; Fri, 4 Mar 2011 11:58:42 -0800 (PST) Message-ID: <4D714472.6050404@vmware.com> Date: Fri, 04 Mar 2011 19:58:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] breakpoint.c, enable_command, missing break statement. References: <4D713431.3060907@vmware.com> <201103041928.03380.pedro@codesourcery.com> In-Reply-To: <201103041928.03380.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------000803070400030201020008" 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-03/txt/msg00321.txt.bz2 This is a multi-part message in MIME format. --------------000803070400030201020008 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 783 Pedro Alves wrote: > On Friday 04 March 2011 18:49:21, Michael Snyder wrote: >> I'm not entirely sure what to do with this one. >> >> It clearly falls through, and it works as is, so the least change >> is just to comment it. > > It looks irrelevant. It's always relevant to document a fall-through. > The intent of the code is obviously > to iterate over all breakpoints, or all kinds. > The "continue" is continuing the loop hidden in > ALL_BREAKPOINTS at the next iteration. But if you replace > all the continue's with break's it will still work the same, > because the "break" would break the the "switch", not the > loop. I think if you do that the code ends up simpler to > read, with no magic. > Agreed. Extending the same fix to disable_command, and committing. --------------000803070400030201020008 Content-Type: text/plain; name="break9.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="break9.txt" Content-length: 1550 2011-03-04 Michael Snyder * breakpoint.c (enable_command): Use break instead of continue, and fill in a missing break. (disable_command): Ditto. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.546 diff -u -p -u -p -r1.546 breakpoint.c --- breakpoint.c 1 Mar 2011 02:16:56 -0000 1.546 +++ breakpoint.c 4 Mar 2011 19:56:21 -0000 @@ -10929,7 +10929,7 @@ disable_command (char *args, int from_tt case bp_none: warning (_("attempted to disable apparently deleted breakpoint #%d?"), bpt->number); - continue; + break; case bp_breakpoint: case bp_tracepoint: case bp_fast_tracepoint: @@ -10941,8 +10941,9 @@ disable_command (char *args, int from_tt case bp_read_watchpoint: case bp_access_watchpoint: disable_breakpoint (bpt); + break; default: - continue; + break; } else if (strchr (args, '.')) { @@ -11030,7 +11031,7 @@ enable_command (char *args, int from_tty case bp_none: warning (_("attempted to enable apparently deleted breakpoint #%d?"), bpt->number); - continue; + break; case bp_breakpoint: case bp_tracepoint: case bp_fast_tracepoint: @@ -11042,8 +11043,9 @@ enable_command (char *args, int from_tty case bp_read_watchpoint: case bp_access_watchpoint: enable_breakpoint (bpt); + break; default: - continue; + break; } else if (strchr (args, '.')) { --------------000803070400030201020008--