-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces #143591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -507,6 +507,21 @@ static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) { | |
return 0; | ||
} | ||
|
||
#if LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN | ||
#if !defined(HAVE_BACKTRACE) | ||
#error DebugLoc origin-tracking currently requires `backtrace()`. | ||
#endif | ||
Comment on lines
+511
to
+513
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this instead be a cmake check? (I've no idea how to achieve that, it just might be more convenient to developers to fail-early-fail-hard). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly, I'll look into it - though if possible I'd prefer to replace the use of |
||
namespace llvm { | ||
namespace sys { | ||
template <unsigned long MaxDepth> | ||
int getStackTrace(std::array<void *, MaxDepth> &StackTrace) { | ||
return backtrace(StackTrace.data(), MaxDepth); | ||
} | ||
template int getStackTrace<16ul>(std::array<void *, 16ul> &); | ||
} // namespace sys | ||
} // namespace llvm | ||
#endif | ||
|
||
/// If this is an ELF platform, we can find all loaded modules and their virtual | ||
/// addresses with dl_iterate_phdr. | ||
static bool findModulesAndOffsets(void **StackTrace, int Depth, | ||
|
Uh oh!
There was an error while loading. Please reload this page.