From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27147 invoked by alias); 25 May 2012 03:50:10 -0000 Received: (qmail 27132 invoked by uid 22791); 25 May 2012 03:50:08 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp01.br.ibm.com (HELO e24smtp01.br.ibm.com) (32.104.18.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 03:49:55 +0000 Received: from /spool/local by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 May 2012 00:49:53 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp01.br.ibm.com (10.172.0.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 25 May 2012 00:49:51 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id DA0683520044 for ; Fri, 25 May 2012 00:49:44 -0300 (BRT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4P3lh1A3055764 for ; Fri, 25 May 2012 00:47:43 -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 q4P1nbOk000445 for ; Thu, 24 May 2012 22:49:37 -0300 Received: from [9.12.225.23] ([9.12.225.23]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q4P1nYUA000415; Thu, 24 May 2012 22:49:35 -0300 Message-ID: <4FBF0153.4060108@linux.vnet.ibm.com> Date: Fri, 25 May 2012 03:50:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: Mark Kettenis , "K.Prasad" Subject: Re: [PATCH] disable ptrace BookE interface for PowerPC server processors References: <1337700251-9366-1-git-send-email-emachado@linux.vnet.ibm.com> <201205221734.q4MHY0FQ014975@glazunov.sibelius.xs4all.nl> In-Reply-To: <201205221734.q4MHY0FQ014975@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12052503-1524-0000-0000-000002836D26 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/msg00954.txt.bz2 On 05/22/2012 02:34 PM, Mark Kettenis wrote: > But how are you going to handle this when that functionality does > become available? Thanks for the feedback and sorry for the late reply. I was discussing with the kernel developer responsible for the next version of the ptrace booke interface and he proposed that the 'features' field from the struct ppc_debug_info returned by ptrace PPC_PTRACE_GETHWDBGINFO call could be used to check if its availability. According to him, this field is currently 0 for servers, but once the new ptrace interface becomes functional, it will return the flag PPC_DEBUG_FEATURE_DATA_BP_RANGE enabled. Moreover, this change will not affect the behavior on embedded processors (which already has PPC_DEBUG_FEATURE_DATA_BP_RANGE and PPC_DEBUG_FEATURE_DATA_BP_MASK enabled). Please consider the new version of the patch below. Thanks, -- Edjunior Barbosa Machado IBM Linux Technology Center gdb/ 2012-25-05 Edjunior Machado * ppc-linux-nat.c (have_ptrace_booke_interface): disable ptrace booke interface for powerpc server processors if not available in kernel. diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 34c40b4..9ffcf88 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1421,17 +1421,18 @@ have_ptrace_booke_interface (void) /* Check for kernel support for BOOKE debug registers. */ if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &booke_debug_info) >= 0) { - have_ptrace_booke_interface = 1; - max_slots_number = booke_debug_info.num_instruction_bps - + booke_debug_info.num_data_bps - + booke_debug_info.num_condition_regs; - } - else - { - /* Old school interface and no BOOKE debug registers support. */ - have_ptrace_booke_interface = 0; - memset (&booke_debug_info, 0, sizeof (struct ppc_debug_info)); + if (booke_debug_info.features) + { + have_ptrace_booke_interface = 1; + max_slots_number = booke_debug_info.num_instruction_bps + + booke_debug_info.num_data_bps + + booke_debug_info.num_condition_regs; + return have_ptrace_booke_interface; + } } + /* Old school interface and no BOOKE debug registers support. */ + have_ptrace_booke_interface = 0; + memset (&booke_debug_info, 0, sizeof (struct ppc_debug_info)); } return have_ptrace_booke_interface;