From: palves Date: Thu, 26 May 2011 13:57:43 +0000 (+0000) Subject: * alpha-tdep.c (alpha_cannot_fetch_register): Don't return true X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f45a84c785e7b9d2fa584a967ff1803e955b2a33;p=pf3gnuchains%2Fpf3gnuchains4x.git * alpha-tdep.c (alpha_cannot_fetch_register): Don't return true for ALPHA_ZERO_REGNUM. (alpha_supply_int_regs): Explicitly supply zero as the value for ALPHA_ZERO_REGNUM in the register cache. * alpha-nat.c (fetch_osf_core_registers): Ditto. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 678ed3b5a8..76c56ea73c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2011-05-26 Pedro Alves + + * alpha-tdep.c (alpha_cannot_fetch_register): Don't return true + for ALPHA_ZERO_REGNUM. + (alpha_supply_int_regs): Explicitly supply zero as the value for + ALPHA_ZERO_REGNUM in the register cache. + * alpha-nat.c (fetch_osf_core_registers): Ditto. + 2011-05-26 Yao Qi * gdb/gdb_thread_db.h: Remove HAVE_UINTPTR_T. diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index 1a55ea9dac..f548359c69 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -101,6 +101,15 @@ fetch_osf_core_registers (struct regcache *regcache, regcache_raw_supply (regcache, regno, NULL); continue; } + + if (regno == ALPHA_ZERO_REGNUM) + { + const gdb_byte zero[8] = { 0 }; + + regcache_raw_supply (regcache, regno, zero); + continue; + } + addr = 8 * core_reg_mapping[regno]; if (addr < 0 || addr >= core_reg_size) { diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 10e753b294..77782e8809 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -111,8 +111,7 @@ alpha_register_name (struct gdbarch *gdbarch, int regno) static int alpha_cannot_fetch_register (struct gdbarch *gdbarch, int regno) { - return (regno == ALPHA_ZERO_REGNUM - || strlen (alpha_register_name (gdbarch, regno)) == 0); + return (strlen (alpha_register_name (gdbarch, regno)) == 0); } static int @@ -1424,7 +1423,11 @@ alpha_supply_int_regs (struct regcache *regcache, int regno, regcache_raw_supply (regcache, i, regs + i * 8); if (regno == ALPHA_ZERO_REGNUM || regno == -1) - regcache_raw_supply (regcache, ALPHA_ZERO_REGNUM, NULL); + { + const gdb_byte zero[8] = { 0 }; + + regcache_raw_supply (regcache, ALPHA_ZERO_REGNUM, zero); + } if (regno == ALPHA_PC_REGNUM || regno == -1) regcache_raw_supply (regcache, ALPHA_PC_REGNUM, pc);