X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fi386obsd-nat.c;h=00a13cce92aa8e338dfca07cf952c7461f5ef9cb;hb=e17a4113357102b55cfa5b80557d590a46a43300;hp=1585efb94ba220f8207a010d5842fbcdbc03c6b7;hpb=f73a15e424e2c7de26a8481e608a1785a21295d9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c index 1585efb94b..00a13cce92 100644 --- a/gdb/i386obsd-nat.c +++ b/gdb/i386obsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for OpenBSD/i386. - Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 + Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GDB. @@ -35,6 +35,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,9 +78,9 @@ 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); - regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf); + 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); } regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);