From: Jim Blandy <jimb@redhat.com>
To: gdb@sourceware.org
Subject: Why do we have two ways of finding sniffers?
Date: Thu, 20 Oct 2005 00:18:00 -0000 [thread overview]
Message-ID: <vt2slux2gb5.fsf@theseus.home.> (raw)
Looking at frame-unwind.c and frame-unwind.h, it seems like there are
two mostly equivalent ways to register frame unwinding methods. Why
do we have two ways, instead of just one? The comments in
frame-unwind.h don't really explain why it's helpful.
The only function that scans the list of unwinders is
frame_unwind_by_frame: it takes a NEXT frame, and returns a 'struct
frame_unwind *' if it can find one.
It works by walking the NEXT frame's gdbarch's list of frame
unwinders. Each entry in the list is one of two possible kinds:
- If the entry points to a frame_unwind_sniffer_ftype function, that
takes the next frame's frame_info; if it likes it, then it returns a
'struct frame_unwind *' to use for this frame.
- If the entry points to a 'struct frame_unwind' object, that contains
its own sniffer, which takes a pointer to the 'struct frame_unwind',
the next frame's frame_info, and a prologue cache, and just returns
a boolean indicating whether this is an appropriate frame_unwind for
it.
I don't understand why we need both alternatives. Shouldn't it be
sufficient to simply have each entry in the list point to a function
that expects the next frame's frame_info and a prologue cache, and
returns a 'struct frame_unwind *' or zero?
next reply other threads:[~2005-10-20 0:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-20 0:18 Jim Blandy [this message]
2005-10-20 0:25 ` Jim Blandy
2005-10-20 8:46 ` Mark Kettenis
2005-10-22 1:20 ` Jim Blandy
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=vt2slux2gb5.fsf@theseus.home. \
--to=jimb@redhat.com \
--cc=gdb@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