lhames added a comment.

@joerg, @emaste -- I finally got a chance to experiment with a Linux docker 
container and confirmed that libgcc_s's `__register_frame` can handle 
individual frames. Unfortunately that does not help us on FreeBSD.

If we ignore FreeBSD for a moment we could imagine switch to registering single 
frames everywhere, but this would be an unrecoverable performance regression on 
Linux -- we would necessarily have to walk all CFI entries in the section to 
use the API.

One possible alternative solution would be to update libunwind's 
__register_ehframe function to also accept whole sections the same way libgcc_s 
does, but I don't think this is a good solution: We'd be overloading the 
behavior in a surprising way to match a libgcc_s behavior that doesn't seem 
well-documented, and we'd still be left needing some other way to detect 
whether the current unwinder supported the desired semantics.

I think the ideal solution would be to always pass in whole sections, as 
@housel's proposed solution does.

I think we can debate the right API signature (e.g. should it pass the section 
range so that we really can skip walking the CFI records, or is this cheap 
enough not to bother?), function name, and implementation, but does anyone have 
any objection to the direction? If so, why?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111863

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to