public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Why do we have two ways of finding sniffers?
@ 2005-10-20  0:18 Jim Blandy
  2005-10-20  0:25 ` Jim Blandy
  2005-10-20  8:46 ` Mark Kettenis
  0 siblings, 2 replies; 4+ messages in thread
From: Jim Blandy @ 2005-10-20  0:18 UTC (permalink / raw)
  To: gdb


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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why do we have two ways of finding sniffers?
  2005-10-20  0:18 Why do we have two ways of finding sniffers? Jim Blandy
@ 2005-10-20  0:25 ` Jim Blandy
  2005-10-20  8:46 ` Mark Kettenis
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Blandy @ 2005-10-20  0:25 UTC (permalink / raw)
  To: gdb


Jim Blandy <jimb@redhat.com> writes:
> 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?

I guess we'd also need a void * passed through to the function, to
support things like tramp_frame_prepend_unwinder.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why do we have two ways of finding sniffers?
  2005-10-20  0:18 Why do we have two ways of finding sniffers? Jim Blandy
  2005-10-20  0:25 ` Jim Blandy
@ 2005-10-20  8:46 ` Mark Kettenis
  2005-10-22  1:20   ` Jim Blandy
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2005-10-20  8:46 UTC (permalink / raw)
  To: jimb; +Cc: gdb

> From: Jim Blandy <jimb@redhat.com>
> Date: Wed, 19 Oct 2005 17:16:46 -0700
> 
> 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?

I don't think there is a *technical* reason why we need both
alternatives.  It's more a matter that we had (and still have to some
extent) a pretty long list of basically unmainted targets.  So
converting frame_unwind_append_sniffer() into
frame_unwind_append_unwinder() is difficult to accomplish.  But you
should really answer Andrew about this since he wrote that code.

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why do we have two ways of finding sniffers?
  2005-10-20  8:46 ` Mark Kettenis
@ 2005-10-22  1:20   ` Jim Blandy
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Blandy @ 2005-10-22  1:20 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb


Mark Kettenis <mark.kettenis@xs4all.nl> writes:
>> From: Jim Blandy <jimb@redhat.com>
>> Date: Wed, 19 Oct 2005 17:16:46 -0700
>> 
>> 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?
>
> I don't think there is a *technical* reason why we need both
> alternatives.  It's more a matter that we had (and still have to some
> extent) a pretty long list of basically unmainted targets.  So
> converting frame_unwind_append_sniffer() into
> frame_unwind_append_unwinder() is difficult to accomplish.  But you
> should really answer Andrew about this since he wrote that code.

Okay.  I figured all the frame-unwind.c code was relatively new, so
diversity was probably deliberate.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-22  1:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-20  0:18 Why do we have two ways of finding sniffers? Jim Blandy
2005-10-20  0:25 ` Jim Blandy
2005-10-20  8:46 ` Mark Kettenis
2005-10-22  1:20   ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).