* defs.h (strlen_paddr, paddr, paddr_nz): Remove.
[deliverable/binutils-gdb.git] / gdb / arm-linux-tdep.c
index cdbb910367d5c5f1704722581606f2b13534203b..dc72ee14f55c71a37600ac448c9cc10edb651dae 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU/Linux on ARM target support.
 
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -36,6 +36,7 @@
 
 #include "arm-tdep.h"
 #include "arm-linux-tdep.h"
+#include "linux-tdep.h"
 #include "glibc-tdep.h"
 
 #include "gdb_string.h"
@@ -212,11 +213,11 @@ static const char arm_linux_thumb_le_breakpoint[] = {0x01, 0xde};
 #define ARM_EABI_SYSCALL               0xef000000
 
 static void
-arm_linux_sigtramp_cache (struct frame_info *next_frame,
+arm_linux_sigtramp_cache (struct frame_info *this_frame,
                          struct trad_frame_cache *this_cache,
                          CORE_ADDR func, int regs_offset)
 {
-  CORE_ADDR sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
+  CORE_ADDR sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM);
   CORE_ADDR base = sp + regs_offset;
   int i;
 
@@ -279,38 +280,38 @@ arm_linux_sigtramp_cache (struct frame_info *next_frame,
 
 static void
 arm_linux_sigreturn_init (const struct tramp_frame *self,
-                         struct frame_info *next_frame,
+                         struct frame_info *this_frame,
                          struct trad_frame_cache *this_cache,
                          CORE_ADDR func)
 {
-  CORE_ADDR sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
+  CORE_ADDR sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM);
   ULONGEST uc_flags = read_memory_unsigned_integer (sp, 4);
 
   if (uc_flags == ARM_NEW_SIGFRAME_MAGIC)
-    arm_linux_sigtramp_cache (next_frame, this_cache, func,
+    arm_linux_sigtramp_cache (this_frame, this_cache, func,
                              ARM_UCONTEXT_SIGCONTEXT
                              + ARM_SIGCONTEXT_R0);
   else
-    arm_linux_sigtramp_cache (next_frame, this_cache, func,
+    arm_linux_sigtramp_cache (this_frame, this_cache, func,
                              ARM_SIGCONTEXT_R0);
 }
 
 static void
 arm_linux_rt_sigreturn_init (const struct tramp_frame *self,
-                         struct frame_info *next_frame,
+                         struct frame_info *this_frame,
                          struct trad_frame_cache *this_cache,
                          CORE_ADDR func)
 {
-  CORE_ADDR sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
+  CORE_ADDR sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM);
   ULONGEST pinfo = read_memory_unsigned_integer (sp, 4);
 
   if (pinfo == sp + ARM_OLD_RT_SIGFRAME_SIGINFO)
-    arm_linux_sigtramp_cache (next_frame, this_cache, func,
+    arm_linux_sigtramp_cache (this_frame, this_cache, func,
                              ARM_OLD_RT_SIGFRAME_UCONTEXT
                              + ARM_UCONTEXT_SIGCONTEXT
                              + ARM_SIGCONTEXT_R0);
   else
-    arm_linux_sigtramp_cache (next_frame, this_cache, func,
+    arm_linux_sigtramp_cache (this_frame, this_cache, func,
                              ARM_NEW_RT_SIGFRAME_UCONTEXT
                              + ARM_UCONTEXT_SIGCONTEXT
                              + ARM_SIGCONTEXT_R0);
@@ -381,7 +382,7 @@ arm_linux_supply_gregset (const struct regset *regset,
     {
       if (arm_apcs_32)
        regcache_raw_supply (regcache, ARM_PS_REGNUM,
-                            gregs + INT_REGISTER_SIZE * ARM_CPSR_REGNUM);
+                            gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM);
       else
        regcache_raw_supply (regcache, ARM_PS_REGNUM,
                             gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
@@ -415,7 +416,7 @@ arm_linux_collect_gregset (const struct regset *regset,
     {
       if (arm_apcs_32)
        regcache_raw_collect (regcache, ARM_PS_REGNUM,
-                             gregs + INT_REGISTER_SIZE * ARM_CPSR_REGNUM);
+                             gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM);
       else
        regcache_raw_collect (regcache, ARM_PS_REGNUM,
                              gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
@@ -571,9 +572,10 @@ arm_linux_regset_from_core_section (struct gdbarch *gdbarch,
 
 /* Insert a single step breakpoint at the next executed instruction.  */
 
-int
+static int
 arm_linux_software_single_step (struct frame_info *frame)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   CORE_ADDR next_pc = arm_get_next_pc (frame, get_frame_pc (frame));
 
   /* The Linux kernel offers some user-mode helpers in a high page.  We can
@@ -584,7 +586,7 @@ arm_linux_software_single_step (struct frame_info *frame)
   if (next_pc > 0xffff0000)
     next_pc = get_frame_register_unsigned (frame, ARM_LR_REGNUM);
 
-  insert_single_step_breakpoint (next_pc);
+  insert_single_step_breakpoint (gdbarch, next_pc);
 
   return 1;
 }
@@ -647,8 +649,13 @@ arm_linux_init_abi (struct gdbarch_info info,
   /* Core file support.  */
   set_gdbarch_regset_from_core_section (gdbarch,
                                        arm_linux_regset_from_core_section);
+
+  set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_arm_linux_tdep;
+
 void
 _initialize_arm_linux_tdep (void)
 {
This page took 0.026086 seconds and 4 git commands to generate.