]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/sparc64-linux-tdep.c
* defs.h (extract_signed_integer, extract_unsigned_integer,
[thirdparty/binutils-gdb.git] / gdb / sparc64-linux-tdep.c
index 05218e117c909425300ed06f5034ad29c998e339..965904ef82ea0b36fcb744b4e129739237d4c195 100644 (file)
@@ -1,6 +1,7 @@
 /* Target-dependent code for GNU/Linux UltraSPARC.
 
-   Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -108,6 +109,9 @@ sparc64_linux_step_trap (struct frame_info *frame, unsigned long insn)
 {
   if (insn == 0x91d0206d)
     {
+      struct gdbarch *gdbarch = get_frame_arch (frame);
+      enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
       ULONGEST sp = get_frame_register_unsigned (frame, SPARC_SP_REGNUM);
       if (sp & 1)
        sp += BIAS;
@@ -121,7 +125,8 @@ sparc64_linux_step_trap (struct frame_info *frame, unsigned long insn)
         register save area.  The saved PC sits at a 136 byte offset
         into there.  */
 
-      return read_memory_unsigned_integer (sp + 192 + 128 + 136, 8);
+      return read_memory_unsigned_integer (sp + 192 + 128 + 136,
+                                          8, byte_order);
     }
 
   return 0;