libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] suggest adding unw_init_local_accessors


From: David Mosberger
Subject: Re: [libunwind] suggest adding unw_init_local_accessors
Date: Fri, 6 Dec 2002 16:38:50 -0800

>>>>> On Fri, 06 Dec 2002 16:31:32 -0800, Mark Young <address@hidden> said:

  Mark> Consider pushing the unwind info cache search and insertion
  Mark> responsibility down inside the find_proc_info accessor
  Mark> function.

That's the way it works already.  Since I introduced the
find_proc_info() callback, libunwind no longer caches unwind tables.
It still caches unwind scripts, but only if the caching-policy allows
it (by default, caching is turned on for local unwinding).

  Mark> The address space creator could then choose an appropriate
  Mark> policy, perhaps using utility routines exported by libunwind
  Mark> to manage a cache if desired. In my case, since the dynamic
  Mark> procedure address map and unwind info can be maintained
  Mark> outside libunwind, I could define an address space and
  Mark> find_proc_info accessor function to fill in the proc_info
  Mark> structure for ip addresses in dynamic procedures. For other ip
  Mark> addresses, I could simply call the find_proc_info function
  Mark> associated with unw_local_addr_space and allow libunwind to
  Mark> follow its default caching policy for non-dynamic procedures.

It's fine if you want to do this for good performance, but for
_correctness_ we also need a simple linked list of all dynamic
procedures.  Otherwise, a debugger or a performance tool has no hope
of being able to get a complete backtrace.  Note that the dynamic
unwind list is purposely kept simple---lookup is relatively slow
(O(N)), so that insertion and removal can be fast (O(1)).

Wouldn't it be nice, e.g., if in gdb, you could do "bt" and get a
complete backtrace including all the dynamically generated routines?

        --david


reply via email to

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