From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26260 invoked by alias); 8 Jan 2010 12:11:19 -0000 Received: (qmail 26250 invoked by uid 22791); 8 Jan 2010 12:11:18 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_20,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jan 2010 12:11:12 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KVX00D00GD6AQ00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Fri, 08 Jan 2010 14:10:17 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.222.44]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KVX00CJ5GH44MD0@a-mtaout20.012.net.il>; Fri, 08 Jan 2010 14:10:16 +0200 (IST) Date: Fri, 08 Jan 2010 12:11:00 -0000 From: Eli Zaretskii Subject: Re: [RFC] Wrong hw_watchpoint_used_count? (multiple location watchpoints) In-reply-to: <20100108102955.GC29312@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83aawobxze.fsf@gnu.org> References: <20100108075701.GE4589@adacore.com> <83fx6gc43p.fsf@gnu.org> <20100108102955.GC29312@adacore.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: 2010-01/txt/msg00164.txt.bz2 > Date: Fri, 8 Jan 2010 14:29:55 +0400 > From: Joel Brobecker > Cc: gdb-patches@sourceware.org > > > 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... The current boundary is the places where breakpoint.c calls the various target_* methods which return information that only the target knows. It is my opinion that breakpoint.c currently tries to know too much about the target-side implementation details of the watchpoints, and that introduces unpleasant side effects and unwanted dependencies on the underlying platforms. One unpleasant side effect is that we only announce at "continue" time that too many hardware resources were required; we should have announced that at "watchpoint" time. In particular, I think that the bookkeeping of the various locations where watchpoints are inserted should be left to the target. That would allow, e.g., targets that don't support range watchpoints to emulate them with multiple watchpoints.