File gdb-ppc-ptrace.diff of Package gdb

Index: gdb-7.4.50.20120603/gdb/ppc-linux-nat.c
===================================================================
--- gdb-7.4.50.20120603.orig/gdb/ppc-linux-nat.c	2012-06-01 00:07:31.000000000 +0200
+++ gdb-7.4.50.20120603/gdb/ppc-linux-nat.c	2012-06-12 15:17:59.537703950 +0200
@@ -1418,8 +1418,12 @@ 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.
+	 As a workaround while the new ptrace interface is not accepted
+	 in upstream kernel, server processors still should use the old
+	 interface.  */
+      if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &booke_debug_info) >= 0
+	  && ppc_linux_get_hwcap () & PPC_FEATURE_BOOKE)
 	{
 	  /* Check whether ptrace BOOKE interface is functional and
 	     provides any supported feature.  */
openSUSE Build Service is sponsored by