gdbserver: Prevent stale/random values in register cache
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 12 Dec 2014 13:14:20 +0000 (14:14 +0100)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 12 Dec 2014 13:15:07 +0000 (14:15 +0100)
commit098dbe61246fd65ea5e3825d77afb31d52c43153
tree23faf81574756f48e5d03eb92d7e3b7b52bf1744
parent28eef6727d3cd4461091a752c19c418d1bf3bcb7
gdbserver: Prevent stale/random values in register cache

When fetch_inferior_registers does not update all registers, this
patch assures that no stale register values remain in the register
cache.  On Linux platforms using the regsets interface, when one of
the ptrace calls used for fetching the register values returns an
error, this patch also avoids copying the random data returned from
ptrace into the register cache.  All unfetched registers are marked
"unavailable" instead.

gdb/gdbserver/ChangeLog:

* linux-low.c (regsets_fetch_inferior_registers): Do not invoke
the regset's store function when ptrace returned an error.
* regcache.c (get_thread_regcache): Invalidate register cache
before fetching inferior's registers.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/regcache.c
This page took 0.025808 seconds and 4 git commands to generate.