Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Jim Blandy" <jimb@red-bean.com>
To: "Joel Brobecker" <brobecker@adacore.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFC] problem fetching inferior memory due to breakpoint
Date: Thu, 27 Apr 2006 00:53:00 -0000	[thread overview]
Message-ID: <8f2776cb0604261753p1cfe60d7qd3972811e210a426@mail.gmail.com> (raw)
In-Reply-To: <20060426191946.GA28844@nevyn.them.org>

On 4/26/06, Daniel Jacobowitz <drow@false.org> wrote:
> Try safe_frame_unwind_memory, the other caller of
> deprecated_read_memory_nobpt.  Many other prologue analyzers already
> seem to use that.

Prologue analyzers get called in two contexts, though: from the
skip_prologue gdbarch method, and from the frame unwinding stuff.  In
the former case, there's no frame at hand to use; there may not even
be a program running, if the user is setting breakpoints before doing
a 'run'.  I'm happy to pass a frame to my analyzer, use
safe_frame_unwind_memory when it's non-null, and target_read_memory
when it's null, but this seems klunky.

The whole reason safe_frame_unwind_memory takes a frame argument at
all is that, in the future (at present it ignores its frame argument)
the frame will identify which process/address space to read.  But
using frames for this isn't good enough, because, as skip_prologue
shows, we also need to be able to read memory when there are no frames
present.

Some of this was discussed here:
http://sourceware.org/ml/gdb/2005-11/msg00628.html

Ideally, the arch's skip_prologue function would take, in addition to
a CORE_ADDR, one of my imaginary address space objects.  Or, CORE_ADDR
would become a struct carrying an address space object and an offset
within that address space.  Then the CORE_ADDR alone would be enough
to do the read.  You could have address space objects representing the
memory loaded by a shared library, or sections of a relocatable
object, as well as live processes' address spaces.

If GDB were written in C++, we could overload +, -, etc. on CORE_ADDR
and write trim source for bloated object code... but my floor time is
up, and I defer to my esteemed (and more practical-minded) colleagues.


  parent reply	other threads:[~2006-04-27  0:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-26 19:05 Joel Brobecker
2006-04-26 19:19 ` Daniel Jacobowitz
2006-04-26 21:18   ` Joel Brobecker
2006-04-26 21:39     ` Daniel Jacobowitz
2006-04-26 22:18       ` Joel Brobecker
2006-04-26 22:29         ` Daniel Jacobowitz
2006-04-26 23:33           ` Michael Snyder
2006-04-27  0:42             ` Daniel Jacobowitz
2006-04-27  1:37               ` Michael Snyder
2006-04-27  2:10                 ` Daniel Jacobowitz
2006-04-27  0:53   ` Jim Blandy [this message]
2006-04-27 20:28 ` Eli Zaretskii
2006-04-27 20:56   ` Joel Brobecker
2006-04-28  5:12     ` Eli Zaretskii
2006-04-28 17:00       ` Joel Brobecker
2006-04-28 17:45         ` Daniel Jacobowitz
2006-04-29 14:14         ` Eli Zaretskii
2006-04-29 14:20           ` Daniel Jacobowitz
2006-04-29 14:48             ` Eli Zaretskii
2006-04-29 15:06               ` Daniel Jacobowitz
2006-04-29 15:18                 ` Daniel Jacobowitz
2006-04-29 17:10                 ` Eli Zaretskii
2006-04-29 14:14         ` Eli Zaretskii

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=8f2776cb0604261753p1cfe60d7qd3972811e210a426@mail.gmail.com \
    --to=jimb@red-bean.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.com \
    /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