From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1788 invoked by alias); 5 Apr 2011 16:42:10 -0000 Received: (qmail 1760 invoked by uid 22791); 5 Apr 2011 16:42:08 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.uk.ibm.com (HELO mtagate4.uk.ibm.com) (194.196.100.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Apr 2011 16:42:04 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p35Gg2ca031751 for ; Tue, 5 Apr 2011 16:42:02 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p35Ggh5i1638588 for ; Tue, 5 Apr 2011 17:42:43 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p35Gg1SS012695 for ; Tue, 5 Apr 2011 10:42:01 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p35Gg0Op012678; Tue, 5 Apr 2011 10:42:00 -0600 Message-Id: <201104051642.p35Gg0Op012678@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 05 Apr 2011 18:42:00 +0200 Subject: Re: [RFA][branch] Fix DVC calculation for booke ppc To: bauerman@br.ibm.com (Thiago Jung Bauermann) Date: Tue, 05 Apr 2011 16:42:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml) In-Reply-To: <1301967654.2511.19.camel@hactar> from "Thiago Jung Bauermann" at Apr 04, 2011 10:40:54 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-04/txt/msg00074.txt.bz2 Thiago Jung Bauermann wrotE: > The bug was introduced by a patch of mine (doh). > ppc-linux-nat.c:calculate_dvc uses the watchpoint length that is passed > to target_insert_watchpoint to calculate the contents of the Data Value > Compare register. The problem is that for the ranged watchpoints feature > I changed GDB to pass 1 as length if the "set powerpc exact-watchpoints" > flag is on. This messes up things for calculate_dvc. > > This patch makes check_condition obtain the length of the watchpoint > region from the condition expression, so that it can be passed to > calculate_dvc. This works because for a condition to be eligible for > hardware acceleration, it needs to have a strict form: > > (gdb) watch ADDRESS|VARIABLE \ > if ADDRESS|VARIABLE == CONSTANT EXPRESSION > > which means that the ADDRESS|VARIABLE part is the same as the watchpoint > region. Huh. That strikes me as a hack to work around another hack :-/ I may have missed some of the discussion behind the current implementation. Could you explain again: - why you're passing an incorrect length of 1 if the "exact watchpoints" flag is on? - why you're only supporting hardware-accelerated conditions if the length is 1? Note that while you say that the condition needs to have a strict form, you don't currently actually *verify* this: if you have a command of the form "watch A if B == C", you only verify that A and B *start* at the same address -- you really need to also verify that A and B have the same length -- but you cannot because the length of A is not available to the target since you're always getting 1 for length. It seems to me the "right way" would be for the common parts to always pass correct information (address, length, condition, ...) to the target, and then for the target to look at the request and choose the best possible hardware means to implement this particular request ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com