diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-06-13 20:24:18 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-06-13 20:46:33 -0700 |
commit | 83a6a0a620476d2fa181cb663ccbf06cc9d7a24f (patch) | |
tree | 9f1b49e434ced7be594f76b982f0ef0ed9b89afc /lldb/source/API/SystemInitializerFull.cpp | |
parent | cf875caaa35f3262b613848111dcccba4486b7b0 (diff) | |
download | llvm-83a6a0a620476d2fa181cb663ccbf06cc9d7a24f.zip llvm-83a6a0a620476d2fa181cb663ccbf06cc9d7a24f.tar.gz llvm-83a6a0a620476d2fa181cb663ccbf06cc9d7a24f.tar.bz2 |
[lldb] Print lldbassert to debugger diagnostics
When hitting an lldbassert in a non-assert build, we emit a blurb
including the assertion, the triggering file and line and a pretty
backtrace leading up to the issue. Currently, this is all printed to
stderr. That's fine on the command line, but when used as library, for
example from Xcode, this information doesn't make it to the user. This
patch uses the diagnostic infrastructure to report LLDB asserts as
diagnostic events.
The patch is slightly more complicated than I would've liked because of
layering. lldbassert is part of Utility while the debugger diagnostics
are implemented in Core.
Differential revision: https://reviews.llvm.org/D152866
Diffstat (limited to 'lldb/source/API/SystemInitializerFull.cpp')
-rw-r--r-- | lldb/source/API/SystemInitializerFull.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp index 521aecf..27319de 100644 --- a/lldb/source/API/SystemInitializerFull.cpp +++ b/lldb/source/API/SystemInitializerFull.cpp @@ -78,6 +78,9 @@ llvm::Error SystemInitializerFull::Initialize() { // Settings must be initialized AFTER PluginManager::Initialize is called. Debugger::SettingsInitialize(); + // Use the Debugger's LLDBAssert callback. + SetLLDBAssertCallback(Debugger::AssertCallback); + return llvm::Error::success(); } |