From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20235 invoked by alias); 29 May 2012 18:28:39 -0000 Received: (qmail 20227 invoked by uid 22791); 29 May 2012 18:28:38 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp02.br.ibm.com (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 May 2012 18:28:21 +0000 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 May 2012 15:28:18 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 29 May 2012 15:27:33 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id BC90C1DC004B for ; Tue, 29 May 2012 15:27:25 -0300 (BRT) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay03.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4TIR31N24510946 for ; Tue, 29 May 2012 15:27:03 -0300 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4TGRmnT004894 for ; Tue, 29 May 2012 13:27:48 -0300 Received: from stooge.br.ibm.com (stooge.br.ibm.com [9.18.235.76]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q4TGRmG2004891 for ; Tue, 29 May 2012 13:27:48 -0300 From: Edjunior Barbosa Machado To: gdb-patches@sourceware.org Subject: [PATCH] fix accounting of hw watchpoints on ppc Date: Tue, 29 May 2012 18:28:00 -0000 Message-Id: <1338316019-12994-1-git-send-email-emachado@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12052918-2194-0000-0000-000001FD9C81 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: 2012-05/txt/msg01030.txt.bz2 Hi, this small patch fixes the checking of hardware watchpoints on ppc, taking into account the different types of watches. With this change, the following unexpected failures no longer happen: FAIL: gdb.base/watch-read.exp: read watchpoint triggers when value doesn't change, trapping reads and writes FAIL: gdb.base/watch-read.exp: only read watchpoint triggers when value doesn't change Tested against ppc64/32, with no regressions found. Ok to apply? Thanks, -- Edjunior Barbosa Machado IBM Linux Technology Center gdb/ 2012-05-29 Edjunior Machado * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): fix accounting of hw watchpoints on ppc. diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 9bd11fd..b9e0c85 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1461,7 +1461,7 @@ ppc_linux_can_use_hw_breakpoint (int type, int cnt, int ot) if (type == bp_hardware_watchpoint || type == bp_read_watchpoint || type == bp_access_watchpoint || type == bp_watchpoint) { - if (cnt > total_hw_wp) + if (cnt + ot > total_hw_wp) return -1; } else if (type == bp_hardware_breakpoint)