[PATCH] D143607: [Support][WIP] Add unit test for symbolized stack traces

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 15:15:35 PST 2023


luismarques added inline comments.


================
Comment at: llvm/unittests/Support/CrashRecoveryTest.cpp:118-120
+#if defined(HAVE_BACKTRACE) && ENABLE_BACKTRACES && HAVE_LINK_H &&             \
+    (defined(__linux__) || defined(__FreeBSD__) ||                             \
+     defined(__FreeBSD_kernel__) || defined(__NetBSD__))
----------------
dblaikie wrote:
> Presumably the condition is more than the "can we do backtraces" condition - but can we do /symbolized/ backtraces, which means testing for whether this is built with debug info, but I'm not sure if we have a preprocessor define for that/way to detect that?
You're right. I'm not aware of any standard preprocessor macro to detect exactly that condition, though maybe `NDEBUG` correlates with it well enough. I suppose we could define our own in LLVM's CMake files, based on the build options. Alternatively, we could make this translation unit always be built with debug info. Yet another option might be to do some kind of runtime inspection to detect debug info and skip the unit test if it's missing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143607



More information about the llvm-commits mailing list