1 //===-- LLDBLog.cpp -------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Utility/LLDBLog.h"
10 #include "lldb/Utility/Log.h"
11 #include "llvm/ADT/ArrayRef.h"
14 using namespace lldb_private
;
16 static constexpr Log::Category g_categories
[] = {
17 {{"api"}, {"log API calls and return values"}, LLDBLog::API
},
18 {{"ast"}, {"log AST"}, LLDBLog::AST
},
19 {{"break"}, {"log breakpoints"}, LLDBLog::Breakpoints
},
20 {{"commands"}, {"log command argument parsing"}, LLDBLog::Commands
},
21 {{"comm"}, {"log communication activities"}, LLDBLog::Communication
},
22 {{"conn"}, {"log connection details"}, LLDBLog::Connection
},
24 {"log mangled names to catch demangler crashes"},
27 {"log shared library related activities"},
28 LLDBLog::DynamicLoader
},
30 {"log broadcaster, listener and event queue activities"},
32 {{"expr"}, {"log expressions"}, LLDBLog::Expressions
},
34 {"log data formatters related activities"},
35 LLDBLog::DataFormatters
},
36 {{"host"}, {"log host activities"}, LLDBLog::Host
},
37 {{"jit"}, {"log JIT events in the target"}, LLDBLog::JITLoader
},
38 {{"language"}, {"log language runtime events"}, LLDBLog::Language
},
39 {{"mmap"}, {"log mmap related activities"}, LLDBLog::MMap
},
41 {"log module activities such as when modules are created, destroyed, "
42 "replaced, and more"},
45 {"log object construction/destruction for important objects"},
47 {{"os"}, {"log OperatingSystem plugin related activities"}, LLDBLog::OS
},
48 {{"platform"}, {"log platform events and activities"}, LLDBLog::Platform
},
49 {{"process"}, {"log process events and activities"}, LLDBLog::Process
},
50 {{"script"}, {"log events about the script interpreter"}, LLDBLog::Script
},
52 {"log private and public process state changes"},
54 {{"step"}, {"log step related activities"}, LLDBLog::Step
},
55 {{"symbol"}, {"log symbol related issues and warnings"}, LLDBLog::Symbols
},
56 {{"system-runtime"}, {"log system runtime events"}, LLDBLog::SystemRuntime
},
57 {{"target"}, {"log target events and activities"}, LLDBLog::Target
},
58 {{"temp"}, {"log internal temporary debug messages"}, LLDBLog::Temporary
},
59 {{"thread"}, {"log thread events and activities"}, LLDBLog::Thread
},
60 {{"types"}, {"log type system related activities"}, LLDBLog::Types
},
61 {{"unwind"}, {"log stack unwind activities"}, LLDBLog::Unwind
},
62 {{"watch"}, {"log watchpoint related activities"}, LLDBLog::Watchpoints
},
64 {"log symbol on-demand related activities"},
66 {{"source"}, {"log source related activities"}, LLDBLog::Source
},
69 static Log::Channel
g_log_channel(g_categories
,
70 LLDBLog::Process
| LLDBLog::Thread
|
71 LLDBLog::DynamicLoader
|
72 LLDBLog::Breakpoints
|
73 LLDBLog::Watchpoints
| LLDBLog::Step
|
74 LLDBLog::State
| LLDBLog::Symbols
|
75 LLDBLog::Target
| LLDBLog::Commands
);
77 template <> Log::Channel
&lldb_private::LogChannelFor
<LLDBLog
>() {
81 void lldb_private::InitializeLldbChannel() {
82 Log::Register("lldb", g_log_channel
);