From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17930 invoked by alias); 5 May 2011 08:15:21 -0000 Received: (qmail 17919 invoked by uid 22791); 5 May 2011 08:15:18 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 08:15:02 +0000 Received: (qmail 8318 invoked from network); 5 May 2011 08:15:00 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 May 2011 08:15:00 -0000 From: Pedro Alves To: Thiago Jung Bauermann Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint Date: Thu, 05 May 2011 08:15:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Eli Zaretskii , gdb-patches@sourceware.org, uweigand@de.ibm.com References: <201104291726.p3THQVaC029608@d06av02.portsmouth.uk.ibm.com> <83d3jz4110.fsf@gnu.org> <1304547648.19357.230.camel@hactar> In-Reply-To: <1304547648.19357.230.camel@hactar> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105050915.18716.pedro@codesourcery.com> 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-05/txt/msg00121.txt.bz2 On Wednesday 04 May 2011 23:20:48, Thiago Jung Bauermann wrote: > Pedro's suggestion: > > 1. The inferior is stopped and software bp_locations (both breakpoints > and watchpoints) are removed. Hardware ones stay in place. > 2. The user asks for a new watchpoint. > 3. GDB evaluates the expression and creates the bp_locations. > 4. GDB tries to insert the bp_locations as hw watches. If that fails, > then converts to sw and registers the watchpoint for insertion. > 5. The user asks the inferior to be continued. > 6. GDB inserts sw breakpoints and watchpoints and resumes the inferior. Either that or try keep hardware breakpoints and watchpoints uninserted, and insert them just before 4. This variant is a bit safer in case GDB crashes, but is a bit less efficient in case there are many watchpoints. But then again we already remove/insert them all at each step, so that is kind of moot. I've no real preference on which. This is a minor detail in the grand scheme from my perspective. -- Pedro Alves