From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: Should we be able to read simulator memory immediately after a "load" command?
Date: Tue, 29 Jun 2010 00:46:00 -0000 [thread overview]
Message-ID: <20100628174643.1552caea@mesquite.lan> (raw)
In-Reply-To: <4C2936C8.8010002@vmware.com>
On Mon, 28 Jun 2010 16:56:56 -0700
Michael Snyder <msnyder@vmware.com> wrote:
> Kevin Buettner wrote:
> > On Mon, 28 Jun 2010 15:25:00 -0700
> > Michael Snyder <msnyder@vmware.com> wrote:
> >
> >> Hmm, should we substitute "target_has_memory"?
> >>
> >> Is that set to TRUE after a load?
> >
> > If default_child_has_memory() is used, which is currently the case for
> > the remote-sim target, it will not return TRUE after a "load", but
> > before a "run".
>
> Hmmm. That sucks. ;-)
In my opinion, the check in question can simply be removed. See below.
Note that should the attempted memory read fail and return 0 bytes,
the next target down the target stack will be consulted. (That's true
though only so long as it's not running. Once it's running, then
memory accesses are restricted to the current target. To see why this
is so, examine the code around the to_has_all_memory() check in
memory_xfer_partial().)
* remote-sim.c (gdbsim_xfer_inferior_memory): Allow access
to simulator once the program has been loaded, though not
necessarily running.
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.96
diff -u -p -r1.96 remote-sim.c
--- remote-sim.c 16 May 2010 21:11:14 -0000 1.96
+++ remote-sim.c 29 Jun 2010 00:32:25 -0000
@@ -764,12 +764,6 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
- /* If no program is running yet, then ignore the simulator for
- memory. Pass the request down to the next target, hopefully
- an exec file. */
- if (!target_has_execution)
- return 0;
-
if (!program_loaded)
error (_("No program loaded."));
next prev parent reply other threads:[~2010-06-29 0:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 20:00 Kevin Buettner
2010-06-28 22:25 ` Michael Snyder
2010-06-28 23:55 ` Kevin Buettner
2010-06-28 23:57 ` Michael Snyder
2010-06-29 0:46 ` Kevin Buettner [this message]
2010-06-28 22:28 ` Mike Frysinger
2010-06-29 19:56 ` Daniel Jacobowitz
2010-07-02 16:46 ` Kevin Buettner
2010-07-02 23:14 ` Kevin Buettner
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=20100628174643.1552caea@mesquite.lan \
--to=kevinb@redhat.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