This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] Fix inferior memory reading in GDBServer for sparc.
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Date: Mon, 28 Nov 2016 07:27:58 -0500
- Subject: [PATCH 3/3] Fix inferior memory reading in GDBServer for sparc.
- Authentication-results: sourceware.org; auth=none
- References: <20161128122758.7762-1-antoine.tremblay@ericsson.com>
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(-)
diff --git a/gdb/gdbserver/linux-sparc-low.c b/gdb/gdbserver/linux-sparc-low.c
index 70c5c93..31ef791 100644
--- a/gdb/gdbserver/linux-sparc-low.c
+++ b/gdb/gdbserver/linux-sparc-low.c
@@ -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);
}
--
2.9.2