llvm-project/lldb/unittests
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
..
API [lldb] Handle missing SBStructuredData copy assignment cases 2021-05-05 15:12:03 -07:00
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb] Fix compiler warning in CommunicationTest 2022-01-18 10:31:37 +01:00
DataFormatter [nfc] [lldb] Prevent needless copies of DataExtractor 2021-08-04 20:35:53 +02:00
Disassembler [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Editline [lldb][NFC] Inclusive language: replace master/slave names for ptys 2021-11-12 10:54:18 -06:00
Expression [llvm][lldb] Remove unused SmallVectorMemoryBuffer.h includes 2021-12-09 11:32:13 +01:00
Host [lldb] [Host/Socket] Make DecodeHostAndPort() return a dedicated struct 2021-10-28 09:57:50 +02:00
Instruction Fix UB in EmulateInstructionARM64.cpp 2020-06-01 18:11:50 -07:00
Interpreter Follow-on to fix a test from c5011aed9c. 2021-10-18 16:53:32 -07:00
Language [lldb] Return StringRef from PluginInterface::GetPluginName 2021-10-18 10:14:42 +02:00
ObjectFile [LLDB][Breakpad] Make lldb understand INLINE and INLINE_ORIGIN records in breakpad. 2021-11-10 11:20:32 -08:00
Platform [lldb] Remove PlatformDarwin::GetCompatibleArch helper 2022-01-15 09:51:16 -08:00
Process [lldb] Rename MemoryTagManager RemoveNonAddressBits to RemoveTagBits 2022-01-20 10:47:05 +00:00
ScriptInterpreter [lldb] Initialize Python exactly once 2022-01-19 09:56:55 -08:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol Added the ability to cache the finalized symbol tables subsequent debug sessions to start faster. 2021-12-16 09:59:55 -08:00
SymbolFile Cache the manual DWARF index out to the LLDB cache directory when the LLDB index cache is enabled. 2021-12-28 11:00:28 -08:00
Target [lldb] Move GetSupportedArchitectureAtIndex to PlatformDarwin 2021-11-24 15:48:23 +01:00
TestingSupport Add missing STLExtras.h include from lldb/unittests/TestingSupport/MockTildeExpressionResolver.cpp 2022-01-24 15:03:11 +01:00
Thread [lldb] Return StringRef from PluginInterface::GetPluginName 2021-10-18 10:14:42 +02:00
UnwindAssembly Bug where insn-based unwind plans on arm64 could be wrong 2020-04-14 16:57:25 -07:00
Utility [lldb] Make logging machinery type-safe 2022-01-25 12:13:49 +01:00
debugserver [lldb] [unittests] Fix TcpListen() call in RNBSocketTest 2021-10-26 21:08:03 +02:00
tools [lldb] Delete TestStopReplyContainsThreadPcs 2022-01-18 14:17:33 +01:00
CMakeLists.txt Re-land "[lldb] Make the API, Shell and Unit tests independent lit test suites" 2021-03-22 14:36:43 -07:00
gtest_common.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00