From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6308 invoked by alias); 9 Aug 2008 12:03:11 -0000 Received: (qmail 6297 invoked by uid 22791); 9 Aug 2008 12:03:10 -0000 X-Spam-Check-By: sourceware.org Received: from mail.idnet.net.uk (HELO mail.idnet.net.uk) (212.69.36.63) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 12:02:20 +0000 Received: from [91.135.5.64] by mail.idnet.net.uk (GMS 15.00.3626/NU3963.00.7ca42f0c) with ESMTP id utirykba for gdb@sourceware.org; Sat, 9 Aug 2008 13:02:16 +0100 Subject: Problem with can_use_hw_breakpoint From: Jeremy Bennett Reply-To: jeremy.bennett@embecosm.com To: gdb@sourceware.org In-Reply-To: References: <200807312204.m6VM4JQM007611@tully.CS.Berkeley.EDU> <200808011054.24219.apoenitz@trolltech.com> <20080801125124.GA13594@caradoc.them.org> <20080801135920.GA17022@caradoc.them.org> <20080801152850.GA23431@caradoc.them.org> Content-Type: text/plain Date: Tue, 12 Aug 2008 14:40:00 -0000 Message-Id: <1218283386.2855.106.camel@thomas> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-AuthenticatedSender: jeremy.bennett.embecosm.com@idnet.net.uk X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00157.txt.bz2 I am trying to implement the target operation can_use_hw_breakpoint() for an architecture with limited resources for hardware breakpoint/watchpoint. The call to can_use_hw_breakpoint() will identify the type of HW breakpoint/watchpoint, a count of how many of that type are required, and for watchpoints a flag (othertype) to indicate if HW watchpoints of other types have been requested. This function is called in response to watch, rwatch, awatch or hbreak commands. My architecture can support up to 4 hardware watchpoints. Consider the sequence awatch a (watchpoint 1) awatch b (watchpoint 2) rwatch c (watchpoint 3) rwatch d (watchpoint 4) rwatch e rwatch e should fail (5th request), but all I know from the call to can_use_hw_breakpoint() is that 3 of this type are requested and that some other type of watchpoint (but not how many) has previously been requested. It does not help to keep a private count of the calls, since I have no notification of deletions, so I could not distinguish the sequence awatch a (watchpoint 1) awatch b (watchpoint 2) rwatch c (watchpoint 3) rwatch d (watchpoint 4) delete 1 rwatch e (watchpoint 5) which should succeed. Ideally I would like can_use_hw_breakpoint to supply me with an array with the counts of all types of HW breakpoint/watchpoint requested, so I could determine the total resource currently required. In the absence of this, can anyone suggest a reasonably simple solution. The only approach I could think would be to place observers on the watch, rwatch, awatch, hbreak and delete commands. This seems an excessively heavyweight solution to impose. Any suggestions welcome. Thanks, Jeremy -- Tel: +44 (1202) 416955 Cell: +44 (7970) 676050 SkypeID: jeremybennett Email: jeremy.bennett@embecosm.com Web: www.embecosm.com