diff options
author | Pedro Alves <palves@redhat.com> | 2012-03-28 17:50:17 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-03-28 17:50:17 +0000 |
commit | ca9b8b9ce80fad94ebfbbe5c2743764868c031eb (patch) | |
tree | 38c9dfa93681bdebd3f30255f55346cb481d8608 | |
parent | cc0265cdda9dc7e8665e8bfcf5b4477489daf27c (diff) | |
download | gdb-ca9b8b9ce80fad94ebfbbe5c2743764868c031eb.zip gdb-ca9b8b9ce80fad94ebfbbe5c2743764868c031eb.tar.gz gdb-ca9b8b9ce80fad94ebfbbe5c2743764868c031eb.tar.bz2 |
2012-03-28 Pedro Alves <palves@redhat.com>
* ia64-linux-nat.c (supply_fpregset, ia64_linux_fetch_register):
Always supply $fr0 as 0.0 and $fr1 as 1.0.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ia64-linux-nat.c | 35 |
2 files changed, 39 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2e6c8c9..d055d38 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-03-28 Pedro Alves <palves@redhat.com> + + * ia64-linux-nat.c (supply_fpregset, ia64_linux_fetch_register): + Always supply $fr0 as 0.0 and $fr1 as 1.0. + 2012-03-28 Tom Tromey <tromey@redhat.com> * python/py-inferior.c (infpy_read_memory): Remove cleanups and diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 24bde2d..237f2c7 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -447,8 +447,20 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) { int regi; const char *from; + const gdb_byte f_zero[16] = { 0 }; + const gdb_byte f_one[16] = + { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 }; - for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++) + /* Kernel generated cores have fr1==0 instead of 1.0. Older GDBs + did the same. So ignore whatever might be recorded in fpregset_t + for fr0/fr1 and always supply their expected values. */ + + /* fr0 is always read as zero. */ + regcache_raw_supply (regcache, IA64_FR0_REGNUM, f_zero); + /* fr1 is always read as one (1.0). */ + regcache_raw_supply (regcache, IA64_FR1_REGNUM, f_one); + + for (regi = IA64_FR2_REGNUM; regi <= IA64_FR127_REGNUM; regi++) { from = (const char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]); regcache_raw_supply (regcache, regi, from); @@ -690,6 +702,27 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum) return; } + /* fr0 cannot be fetched but is always zero. */ + if (regnum == IA64_FR0_REGNUM) + { + const gdb_byte f_zero[16] = { 0 }; + + gdb_assert (sizeof (f_zero) == register_size (gdbarch, regnum)); + regcache_raw_supply (regcache, regnum, f_zero); + return; + } + + /* fr1 cannot be fetched but is always one (1.0). */ + if (regnum == IA64_FR1_REGNUM) + { + const gdb_byte f_one[16] = + { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 }; + + gdb_assert (sizeof (f_one) == register_size (gdbarch, regnum)); + regcache_raw_supply (regcache, regnum, f_one); + return; + } + if (ia64_cannot_fetch_register (gdbarch, regnum)) { regcache_raw_supply (regcache, regnum, NULL); |