[Lldb-commits] [PATCH] D152866: [lldb] Print lldbassert to debugger diagnostics

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 13 16:12:38 PDT 2023


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, rupprecht, bulbazord, aprantl.
Herald added a project: All.
JDevlieghere requested review of this revision.

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 emitted to stderr. That's fine for the command line, but when used as library, for example from Xcode or VSCode, this information doesn't make it to the user. This patch redirects these messages to use the diagnostic infrastructure so they're emitted as diagnostic events.

The patch is slightly more complicated than I would've liked because of layering. `lldbassert` is part of `Utility` while the diagnostics are implemented in `Core`.


https://reviews.llvm.org/D152866

Files:
  lldb/include/lldb/Core/Debugger.h
  lldb/include/lldb/Utility/LLDBAssert.h
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Core/Debugger.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Utility/LLDBAssert.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152866.531102.patch
Type: text/x-patch
Size: 5395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230613/6c46a96e/attachment-0001.bin>


More information about the lldb-commits mailing list