[PATCH] D100132: [libunwind][AIX] Initial patch of the unwinder on AIX
Sean Fertile via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 11 08:16:04 PDT 2021
sfertile added inline comments.
================
Comment at: libunwind/src/AddressSpace.hpp:599
-
inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {
----------------
minor nit: whitespace change.
================
Comment at: libunwind/src/UnwindCursor.hpp:2020
+ // Must find the correct frame pointer register
+ if (TBTable->tb.name_present) {
+ const uint16_t name_len = *((uint16_t *)p);
----------------
minot nit: I think its cleaner to pull this out of the if block and increment past the name whether we need to or not.
================
Comment at: libunwind/src/UnwindCursor.hpp:2061
+ if (stateTablePersonality == NULL) {
+ _LIBUNWIND_TRACE_UNWINDING("dlsym() failed with errno=%d\n", errno);
+ }
----------------
Should failing to load the library, or failing to resolve `__xlcxx_personality_v0` be a fatal failure?
================
Comment at: libunwind/src/UnwindCursor.hpp:2105
+ assert(*(uint32_t *)ehInfo == 0 &&
+ "XLC++ EH: ehInfo version other than 0 is not supported");
+
----------------
This is the EH implementation for both new XLC++ and clang so we should drop the `XLC++` from the assert message.
================
Comment at: libunwind/src/UnwindCursor.hpp:2349
+ // of a function on AIX.
+ pc -= 4;
+#else
----------------
Do we need this on AIX? I think we have 2 cases that could happen when we throw as the last instruction in a function and I don't think we need to backtrack the instruction pointer in either. The first case is a normal call to __cxa_throw, the call instruction will be followed by a toc-restore which is what the program counter will be pointing at. The second case is a call to _cxa_throw with no toc-restore, which might come up if we _cxa_throw is statically linked in and we use LTO or the call is written in asm, but in this case the program counter will be pointing to the word after the call instruction which is the zero word we are looking for (so no need to backtrack).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100132/new/
https://reviews.llvm.org/D100132
More information about the llvm-commits
mailing list