From: Daniel Jacobowitz <drow@false.org>
To: Michael Eager <eager@eagercon.com>
Cc: Jim Blandy <jimb@codesourcery.com>, gdb@sources.redhat.com
Subject: Re: GDB Documentation and Request for Help
Date: Fri, 30 Mar 2007 18:41:00 -0000 [thread overview]
Message-ID: <20070330184051.GA26862@caradoc.them.org> (raw)
In-Reply-To: <460D565F.3070307@eagercon.com>
On Fri, Mar 30, 2007 at 11:26:39AM -0700, Michael Eager wrote:
> Jim Blandy wrote:
> >If you post here, I think people would be happy to explain what's
> >current and what isn't. I'll watch for your messages.
> Thanks. I think that my questions are not very specific and
> it would be better to go through the Target Arch chapter
> and mark it up.
> But here goes: what did FRAME_INIT_SAVED get replaced by?
It got replaced by an entirely demand driven system. There's only two
entry points: this_id and prev_register. Every registered unwinder
provides both.
> Or, the much more general question: when the target hits a
> breakpoint, where are the registers read and how does the
> current frame get initialized with a frame pointer? (I've
> stepped thru normal_stop, and I know it must be somewhere
> nearby, but I've not found it.)
The old model required explicitly setting up the frame, but nowadays
that isn't true. What happens is that the frame cache is cleared by a
call to reinit_frame_cache. The next time someone says
get_current_frame (), they get two things:
- A sentinel frame at "level -1". This has no particularly useful
ID, and a prev_register method that reads from the current
register cache.
- An all new frame at level 0. This doesn't have an unwinder yet;
it's just a shell.
When you ask for a register belonging to the current frame, frame.c
goes up to the next frame (the sentinel frame) and uses its
prev_register method. When you ask for the current frame's ID, or
for something below it, then frame.c finds a registered unwinder that
knows how to handle that frame.
Usually this_id and prev_register share a common cache, and the first
time either of them is called they call a cache initialization
function which does whatever necessary. For instance, parsing the
prologue, or reading DWARF unwind tables.
(Of course, doing less work up front is OK too and that's something I
plan to look into - along with better caching. The whole
infrastructure is designed to be lightweight, but it isn't always.)
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-03-30 18:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-30 17:20 Michael Eager
2007-03-30 18:08 ` Jim Blandy
2007-03-30 18:27 ` Michael Eager
2007-03-30 18:41 ` Daniel Jacobowitz [this message]
2007-03-30 21:02 ` Jim Blandy
2007-03-30 21:14 ` Michael Eager
2007-03-31 8:29 ` Eli Zaretskii
2007-04-04 14:57 ` Dave Korn
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=20070330184051.GA26862@caradoc.them.org \
--to=drow@false.org \
--cc=eager@eagercon.com \
--cc=gdb@sources.redhat.com \
--cc=jimb@codesourcery.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