Update comments to TERNOP_SLICE
[deliverable/binutils-gdb.git] / gdb / arm-linux-tdep.c
index de0c211a0e8b7a27b6b2dc3d8e7233c534fd9dd9..a96ea3fc94fed05695ed954ef9d0468c976a5499 100644 (file)
@@ -41,6 +41,7 @@
 #include "glibc-tdep.h"
 #include "arch-utils.h"
 #include "inferior.h"
+#include "infrun.h"
 #include "gdbthread.h"
 #include "symfile.h"
 
@@ -686,6 +687,21 @@ arm_linux_collect_vfp (const struct regset *regset,
                            regs + (regno - ARM_D0_REGNUM) * 8);
 }
 
+static const struct regset arm_linux_gregset =
+  {
+    NULL, arm_linux_supply_gregset, arm_linux_collect_gregset
+  };
+
+static const struct regset arm_linux_fpregset =
+  {
+    NULL, arm_linux_supply_nwfpe, arm_linux_collect_nwfpe
+  };
+
+static const struct regset arm_linux_vfpregset =
+  {
+    NULL, arm_linux_supply_vfp, arm_linux_collect_vfp
+  };
+
 /* Return the appropriate register set for the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
@@ -693,34 +709,17 @@ static const struct regset *
 arm_linux_regset_from_core_section (struct gdbarch *gdbarch,
                                    const char *sect_name, size_t sect_size)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   if (strcmp (sect_name, ".reg") == 0
       && sect_size == ARM_LINUX_SIZEOF_GREGSET)
-    {
-      if (tdep->gregset == NULL)
-        tdep->gregset = regset_alloc (gdbarch, arm_linux_supply_gregset,
-                                      arm_linux_collect_gregset);
-      return tdep->gregset;
-    }
+    return &arm_linux_gregset;
 
   if (strcmp (sect_name, ".reg2") == 0
       && sect_size == ARM_LINUX_SIZEOF_NWFPE)
-    {
-      if (tdep->fpregset == NULL)
-        tdep->fpregset = regset_alloc (gdbarch, arm_linux_supply_nwfpe,
-                                       arm_linux_collect_nwfpe);
-      return tdep->fpregset;
-    }
+    return &arm_linux_fpregset;
 
   if (strcmp (sect_name, ".reg-arm-vfp") == 0
       && sect_size == ARM_LINUX_SIZEOF_VFP)
-    {
-      if (tdep->vfpregset == NULL)
-        tdep->vfpregset = regset_alloc (gdbarch, arm_linux_supply_vfp,
-                                       arm_linux_collect_vfp);
-      return tdep->vfpregset;
-    }
+    return &arm_linux_vfpregset;
 
   return NULL;
 }
@@ -1206,28 +1205,28 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch,
        return 0;
 
       /* The displacement.  */
-      write_exp_elt_opcode (OP_LONG);
-      write_exp_elt_type (builtin_type (gdbarch)->builtin_long);
-      write_exp_elt_longcst (displacement);
-      write_exp_elt_opcode (OP_LONG);
+      write_exp_elt_opcode (&p->pstate, OP_LONG);
+      write_exp_elt_type (&p->pstate, builtin_type (gdbarch)->builtin_long);
+      write_exp_elt_longcst (&p->pstate, displacement);
+      write_exp_elt_opcode (&p->pstate, OP_LONG);
       if (got_minus)
-       write_exp_elt_opcode (UNOP_NEG);
+       write_exp_elt_opcode (&p->pstate, UNOP_NEG);
 
       /* The register name.  */
-      write_exp_elt_opcode (OP_REGISTER);
+      write_exp_elt_opcode (&p->pstate, OP_REGISTER);
       str.ptr = regname;
       str.length = len;
-      write_exp_string (str);
-      write_exp_elt_opcode (OP_REGISTER);
+      write_exp_string (&p->pstate, str);
+      write_exp_elt_opcode (&p->pstate, OP_REGISTER);
 
-      write_exp_elt_opcode (BINOP_ADD);
+      write_exp_elt_opcode (&p->pstate, BINOP_ADD);
 
       /* Casting to the expected type.  */
-      write_exp_elt_opcode (UNOP_CAST);
-      write_exp_elt_type (lookup_pointer_type (p->arg_type));
-      write_exp_elt_opcode (UNOP_CAST);
+      write_exp_elt_opcode (&p->pstate, UNOP_CAST);
+      write_exp_elt_type (&p->pstate, lookup_pointer_type (p->arg_type));
+      write_exp_elt_opcode (&p->pstate, UNOP_CAST);
 
-      write_exp_elt_opcode (UNOP_IND);
+      write_exp_elt_opcode (&p->pstate, UNOP_IND);
 
       p->arg = tmp;
     }
@@ -1323,6 +1322,19 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
   return 0;
 }
 
+/* Implement the skip_trampoline_code gdbarch method.  */
+
+static CORE_ADDR
+arm_linux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+{
+  CORE_ADDR target_pc = arm_skip_stub (frame, pc);
+
+  if (target_pc != 0)
+    return target_pc;
+
+  return find_solib_trampoline_target (frame, pc);
+}
+
 static void
 arm_linux_init_abi (struct gdbarch_info info,
                    struct gdbarch *gdbarch)
@@ -1388,7 +1400,7 @@ arm_linux_init_abi (struct gdbarch_info info,
   set_gdbarch_software_single_step (gdbarch, arm_linux_software_single_step);
 
   /* Shared library handling.  */
-  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_gdbarch_skip_trampoline_code (gdbarch, arm_linux_skip_trampoline_code);
   set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
 
   /* Enable TLS support.  */
This page took 0.024787 seconds and 4 git commands to generate.