Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gdb/dist/gdb Supply MIPS_ZERO_REGNUM and MIPS_...
details: https://anonhg.NetBSD.org/src/rev/6d9d5da7c2df
branches: trunk
changeset: 782460:6d9d5da7c2df
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Nov 03 15:06:55 2012 +0000
description:
Supply MIPS_ZERO_REGNUM and MIPS_UNUSED_REGNUM (as zero). Idea stolen from
mips-linux-tdep.c
diffstat:
external/gpl3/gdb/dist/gdb/mipsnbsd-tdep.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (48 lines):
diff -r 8a50b7f15c4b -r 6d9d5da7c2df external/gpl3/gdb/dist/gdb/mipsnbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/mipsnbsd-tdep.c Sat Nov 03 14:59:44 2012 +0000
+++ b/external/gpl3/gdb/dist/gdb/mipsnbsd-tdep.c Sat Nov 03 15:06:55 2012 +0000
@@ -83,15 +83,23 @@
const void *gregs, size_t len)
{
size_t regsize = mips_isa_regsize (get_regcache_arch (regcache));
+ char zerobuf[MAX_REGISTER_SIZE];
const char *regs = gregs;
int i;
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
+
gdb_assert (len >= MIPSNBSD_NUM_GREGS * regsize);
for (i = 0; i <= MIPS_PC_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * regsize);
+ {
+ if (i == MIPS_ZERO_REGNUM || i == MIPS_UNUSED_REGNUM)
+ regcache_raw_supply (regcache, i, zerobuf);
+ else
+ regcache_raw_supply (regcache, i, regs + i * regsize);
+ }
}
if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * regsize)
@@ -144,13 +152,18 @@
mipsnbsd_supply_reg (struct regcache *regcache, const char *regs, int regno)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ char zerobuf[MAX_REGISTER_SIZE];
int i;
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
+
for (i = 0; i <= gdbarch_pc_regnum (gdbarch); i++)
{
if (regno == i || regno == -1)
{
- if (gdbarch_cannot_fetch_register (gdbarch, i))
+ if (i == MIPS_ZERO_REGNUM || i == MIPS_UNUSED_REGNUM)
+ regcache_raw_supply (regcache, i, zerobuf);
+ else if (gdbarch_cannot_fetch_register (gdbarch, i))
regcache_raw_supply (regcache, i, NULL);
else
regcache_raw_supply (regcache, i,
Home |
Main Index |
Thread Index |
Old Index