From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27380 invoked by alias); 29 Apr 2011 17:26:49 -0000 Received: (qmail 27354 invoked by uid 22791); 29 Apr 2011 17:26:48 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate6.uk.ibm.com (HELO mtagate6.uk.ibm.com) (194.196.100.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Apr 2011 17:26:34 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p3THQWao003551 for ; Fri, 29 Apr 2011 17:26:32 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3THRd3G1982552 for ; Fri, 29 Apr 2011 18:27:39 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3THQWQG029617 for ; Fri, 29 Apr 2011 11:26:32 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p3THQVaC029608; Fri, 29 Apr 2011 11:26:31 -0600 Message-Id: <201104291726.p3THQVaC029608@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 29 Apr 2011 19:26:31 +0200 Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint To: bauerman@br.ibm.com (Thiago Jung Bauermann) Date: Fri, 29 Apr 2011 17:26:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml) In-Reply-To: <1303161745.1969.220.camel@hactar> from "Thiago Jung Bauermann" at Apr 18, 2011 06:22:25 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00562.txt.bz2 Thiago Jung Bauermann wrote: > I was trying to adapt the logic in both places for masked watchpoints, > but it's hard to anticipate in watch_command_1 what update_watchpoint > will ultimately do without duplicating a good portion of the latter. The > code in watch_command_1 was getting complicated and hard to get right in > all situations for something which would be done again later anyway. Agreed, that's a good idea. > I decided that it was cleaner if watch_command_1 just delegated > everything to update_watchpoint. This patch makes it create a > watchpoint, call update_watchpoint and then delete it if some error is > hit. The only drawback I can think of is that the aborted watchpoint > will "consume" one breakpoint number, and thus GDB will skip one number > when creating the next breakpoint/watchpoint. This doesn't seem > important to me. Hmm, I don't really like that change. However, it should be easy to fix by just moving the set_breakpoint_number call to down below where update_watchpoint has succeeded, shouldn't it? > (delete_breakpoint): Add announce argument to control whether > observers are notified of the deletion. Update all callers. Ugh. Adding an extra argument that everybody must be aware of just to take care of this special case isn't really nice ... I'd prefer if you'd either split off the parts of delete_breakpoint that are needed to undo partial creation into a separate function, or else, if you use the set_breakpoint_number trick, identify partial breakpoints by the fact that their b->number is still zero. > @@ -1432,8 +1436,22 @@ update_watchpoint (struct breakpoint *b, int reparse) > target_resources_ok = target_can_use_hardware_watchpoint > (bp_hardware_watchpoint, i, other_type_used); This should now use b->type instead of hardcoding bp_hardware_watchpoint, shouldn't it? Otherwise looks good to me. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com