[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libunwind] Unwinding using the context passed to a signal handler (

From: David Mosberger
Subject: Re: [libunwind] Unwinding using the context passed to a signal handler (doesn't work)
Date: Fri, 26 Mar 2004 13:20:49 -0800

>>>>> On Fri, 26 Mar 2004 11:03:13 -0800, "Young, Mark" <address@hidden> said:

  Mark> David, Do all platforms make the same distinction between
  Mark> asynchronous (signal) and synchronous contexts?

Most platforms store the entire machine-state in a sigcontext.
Most platforms do not have 256+ registers to deal with.

  Mark> I like Johan's suggestion of an alternate unw_init_local
  Mark> interface (unw_init_from_signal_context_local) that takes the
  Mark> signal context as the starting point.

And I don't like it at all, because it won't work anyhow _unless_ you
first save the preserved state.  And if you have to do that anyhow,
unw_getcontext() is just as fast and much cleaner.

  Mark> From what you are saying, an ia64 implementation of this would
  Mark> have to ignore the signal context, call getcontext, and unwind
  Mark> until it found the signal frame.

It doesn't ignore the signal context, it's just that you start with
the preserved state returned by unw_getcontext() and then the
sigcontext() gets picked up later on.

  Mark> But is that true for all platforms?

No, but I certainly don't want to design an API that _requires_ saving
the full machine-state in sigcontext.

I find it kind of funny how we all claim to be after performance, but
then I get complaints about the key optimization that makes
signal-delivery fast on ia64 linux (in fact, comparable or even faster
than on x86 linux, which I think is quite an achievement considering
how much bigger the machine state is for ia64).  If you don't believe
me, try measuring signal delivery overhead on some other ia64 OSes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]