[PATCH] D142176: [libunwind] On Darwin, add a callback-based lookup scheme for JIT'd unwind info.

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 13:17:48 PST 2023


lhames marked an inline comment as done.
lhames added a comment.

In D142176#4069579 <https://reviews.llvm.org/D142176#4069579>, @benlangmuir wrote:

> I'm not that familiar with development practices for libunwind, but is possible to write a test for this?

libunwind doesn't have tests for the JIT registration paths -- to exercise them it would need a way to produce executable code with valid headers and unwind info that was outside any range known to the system loader.

I think we're better off testing this in the ORC runtime -- we could have tests that look for the new registration paths and then verify that they're used.



================
Comment at: libunwind/src/libunwind_ext.h:76
+// registrations.
+extern int __unw_add_find_dynamic_unwind_sections(
+    unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
----------------
benlangmuir wrote:
> Would be nice to have doc comments for this; maybe just a lightly edited version of this paragraph from your description?
> 
> > These can be used to register (and deregister) callbacks that have a similar
> > signature to _dyld_find_unwind_sections. During unwinding, if
> > _dyld_find_unwind_sections returns false (indicating that no frame info
> > was found by dyld) then registered callbacks are run in registration order until
> > either the unwind info is found or the end of the list is reached.
Yep -- good idea. I've included more detailed comments in the latest diff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142176/new/

https://reviews.llvm.org/D142176



More information about the llvm-commits mailing list