2003-04-09 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / ppc-linux-tdep.c
index c118cf4af3c002c86ae84b99ae9a3312b761d248..95c7f558f22a59be22b2fd0469ecf1e9cdb7918f 100644 (file)
 #include "solib-svr4.h"
 #include "ppc-tdep.h"
 
-/* The following two instructions are used in the signal trampoline
-   code on GNU/Linux PPC.  */
-#define INSTR_LI_R0_0x7777     0x38007777
-#define INSTR_SC               0x44000002
+/* The following instructions are used in the signal trampoline code
+   on GNU/Linux PPC. The kernel used to use magic syscalls 0x6666 and
+   0x7777 but now uses the sigreturn syscalls.  We check for both.  */
+#define INSTR_LI_R0_0x6666             0x38006666
+#define INSTR_LI_R0_0x7777             0x38007777
+#define INSTR_LI_R0_NR_sigreturn       0x38000077
+#define INSTR_LI_R0_NR_rt_sigreturn    0x380000AC
+
+#define INSTR_SC                       0x44000002
 
 /* Since the *-tdep.c files are platform independent (i.e, they may be
    used to build cross platform debuggers), we can't include system
@@ -183,6 +188,21 @@ ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
   return (pc == handler || pc == handler + 4);
 }
 
+static inline int
+insn_is_sigreturn (unsigned long pcinsn)
+{
+  switch(pcinsn)
+    {
+    case INSTR_LI_R0_0x6666:
+    case INSTR_LI_R0_0x7777:
+    case INSTR_LI_R0_NR_sigreturn:
+    case INSTR_LI_R0_NR_rt_sigreturn:
+      return 1;
+    default:
+      return 0;
+    }
+}
+
 /*
  * The signal handler trampoline is on the stack and consists of exactly
  * two instructions.  The easiest and most accurate way of determining
@@ -202,11 +222,11 @@ ppc_linux_at_sigtramp_return_path (CORE_ADDR pc)
   pcinsn = extract_unsigned_integer (buf + 4, 4);
 
   return (
-          (pcinsn == INSTR_LI_R0_0x7777
+          (insn_is_sigreturn (pcinsn)
            && extract_unsigned_integer (buf + 8, 4) == INSTR_SC)
           ||
           (pcinsn == INSTR_SC
-           && extract_unsigned_integer (buf, 4) == INSTR_LI_R0_0x7777));
+           && insn_is_sigreturn (extract_unsigned_integer (buf, 4))));
 }
 
 CORE_ADDR
@@ -709,12 +729,12 @@ ppc_linux_init_abi (struct gdbarch_info info,
         *_push_arguments().  The same remarks hold for the methods below.  */
       set_gdbarch_frameless_function_invocation (gdbarch,
         ppc_linux_frameless_function_invocation);
-      set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain);
-      set_gdbarch_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
+      set_gdbarch_deprecated_frame_chain (gdbarch, ppc_linux_frame_chain);
+      set_gdbarch_deprecated_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
 
-      set_gdbarch_frame_init_saved_regs (gdbarch,
+      set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
                                          ppc_linux_frame_init_saved_regs);
-      set_gdbarch_init_extra_frame_info (gdbarch,
+      set_gdbarch_deprecated_init_extra_frame_info (gdbarch,
                                          ppc_linux_init_extra_frame_info);
 
       set_gdbarch_memory_remove_breakpoint (gdbarch,
This page took 0.024475 seconds and 4 git commands to generate.