From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13087 invoked by alias); 1 Oct 2002 18:23:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13080 invoked from network); 1 Oct 2002 18:23:39 -0000 Received: from unknown (HELO odin.inter.net.il) (192.114.186.10) by sources.redhat.com with SMTP; 1 Oct 2002 18:23:39 -0000 Received: from Zaretsky ([80.230.2.40]) by odin.inter.net.il (Mirapoint Messaging Server MOS 3.1.0.58-GA) with ESMTP id AOU23313; Tue, 1 Oct 2002 21:23:22 +0300 (IDT) Date: Tue, 01 Oct 2002 11:23:00 -0000 From: "Eli Zaretskii" To: ac131313@redhat.com Message-Id: <2427-Tue01Oct2002212319+0200-eliz@is.elta.co.il> CC: gdb-patches@sources.redhat.com In-reply-to: <3D9939CF.8050205@redhat.com> (message from Andrew Cagney on Tue, 01 Oct 2002 01:59:43 -0400) Subject: Re: [rfa:breakpoint] Correctly count watchpoints Reply-to: Eli Zaretskii References: <3D9939CF.8050205@redhat.com> X-SW-Source: 2002-10/txt/msg00009.txt.bz2 > Date: Tue, 01 Oct 2002 01:59:43 -0400 > From: Andrew Cagney > > > > Why two? Some expressions might need 3 registers. If you use this > > worst-case scenario, GDB will think it cannot watch more than a single > > expression, and that some data types, such as double's, and complex > > aggregates, such as struct's, cannot be watched at all. It's hardly a > > Good Thing to refuse to set watchpoints based on inaccurate decisions > > like this. > > You mentioned two :-) That was an example. > Under the current arangement, an architecture has two choices: > > - have target_can_use_hardware_watchpoints() always return true (most > targets appear to do this) and then error while trying to insert the > watchpoints. This is what the i386 currently does. > > - have target_can_use...() make use of the counts and return an > indication based on that The reason the first strategy is widely used is that the high-level code of GDB makes it very hard to do anything intelligent otherwise, especially since refusing the target_can_use_hardware_watchpoints call means GDB won't even try to insert that watchpoint. IIRC, GDB doesn't even promise to call that function (macro) only once for each watchpoint.