[libcxx-commits] [PATCH] D90898: [libunwind] Unwind through aarch64/Linux sigreturn frame

Saleem Abdulrasool via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 6 09:14:20 PST 2020


compnerd added a comment.

Could you add a bit of a comment explaining why the XOM case is not protected against?  libunwind can be used for generating backtraces during regular execution (e.g. profiling) and crashing if the XOM is in use seems unfortunate.  We could check the memory mapping and just give up in the XOM case.



================
Comment at: libunwind/include/__libunwind_config.h:31
+# if defined(__linux__)
+#  define _LIBUNWIND_TARGET_LINUX 1
+# endif
----------------
What do you think of having an else clause which sets this to 0 to allow using the macro as a condition rather than checking the definedness of it?


================
Comment at: libunwind/src/UnwindCursor.hpp:940
+  template <typename R2> bool setInfoForSigReturn(R2 &) { return false; }
+  template <typename R2> int stepThroughSigReturn(R2 &) { return UNW_STEP_END; }
+#endif
----------------
What do you think of `Registers` instead of `R2`?


================
Comment at: libunwind/src/UnwindCursor.hpp:2016
+  // Look for instructions: mov x8, #0x8b; svc #0x0
+  if (_addressSpace.get32(pc) == 0xd2801168 &&
+      _addressSpace.get32(pc + 4) == 0xd4000001) {
----------------
It really would be amazing to have a link to the VDSO code here to make it easier to understand the check - I figured it was that this is the implementation, but had to chase through the files.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90898



More information about the libcxx-commits mailing list