From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2734 invoked by alias); 5 May 2011 11:10:32 -0000 Received: (qmail 2724 invoked by uid 22791); 5 May 2011 11:10:31 -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 mtagate3.uk.ibm.com (HELO mtagate3.uk.ibm.com) (194.196.100.163) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 11:10:17 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p45BA7tB024545 for ; Thu, 5 May 2011 11:10:07 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p45BBKai2605164 for ; Thu, 5 May 2011 12:11:20 +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 p45BA7vQ013482 for ; Thu, 5 May 2011 05:10:07 -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 p45BA6Jm013405; Thu, 5 May 2011 05:10:06 -0600 Message-Id: <201105051110.p45BA6Jm013405@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 05 May 2011 13:10:05 +0200 Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint To: pedro@codesourcery.com (Pedro Alves) Date: Thu, 05 May 2011 11:10:00 -0000 From: "Ulrich Weigand" Cc: bauerman@br.ibm.com (Thiago Jung Bauermann), eliz@gnu.org (Eli Zaretskii), gdb-patches@sourceware.org In-Reply-To: <201105050915.18716.pedro@codesourcery.com> from "Pedro Alves" at May 05, 2011 09:15:18 AM 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-05/txt/msg00125.txt.bz2 Pedro Alves wrote: > 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. One thing I'm wondering about is the comment before update_watchpoints: Even with `set breakpoint always-inserted on' the watchpoints are removed + inserted on each stop here. Normal breakpoints must never be removed because they might be missed by a running thread when debugging in non-stop mode. On the other hand, hardware watchpoints (is_hardware_watchpoint; processed here) are specific to each LWP since they are stored in each LWP's hardware debug registers. Therefore, such LWP must be stopped first in order to be able to modify its hardware watchpoints. [etc.] Is this still valid, and would it affect this current discussion if so? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com