ld-elf/ehdr_start.d (target): Add *-*-nacl*.
[deliverable/binutils-gdb.git] / gdb / i386obsd-nat.c
index d2dac03b5dd1bd267796a467b14e29672b95a1de..e64c587d8f66767f35c0b301ea15312d579e7659 100644 (file)
@@ -1,7 +1,6 @@
 /* Native-dependent code for OpenBSD/i386.
 
-   Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -35,6 +34,8 @@
 static int
 i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct switchframe sf;
 
   /* The following is true for OpenBSD 3.6:
@@ -76,8 +77,8 @@ i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
     {
       /* No, the pcb must have been last updated by savectx().  */
       pcb->pcb_esp = pcb->pcb_ebp;
-      pcb->pcb_ebp = read_memory_integer(pcb->pcb_esp, 4);
-      sf.sf_eip = read_memory_integer(pcb->pcb_esp + 4, 4);
+      pcb->pcb_ebp = read_memory_integer(pcb->pcb_esp, 4, byte_order);
+      sf.sf_eip = read_memory_integer(pcb->pcb_esp + 4, 4, byte_order);
       regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
     }
 
This page took 0.024475 seconds and 4 git commands to generate.