*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / ppcobsd-tdep.c
index d83e428c4f61e767618533142481c247f847d612..d4e2d792e02b58f445e71ccaf20685fb1c260fda 100644 (file)
@@ -1,6 +1,7 @@
 /* Target-dependent code for OpenBSD/powerpc.
 
-   Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -56,7 +57,7 @@ ppcobsd_supply_gregset (const struct regset *regset,
 }
 
 /* Collect register REGNUM in the general-purpose register set
-   REGSET. from register cache REGCACHE into the buffer specified by
+   REGSET, from register cache REGCACHE into the buffer specified by
    GREGS and LEN.  If REGNUM is -1, do this for all registers in
    REGSET.  */
 
@@ -125,6 +126,8 @@ ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self,
                                struct frame_info *this_frame,
                                void **this_cache)
 {
+  struct gdbarch *gdbarch = get_frame_arch (this_frame);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR pc = get_frame_pc (this_frame);
   CORE_ADDR start_pc = (pc & ~(ppcobsd_page_size - 1));
   const int *offset;
@@ -144,12 +147,13 @@ ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self,
        continue;
 
       /* Check for "li r0,SYS_sigreturn".  */
-      insn = extract_unsigned_integer (buf, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (buf, PPC_INSN_SIZE, byte_order);
       if (insn != 0x38000067)
        continue;
 
       /* Check for "sc".  */
-      insn = extract_unsigned_integer (buf + PPC_INSN_SIZE, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (buf + PPC_INSN_SIZE,
+                                      PPC_INSN_SIZE, byte_order);
       if (insn != 0x44000002)
        continue;
 
@@ -164,6 +168,7 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct trad_frame_cache *cache;
   CORE_ADDR addr, base, func;
   gdb_byte buf[PPC_INSN_SIZE];
@@ -184,7 +189,7 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
   /* Calculate the offset where we can find `struct sigcontext'.  We
      base our calculation on the amount of stack space reserved by the
      first instruction of the signal trampoline.  */
-  insn = extract_unsigned_integer (buf, PPC_INSN_SIZE);
+  insn = extract_unsigned_integer (buf, PPC_INSN_SIZE, byte_order);
   sigcontext_offset = (0x10000 - (insn & 0x0000ffff)) + 8;
 
   base = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch));
@@ -203,7 +208,7 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
   trad_frame_set_reg_addr (cache, tdep->ppc_ctr_regnum, addr);
   addr += tdep->wordsize;
   trad_frame_set_reg_addr (cache, gdbarch_pc_regnum (gdbarch), addr);
-  /* SRR0? */
+  /* SRR0?  */
   addr += tdep->wordsize;
 
   /* Construct the frame ID using the function start.  */
@@ -234,6 +239,7 @@ ppcobsd_sigtramp_frame_prev_register (struct frame_info *this_frame,
 
 static const struct frame_unwind ppcobsd_sigtramp_frame_unwind = {
   SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
   ppcobsd_sigtramp_frame_this_id,
   ppcobsd_sigtramp_frame_prev_register,
   NULL,
This page took 0.025642 seconds and 4 git commands to generate.