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: Fri, 02 Jul 2010 16:46:00 -0000 [thread overview]
Message-ID: <20100702094621.757698c1@mesquite.lan> (raw)
In-Reply-To: <20100629195600.GA17949@caradoc.them.org>
On Tue, 29 Jun 2010 15:56:03 -0400
Daniel Jacobowitz <dan@codesourcery.com> wrote:
> On Mon, Jun 28, 2010 at 01:00:10PM -0700, Kevin Buettner wrote:
> > This code was added in a patch from 2006. See:
> >
> > http://sourceware.org/ml/gdb-patches/2006-10/msg00042.html
> >
> > In that posting, Daniel provides a good rationale for that patch as a
> > whole, but I did not see any discussion of the portion affecting
> > gdbsim_xfer_inferior_memory().
>
> I'm just guessing, but my guess is that removing the check breaks
> reading memory between "tar sim" and "load", and previously we would
> have read from the executable file.
Yes, that makes sense.
> If I bothered to make the change it was probably because of the
> testsuite...
My own testing showed some regressions using that simple patch
that I posted earlier. To that patch I added sim specific
`has_memory' and `has_all_memory' methods which simply return
true when `program_loaded' is true. I also took Michael's advice
and changed the test in gdbsim_xfer_inferior_memory to instead
call `to_has_memory'.
This worked great but for two regressions in gdb.base/multi.exp. The
problem was that `program_loaded' was a global and needed to be turned
into a per-inferior instance variable. I did a bit more work to fix
those regressions and now have a patch which allows us to have
multiple simulator instances. It only works for certain simulators.
E.g. mips and frv work, but powerpc and arm do not. v850 should
work, but doesn't for some reason. (My guess is that there's an
inadvertent global lurking in the v850 sim code somewhere.) I know
without trying them that rx and m32c will also not support multiple
instances. I haven't looked closely at the others yet.
I'll post it as a two-parter, the first part moves the static globals
into a per-inferior struct and makes the necessary adjustments to the
code. The second part will add `has_memory' and `has_all_memory'
methods in addition to adjusting gdbsim_xfer_inferior_memory(), thus
fixing the problem that lead me down this path at the outset.
Kevin
next prev parent reply other threads:[~2010-07-02 16: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
2010-06-28 22:28 ` Mike Frysinger
2010-06-29 19:56 ` Daniel Jacobowitz
2010-07-02 16:46 ` Kevin Buettner [this message]
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=20100702094621.757698c1@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