llvm-project/lldb/tools
Pavel Labath 0f08db66db [lldb] Make logging machinery type-safe
This patch makes use of c++ type checking and scoped enums to make
logging statements shorter and harder to misuse.

Defines like LIBLLDB_LOG_PROCESS are replaces with LLDBLog::Process.
Because it now carries type information we do not need to worry about
matching a specific enum value with the right getter function -- the
compiler will now do that for us.

The main entry point for the logging machinery becomes the GetLog
(template) function, which will obtain the correct Log object based on
the enum type. It achieves this through another template function
(LogChannelFor<T>), which must be specialized for each type, and should
return the appropriate channel object.

This patch also removes the ability to log a message if multiple
categories are enabled simultaneously as it was unused and confusing.

This patch does not actually remove any of the existing interfaces. The
defines and log retrieval functions are left around as wrappers around
the new interfaces. They will be removed in follow-up patch.

Differential Revision: https://reviews.llvm.org/D117490
2022-01-25 12:13:49 +01:00
..
argdumper [lldb] Remove a few unused .exports files 2021-08-05 22:17:00 +02:00
compact-unwind Don't re-define constants that are now in compact_unwind_encoding.h. 2021-09-09 17:01:43 -07:00
darwin-debug [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
darwin-threads
debugserver [cmake] Make include(GNUInstallDirs) always below project(..) 2022-01-20 18:59:17 +00:00
driver [lldb] Remove the requirement for windows clients to specify -DIMPORT_LIBLLDB 2022-01-19 12:49:47 +01:00
intel-features [LLDB] Silence warnings in cli-wrapper-mpxtable.cpp 2021-06-28 02:36:14 +00:00
lldb-instr [lldb] Revive lldb-instr 2022-01-20 18:06:14 -08:00
lldb-server [lldb] Make logging machinery type-safe 2022-01-25 12:13:49 +01:00
lldb-test [lldb] Make lldbVersion a full fledged library 2021-12-08 15:14:34 -08:00
lldb-vscode Remove dependency from raw_ostream on <chrono> 2022-01-21 15:17:39 +01:00
CMakeLists.txt [lldb] Revive lldb-instr 2022-01-20 18:06:14 -08:00