[lldb] Fix Initialization/Termination for all log channels (#184467)
Similar to #184261, but for all the other log channels.
This commit is contained in:
committed by
GitHub
parent
699563e0da
commit
53fbbaa577
@@ -90,10 +90,16 @@ llvm::Error SystemInitializerCommon::Initialize() {
|
||||
void SystemInitializerCommon::Terminate() {
|
||||
LLDB_SCOPED_TIMER();
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
|
||||
defined(__OpenBSD__)
|
||||
ProcessPOSIXLog::Terminate();
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
ProcessWindowsLog::Terminate();
|
||||
#endif
|
||||
|
||||
process_gdb_remote::ProcessGDBRemoteLog::Terminate();
|
||||
|
||||
Socket::Terminate();
|
||||
HostInfo::Terminate();
|
||||
Log::DisableAllLogChannels();
|
||||
|
||||
@@ -94,6 +94,7 @@ llvm::StringRef ProcessKDP::GetPluginDescriptionStatic() {
|
||||
}
|
||||
|
||||
void ProcessKDP::Terminate() {
|
||||
ProcessKDPLog::Terminate();
|
||||
PluginManager::UnregisterPlugin(ProcessKDP::CreateInstance);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,3 +36,4 @@ template <> Log::Channel &lldb_private::LogChannelFor<KDPLog>() {
|
||||
}
|
||||
|
||||
void ProcessKDPLog::Initialize() { Log::Register("kdp-remote", g_channel); }
|
||||
void ProcessKDPLog::Terminate() { Log::Unregister("kdp-remote"); }
|
||||
|
||||
@@ -33,6 +33,7 @@ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
|
||||
class ProcessKDPLog {
|
||||
public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
};
|
||||
|
||||
template <> Log::Channel &LogChannelFor<KDPLog>();
|
||||
|
||||
@@ -28,7 +28,6 @@ template <> Log::Channel &lldb_private::LogChannelFor<POSIXLog>() {
|
||||
return g_channel;
|
||||
}
|
||||
|
||||
void ProcessPOSIXLog::Initialize() {
|
||||
static llvm::once_flag g_once_flag;
|
||||
llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });
|
||||
}
|
||||
void ProcessPOSIXLog::Initialize() { Log::Register("posix", g_channel); }
|
||||
|
||||
void ProcessPOSIXLog::Terminate() { Log::Unregister("posix"); }
|
||||
|
||||
@@ -31,6 +31,7 @@ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
|
||||
class ProcessPOSIXLog {
|
||||
public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
};
|
||||
|
||||
template <> Log::Channel &LogChannelFor<POSIXLog>();
|
||||
|
||||
@@ -27,18 +27,6 @@ template <> Log::Channel &lldb_private::LogChannelFor<WindowsLog>() {
|
||||
return g_channel;
|
||||
}
|
||||
|
||||
void ProcessWindowsLog::Initialize() {
|
||||
static llvm::once_flag g_once_flag;
|
||||
llvm::call_once(g_once_flag, []() { Log::Register("windows", g_channel); });
|
||||
}
|
||||
|
||||
void ProcessWindowsLog::Terminate() {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ProcessWindowsLog::Initialize() { Log::Register("windows", g_channel); }
|
||||
|
||||
void ProcessWindowsLog::Terminate() { Log::Unregister("windows"); }
|
||||
|
||||
@@ -40,8 +40,7 @@ template <> Log::Channel &lldb_private::LogChannelFor<GDBRLog>() {
|
||||
}
|
||||
|
||||
void ProcessGDBRemoteLog::Initialize() {
|
||||
static llvm::once_flag g_once_flag;
|
||||
llvm::call_once(g_once_flag, []() {
|
||||
Log::Register("gdb-remote", g_channel);
|
||||
});
|
||||
Log::Register("gdb-remote", g_channel);
|
||||
}
|
||||
|
||||
void ProcessGDBRemoteLog::Terminate() { Log::Unregister("gdb-remote"); }
|
||||
|
||||
@@ -34,6 +34,7 @@ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
|
||||
class ProcessGDBRemoteLog {
|
||||
public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
};
|
||||
|
||||
} // namespace process_gdb_remote
|
||||
|
||||
Reference in New Issue
Block a user