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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 15:33:50 PST 2023


dblaikie added a comment.

> 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'd guess probably not - people enable assertions pretty regularly in LLVM, probably quite independently of debug info. But I might be wrong.

> 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.

Not sure if there's a tidy way to do that (always with debug info) - flags will vary by compiler/platform, and cmake abstracts that at the high level, not sure if it can be done at a lower/per-file level too.

> 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.

Yeah, though then the inspection probably has the same problems/complexities as the thing it's testing...


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