From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22726 invoked by alias); 22 May 2012 15:24:51 -0000 Received: (qmail 22713 invoked by uid 22791); 22 May 2012 15:24:50 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp04.br.ibm.com (HELO e24smtp04.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 May 2012 15:24:36 +0000 Received: from /spool/local by e24smtp04.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2012 12:24:32 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp04.br.ibm.com (10.172.0.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 22 May 2012 12:24:24 -0300 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.13.184.26]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 0AE481DC004F for ; Tue, 22 May 2012 12:24:12 -0300 (BRT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay02.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4MFNoBe24903760 for ; Tue, 22 May 2012 12:23:50 -0300 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4MDO5Lh024523 for ; Tue, 22 May 2012 10:24:05 -0300 Received: from stooge.br.ibm.com (stooge.br.ibm.com [9.18.235.76]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q4MDO5tZ024496; Tue, 22 May 2012 10:24:05 -0300 From: Edjunior Barbosa Machado To: gdb-patches@sourceware.org Cc: Edjunior Barbosa Machado Subject: [PATCH] disable ptrace BookE interface for PowerPC server processors Date: Tue, 22 May 2012 15:24:00 -0000 Message-Id: <1337700251-9366-1-git-send-email-emachado@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12052215-8936-0000-0000-000006D7AC83 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/msg00826.txt.bz2 Hi, the ptrace BookE interface originally implemented only for embedded systems should be available for Power servers processors as well shortly [1]. However, while this is not usable in upstream kernel, gdb should enforce the usage of the old ptrace mechanism (using PTRACE_SET_DEBUGREG) on servers, even if BookE debug registers are reported as available. This patch fixes several tests related to watchpoints that were failing when running upstream kernel (> 3.0), decreasing the number of unexpected failures on gdb testsuite from 337 to 200 (Fedora 17 running kernel 3.3.4-5.fc17.ppc64). Ok to apply? Thanks, -- Edjunior Barbosa Machado IBM Linux Technology Center [1] http://lists.ozlabs.org/pipermail/linuxppc-dev/2012-May/097922.html gdb/ 2012-22-05 Edjunior Machado * ppc-linux-nat.c (have_ptrace_booke_interface): disable ptrace booke interface for powerpc server processors while this is not available in kernel. diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 34c40b4..5c95926 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1418,8 +1418,11 @@ have_ptrace_booke_interface (void) if (tid == 0) tid = PIDGET (inferior_ptid); - /* Check for kernel support for BOOKE debug registers. */ - if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &booke_debug_info) >= 0) + /* Check for kernel support for BOOKE debug registers. + This interface is currently available only for embedded + processors. */ + if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &booke_debug_info) >= 0 + && ppc_linux_get_hwcap () & PPC_FEATURE_BOOKE) { have_ptrace_booke_interface = 1; max_slots_number = booke_debug_info.num_instruction_bps