From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: [PATCH 3/3] Fix inferior memory reading in GDBServer for sparc.
Date: Mon, 28 Nov 2016 12:28:00 -0000 [thread overview]
Message-ID: <20161128122758.7762-3-antoine.tremblay@ericsson.com> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2016-11-28 12:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 12:28 [PATCH 1/3] Fix inferior memory reading in GDBServer for arm/aarch32 Antoine Tremblay
2016-11-28 12:28 ` Antoine Tremblay [this message]
2016-12-09 12:51 ` [PATCH 3/3] Fix inferior memory reading in GDBServer for sparc Antoine Tremblay
2016-11-28 12:28 ` [PATCH 2/3] Fix inferior memory reading in GDBServer for ppc Antoine Tremblay
2016-11-30 20:46 ` [PATCH 1/3] Fix inferior memory reading in GDBServer for arm/aarch32 Luis Machado
2016-12-01 14:44 ` Yao Qi
2016-12-01 15:28 ` Antoine Tremblay
2016-12-01 15:55 ` Antoine Tremblay
2016-12-01 16:18 ` Antoine Tremblay
2016-12-01 18:10 ` Antoine Tremblay
2016-12-09 12:06 ` Yao Qi
2016-12-09 12:22 ` [PATCH v2] " Antoine Tremblay
2016-12-09 12:23 ` [PATCH 1/3] " Yao Qi
2016-12-09 12:46 ` [PATCH v3] " Antoine Tremblay
2017-01-09 11:55 ` Antoine Tremblay
2017-01-09 17:31 ` Yao Qi
2017-01-09 17:41 ` Antoine Tremblay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161128122758.7762-3-antoine.tremblay@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox