[libcxx-commits] [PATCH] D126869: [libunwind] Don't store a predecremented PC when using SEH

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 6 13:11:50 PDT 2022


mstorsjo added a comment.

In D126869#3559075 <https://reviews.llvm.org/D126869#3559075>, @MaskRay wrote:

> I don't have an environment to verify and don't know much about SEH, but I assume that this is similar to `UnwindCursor<A, R>::setInfoBasedOnIPRegister` and you or @cdavis5x has verified the correctness.

Yeah I've tested it as far as I can, and @cdavis5x was the one who implemented the SEH parts in libunwind originally.

>>> When libcxxabi looks for call site ranges, it already does _Unwind_GetIP(context) - 1 (in scan_eh_tab in libcxxabi/src/cxa_personality.cpp) we shouldn't do the corresponding - 1 multiple times.
>
> libgcc `_Unwind_GetIPInfo` sets ip_before_insn to 0 so libsupc++ from libstdc++ does an the `- 1` subtraction. I assume that libc++abi is similar.

Thanks for the further context on that issue! Yeah, although libc++abi doesn't call such a function, but seems to unconditionally do the `-1` subtraction. libunwind's `_Unwind_GetIPInfo` uses `UnwindCursor::isSignalFrame()`, and the SEH version of that always returns false currently. So this makes those things more consistent too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126869



More information about the libcxx-commits mailing list