* ld-cris/expdyn1.d, ld-cris/expdyn5.d, ld-cris/expdyn6.d,
[deliverable/binutils-gdb.git] / gdb / i386obsd-tdep.c
index 0fe066fa20d88da17ad72f450e3048f1ea07b5bc..9ef868d6ec45a9ce48fa195800a1792ecdced2af 100644 (file)
@@ -65,6 +65,7 @@ i386obsd_sigtramp_p (struct frame_info *next_frame)
     0x67, 0x00, 0x00, 0x00,    /* movl $SYS_sigreturn, %eax */
     0xcd, 0x80                 /* int $0x80 */
   };
+  size_t buflen = sizeof sigreturn;
   char *name, *buf;
 
   /* If the function has a valid symbol name, it isn't a
@@ -78,13 +79,23 @@ i386obsd_sigtramp_p (struct frame_info *next_frame)
   if (find_pc_section (pc) != NULL)
     return 0;
 
+  /* Allocate buffer.  */
+  buf = alloca (buflen);
+
   /* If we can't read the instructions at START_PC, return zero.  */
-  buf = alloca (sizeof sigreturn);
-  if (target_read_memory (start_pc + 0x14, buf, sizeof sigreturn))
+  if (!safe_frame_unwind_memory (next_frame, start_pc + 0x0a, buf, buflen))
     return 0;
 
   /* Check for sigreturn(2).  */
-  if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
+  if (memcmp (buf, sigreturn, buflen) == 0)
+    return 1;
+
+  /* If we can't read the instructions at START_PC, return zero.  */
+  if (!safe_frame_unwind_memory (next_frame, start_pc + 0x14, buf, buflen))
+    return 0;
+
+  /* Check for sigreturn(2) (again).  */
+  if (memcmp (buf, sigreturn, buflen) == 0)
     return 1;
 
   return 0;
@@ -119,7 +130,7 @@ i386obsd_aout_supply_regset (const struct regset *regset,
                             struct regcache *regcache, int regnum,
                             const void *regs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE);
 
@@ -141,11 +152,8 @@ i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
       && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
     {
       if (tdep->gregset == NULL)
-       {
-         tdep->gregset = XMALLOC (struct regset);
-         tdep->gregset->descr = tdep;
-         tdep->gregset->supply_regset = i386obsd_aout_supply_regset;
-       }
+        tdep->gregset =
+         regset_alloc (gdbarch, i386obsd_aout_supply_regset, NULL);
       return tdep->gregset;
     }
 
This page took 0.023731 seconds and 4 git commands to generate.