Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Subject: [PATCH] disable ptrace BookE interface for PowerPC server processors
Date: Tue, 22 May 2012 15:24:00 -0000	[thread overview]
Message-ID: <1337700251-9366-1-git-send-email-emachado@linux.vnet.ibm.com> (raw)

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  <emachado@linux.vnet.ibm.com>

	* 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


             reply	other threads:[~2012-05-22 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 15:24 Edjunior Barbosa Machado [this message]
2012-05-22 17:34 ` Mark Kettenis
2012-05-25  3:50   ` Edjunior Barbosa Machado
2012-05-29 18:54     ` Mark Kettenis
2012-05-30  4:17       ` Edjunior Barbosa Machado
2012-05-30 15:31         ` Mark Kettenis
2012-05-31 20:56     ` Sergio Durigan Junior
2012-05-31 22:09       ` Edjunior Barbosa Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337700251-9366-1-git-send-email-emachado@linux.vnet.ibm.com \
    --to=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox