From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21432 invoked by alias); 8 Jan 2010 10:30:12 -0000 Received: (qmail 21418 invoked by uid 22791); 8 Jan 2010 10:30:12 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jan 2010 10:30:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0A7112BABAC; Fri, 8 Jan 2010 05:30:05 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id io8M6qkXpHig; Fri, 8 Jan 2010 05:30:04 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C9FAB2BABE4; Fri, 8 Jan 2010 05:30:03 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 19756F595E; Fri, 8 Jan 2010 14:29:55 +0400 (RET) Date: Fri, 08 Jan 2010 10:30:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Wrong hw_watchpoint_used_count? (multiple location watchpoints) Message-ID: <20100108102955.GC29312@adacore.com> References: <20100108075701.GE4589@adacore.com> <83fx6gc43p.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83fx6gc43p.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-01/txt/msg00160.txt.bz2 > But this is something only the target knows. There's no way for > breakpoint.c to know that, unless we introduce an API through which > breakpoint.c can ask the target to provide that number. That's what I eventually thought as well... I have relatively little experience in how GDB is designed to handle watchpoints, but it seemed that the boundary between the what the target knows and how the core uses it provide watchpoint support is pretty hard to find... Perhaps, one day, we'll want to clarify this area of our code. > Please note, for example, that some watchpoints can actually need > *zero* bp_locations, because some other watchpoint already watches the > same address. x86 uses reference counting to not waste hardware > resources for the same address. Clever! Thanks for the feedback. -- Joel