From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32258 invoked by alias); 27 Jan 2012 00:23:50 -0000 Received: (qmail 32249 invoked by uid 22791); 27 Jan 2012 00:23:49 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from elasmtp-dupuy.atl.sa.earthlink.net (HELO elasmtp-dupuy.atl.sa.earthlink.net) (209.86.89.62) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Jan 2012 00:23:36 +0000 Received: from [70.170.59.51] (helo=macbook2.local) by elasmtp-dupuy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1RqZbL-00014L-M2 for gdb-patches@sourceware.org; Thu, 26 Jan 2012 19:23:35 -0500 Message-ID: <4F21EE80.104@earthlink.net> Date: Fri, 27 Jan 2012 00:43:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [PATCH] Make enable reset disposition Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: ae6f8838ff913eba0cc1426638a40ef67e972de0d01da940f9327ae7fba45b4b2e7a643466cb5861350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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: 2012-01/txt/msg00929.txt.bz2 In the process of developing an additional enablement option (to be posted soon), I ran across this little bit of behavior that seems wrong; if you do "enable once" and then "enable" on a breakpoint, the disposition is unchanged - the breakpoint is still going to get disabled after being hit. (Similarly for "enable delete" breakpoints.) While one could argue that this is good, because you can toggle a breakpoint's enablement independently of its ultimate disposition, the downside is that you're stuck with your original choice; once you've set a breakpoint's disposition to delete for instance, there is no way to undo that, and when the breakpoint is hit, it's gone, conditions and command list and all. Having "enable" reset dispositions has its own fault, namely that if you do just "enable" to enable all breakpoints, and they have different dispositions, then all the dispositions are reset en masse, and you would have to manually do a combination of "enable once", "enable delete", etc to get those back to desired values. A more complicated solution might be to introduce an additional flavor or option of enable command ("enable always"?), but I wouldn't like to try to explain the different flavors to users, and chances are that nobody would remember it anyway. I couldn't see anything in the manual that addressed the point either way. Stan 2012-01-26 Stan Shebs * breakpoint.c (enable_breakpoint): Set disposition instead of copying it. * gdb.base/ena-dis-br.exp: Add a check of disposition reset. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.648 diff -u -p -r1.648 breakpoint.c --- breakpoint.c 25 Jan 2012 15:57:04 -0000 1.648 +++ breakpoint.c 26 Jan 2012 23:42:32 -0000 @@ -12945,7 +12945,7 @@ enable_breakpoint_disp (struct breakpoin void enable_breakpoint (struct breakpoint *bpt) { - enable_breakpoint_disp (bpt, bpt->disposition); + enable_breakpoint_disp (bpt, disp_donttouch); } static void Index: testsuite/gdb.base/ena-dis-br.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ena-dis-br.exp,v retrieving revision 1.19 diff -u -p -r1.19 ena-dis-br.exp --- testsuite/gdb.base/ena-dis-br.exp 16 Jan 2012 16:21:44 -0000 1.19 +++ testsuite/gdb.base/ena-dis-br.exp 26 Jan 2012 23:42:32 -0000 @@ -78,6 +78,9 @@ proc break_at { breakpoint where } { set bp [break_at "marker1" " line ($bp_location15|$bp_location16)"] +# Do this first to check that regular enable resets the disposition. +gdb_test_no_output "enable once $bp" "enable once break marker1" + gdb_test_no_output "enable $bp" "enable break marker1" gdb_test "info break $bp" \