[lldb] Add diagnostics
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 28 Oct 2022 21:26:11 +0000 (14:26 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 31 Oct 2022 21:40:38 +0000 (14:40 -0700)
commit84ea6b6f78df789db6724ef8d774cf04d94d2313
treedc66149cef06f58eeeb5b742f3f592bc21140bc6
parent1f8ac37e2d50b0175225a0d8f3f5003f64b46b89
[lldb] Add diagnostics

Around this time last year, I said on the mailing list [1] that I wanted
to to transform the reproducers into something that resembles a
sysdiagnose on Apple platforms: a collection of files containing a
variety of information to help diagnose bugs or troubleshoot issues.

This patch adds that framework. Based on lessons learned from the
reproducers, I've intentionally tried to keep it small and simple.
Different parts of LLDB can register callbacks (this is necessary for
layering purposes) that will get called when the diagnostics should be
generated.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html

Differential revision: https://reviews.llvm.org/D134991
lldb/include/lldb/API/SBDebugger.h
lldb/include/lldb/Utility/Diagnostics.h [new file with mode: 0644]
lldb/source/API/SBDebugger.cpp
lldb/source/Core/Debugger.cpp
lldb/source/Initialization/SystemInitializerCommon.cpp
lldb/source/Utility/CMakeLists.txt
lldb/source/Utility/Diagnostics.cpp [new file with mode: 0644]
lldb/tools/driver/Driver.cpp