From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18479 invoked by alias); 16 Jul 2013 14:13:58 -0000 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 Received: (qmail 18454 invoked by uid 89); 16 Jul 2013 14:13:57 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_20,KHOP_RCVD_UNTRUST,KHOP_THREADED,MAY_BE_FORGED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO e24smtp02.br.ibm.com) (32.104.18.86) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 16 Jul 2013 14:13:56 +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, 16 Jul 2013 11:13:47 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Jul 2013 11:13:45 -0300 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.13.184.26]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 7A6993520027 for ; Tue, 16 Jul 2013 10:13:44 -0400 (EDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay02.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6GECFHu35258546 for ; Tue, 16 Jul 2013 11:12:15 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6GEDgPD022050 for ; Tue, 16 Jul 2013 11:13:43 -0300 Received: from grandaddy.ibm.com (regianet.br.ibm.com [9.18.201.139] (may be forged)) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r6GEDgDD022042; Tue, 16 Jul 2013 11:13:42 -0300 From: Edjunior Barbosa Machado To: gdb-patches@sourceware.org Cc: Edjunior Barbosa Machado , Ulrich.Weigand@de.ibm.com, eliz@gnu.org, lgustavo@codesourcery.com Subject: Re: [PATCH] Enable hw watchpoint with longer ranges using DAWR on Power Date: Tue, 16 Jul 2013 14:13:00 -0000 Message-Id: <1373984020-31854-1-git-send-email-emachado@linux.vnet.ibm.com> In-reply-to: <1372798938-3549-1-git-send-email-emachado@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13071614-2194-0000-0000-000005FC5D63 X-SW-Source: 2013-07/txt/msg00363.txt.bz2 Resending the patch rebased on current CVS head, with the latest updates on gdb/ppc-linux-nat.c (thanks Ulrich for committing the patch renaming the 'booke' interface!). Ok to commit? Thanks, -- Edjunior gdb/ChangeLog 2013-07-16 Edjunior Barbosa Machado * ppc-linux-nat.c (PPC_DEBUG_FEATURE_DATA_BP_DAWR): New define. (ppc_linux_region_ok_for_hw_watchpoint): Add checking to use the new DAWR interface for longer ranges hardware watchpoint (up to 512 bytes). --- gdb/ppc-linux-nat.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 4b3c78c..1f3f080 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -177,7 +177,11 @@ struct ppc_hw_breakpoint (1<<((n)+PPC_BREAKPOINT_CONDITION_BE_SHIFT)) #endif /* PPC_PTRACE_GETHWDBGINFO */ - +/* Feature defined on Linux kernel v3.9: DAWR interface, that enables wider + watchpoint (up to 512 bytes). */ +#ifndef PPC_DEBUG_FEATURE_DATA_BP_DAWR +#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 +#endif /* PPC_DEBUG_FEATURE_DATA_BP_DAWR */ /* Similarly for the general-purpose (gp0 -- gp31) and floating-point registers (fp0 -- fp31). */ @@ -1504,6 +1508,7 @@ ppc_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) watchpoints. */ if (have_ptrace_hwdebug_interface ()) { + int region_size; /* Embedded DAC-based processors, like the PowerPC 440 have ranged watchpoints and can watch any access within an arbitrary memory region. This is useful to watch arrays and structs, for instance. It @@ -1512,11 +1517,17 @@ ppc_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) && hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_RANGE && ppc_linux_get_hwcap () & PPC_FEATURE_BOOKE) return 2; + /* Check if the processor provides DAWR interface. */ + if (hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_DAWR) + /* DAWR interface allows to watch up to 512 byte wide ranges which + can't cross a 512 byte boundary. */ + region_size = 512; + else + region_size = hwdebug_info.data_bp_alignment; /* Server processors provide one hardware watchpoint and addr+len should fall in the watchable region provided by the ptrace interface. */ - if (hwdebug_info.data_bp_alignment - && (addr + len > (addr & ~(hwdebug_info.data_bp_alignment - 1)) - + hwdebug_info.data_bp_alignment)) + if (region_size + && (addr + len > (addr & ~(region_size - 1)) + region_size)) return 0; } /* addr+len must fall in the 8 byte watchable region for DABR-based -- 1.8.2.1