[3/3] Fix inferior memory reading in GDBServer for sparc.
Commit Message
Before this patch, sparc_store_gregset_from_stack would read the inferior
memory with (*the_target)->read_memory, which returns the raw memory,
rather than the shadowed memory.
This is wrong since this function does not expect to read a breakpoint
instruction and can lead to invalid behavior.
Note I could not test or build this patch.
gdb/gdbserver/ChangeLog:
* linux-sparc-low.c (sparc_store_gregset_from_stack): Use target_read_memory.
---
gdb/gdbserver/linux-sparc-low.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Antoine Tremblay writes:
> Before this patch, sparc_store_gregset_from_stack would read the inferior
> memory with (*the_target)->read_memory, which returns the raw memory,
> rather than the shadowed memory.
I'm pulling back this patch as the read is done from the stack so using
->read_memory is ok.
Thanks,
Antoine
@@ -184,7 +184,7 @@ sparc_store_gregset_from_stack (struct regcache *regcache, const void *buf)
for (i = l0_regno; i <= i7_regno; i++)
{
- (*the_target->read_memory) (addr, tmp_reg_buf, sizeof (tmp_reg_buf));
+ target_read_memory (addr, tmp_reg_buf, sizeof (tmp_reg_buf));
supply_register (regcache, i, tmp_reg_buf);
addr += sizeof (tmp_reg_buf);
}