diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0fb6602c32..0b3f886a3e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-03-28 Joel Brobecker + + * ia64-linux-nat.c (ia64_linux_fetch_register): Add special + handling for r0. + 2012-03-27 Pedro Alves Eliminate struct ui_stream. diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 19b827f84a..60b873be38 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -680,6 +680,16 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum) PTRACE_TYPE_RET *buf; int pid, i; + /* r0 cannot be fetched but is always zero. */ + if (regnum == IA64_GR0_REGNUM) + { + const gdb_byte zero[8] = { 0 }; + + gdb_assert (sizeof (zero) == register_size (gdbarch, regnum)); + regcache_raw_supply (regcache, regnum, zero); + return; + } + if (ia64_cannot_fetch_register (gdbarch, regnum)) { regcache_raw_supply (regcache, regnum, NULL);