From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4416 invoked by alias); 3 May 2011 17:41:57 -0000 Received: (qmail 4280 invoked by uid 22791); 3 May 2011 17:41:55 -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; Tue, 03 May 2011 17:41:41 +0000 Received: (qmail 23580 invoked from network); 3 May 2011 17:41:40 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2011 17:41:40 -0000 From: Pedro Alves To: Eli Zaretskii Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint Date: Tue, 03 May 2011 17:41:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, bauerman@br.ibm.com, uweigand@de.ibm.com References: <201104291726.p3THQVaC029608@d06av02.portsmouth.uk.ibm.com> <201105031058.44489.pedro@codesourcery.com> <83iptr4tba.fsf@gnu.org> In-Reply-To: <83iptr4tba.fsf@gnu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201105031841.46949.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/msg00069.txt.bz2 On Tuesday 03 May 2011 17:55:53, Eli Zaretskii wrote: > > From: Pedro Alves > > Date: Tue, 3 May 2011 10:58:44 +0100 > > Cc: Thiago Jung Bauermann , > > uweigand@de.ibm.com > > > > What if we tried to make GDB do that instead? (try inserting > > watchpoint immediately, instead of trying to do any sort of > > accounting.) > > That could work, but won't it get us in trouble, e.g., when there are > other threads running? They could inadvertently hit those watchpoints > while we are trying to insert them, no? That would be no trouble, I think. If we're midway trying to insert them, it should be okay to hit them. The problem case I can think of is if we're installing e.g., 3 (low-level) watchpoints locations for a single watchpoint, say, and we fail on the third. When that happens, we need to delete the first two watchpoints locations. A thread may meanwhile hit one of those watchpoints, and gdb would only see the event _after_ the watchpoint location being long deleted. But, GDB already has to handle this situation situation anyway, because it's what happens when you simply delete a watchpoint in non-stop mode -- GDB will simply ignore such watchpoint events it can't explain. > > Or we could let targets which needs that (e.g., those using jtag as > you described) try inserting the watchpoints to respond to GDB's > request in target_can_use_hardware_watchpoint. Other targets, which > can decide that without inserting, would not need to do that. > > WDYT? The main point/win of the suggestion was avoiding the whole resource accounting infrastructure, getting away without adding a bunch of (what looks to me at this point, unnecessary) target methods/packets/logic. -- Pedro Alves