* [RFA] NetBSD, mipsnbsd-tdep.c supply_gregset 32/64
@ 2007-12-14 0:29 Michael Snyder
0 siblings, 0 replies; only message in thread
From: Michael Snyder @ 2007-12-14 0:29 UTC (permalink / raw)
To: gdb-patches; +Cc: uweigand, dueling
Similar to yesterday's patch, this one accounts for core files.
2007-12-13 Michael Snyder <msnyder@specifix.com>
* mipsnbsd-tdep.c (mipsnbsd_supply_gregset): Convert 32/64 bits,
for targets in which mips_abi_size != mips_isa_size.
Index: mipsnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsnbsd-tdep.c,v
retrieving revision 1.32
diff -u -p -r1.32 mipsnbsd-tdep.c
--- mipsnbsd-tdep.c 16 Nov 2007 04:56:45 -0000 1.32
+++ mipsnbsd-tdep.c 14 Dec 2007 00:22:43 -0000
@@ -81,22 +81,31 @@ mipsnbsd_supply_gregset (const struct re
struct regcache *regcache, int regnum,
const void *gregs, size_t len)
{
- size_t regsize = mips_isa_regsize (get_regcache_arch (regcache));
+ size_t abisize = mips_abi_regsize (get_regcache_arch (regcache));
const char *regs = gregs;
int i;
- gdb_assert (len >= MIPSNBSD_NUM_GREGS * regsize);
+ gdb_assert (len >= MIPSNBSD_NUM_GREGS * abisize);
- for (i = 0; i <= MIPS_PC_REGNUM; i++)
+ for (i = 0; i <= MIPSFBSD_NUM_GREGS; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * regsize);
+ {
+ size_t isasize = register_size (current_gdbarch, i);
+ void *addr = regs + i * abisize;
+ gdb_byte buf[MAX_REGISTER_SIZE];
+ LONGEST val;
+
+ val = extract_signed_integer (addr, abisize);
+ store_signed_integer (buf, isasize, val);
+ regcache_raw_supply (regcache, i, buf);
+ }
}
- if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * regsize)
+ if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * abisize)
{
- regs += MIPSNBSD_NUM_GREGS * regsize;
- len -= MIPSNBSD_NUM_GREGS * regsize;
+ regs += MIPSNBSD_NUM_GREGS * abisize;
+ len -= MIPSNBSD_NUM_GREGS * abisize;
mipsnbsd_supply_fpregset (regset, regcache, regnum, regs, len);
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-14 0:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14 0:29 [RFA] NetBSD, mipsnbsd-tdep.c supply_gregset 32/64 Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox