summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorRobert Flack <flackr@gmail.com>2015-03-11 21:14:22 +0000
committerRobert Flack <flackr@gmail.com>2015-03-11 21:14:22 +0000
commit5f4b6c7c9e1f8d1fbda62ea3729284e7c3db27f1 (patch)
treed6612dfdb0c989723e090afa2d6e01d36898b91d /lldb/source/Plugins/Process/gdb-remote
parent91bd698eafe5014cd2852d3bb6f5119b73128c6e (diff)
downloadbcm5719-llvm-5f4b6c7c9e1f8d1fbda62ea3729284e7c3db27f1.tar.gz
bcm5719-llvm-5f4b6c7c9e1f8d1fbda62ea3729284e7c3db27f1.zip
Initialize ProcessGDBRemoteLog for LLGS to fix remote platform logging
This was previously initialized by ProcessGDBRemote::Initialize but lldb-server does not contain ProcessGDBRemote anymore so this needs to be initialized directly. Differential Revision: http://reviews.llvm.org/D8186 llvm-svn: 231966
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp8
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp18
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h3
3 files changed, 21 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 30caf92a335..e68a5d41a3a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2961,14 +2961,6 @@ ProcessGDBRemote::Initialize()
GetPluginDescriptionStatic(),
CreateInstance,
DebuggerInitialize);
-
- Log::Callbacks log_callbacks = {
- ProcessGDBRemoteLog::DisableLog,
- ProcessGDBRemoteLog::EnableLog,
- ProcessGDBRemoteLog::ListLogCategories
- };
-
- Log::RegisterLogChannel (ProcessGDBRemote::GetPluginNameStatic(), log_callbacks);
}
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
index 15b861feaa8..0f73e44590b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
@@ -9,6 +9,8 @@
#include "ProcessGDBRemoteLog.h"
+#include <mutex>
+
#include "lldb/Interpreter/Args.h"
#include "lldb/Core/StreamFile.h"
@@ -32,6 +34,22 @@ GetLog ()
return g_log;
}
+void
+ProcessGDBRemoteLog::Initialize()
+{
+ static ConstString g_name("gdb-remote");
+ static std::once_flag g_once_flag;
+
+ std::call_once(g_once_flag, [](){
+ Log::Callbacks log_callbacks = {
+ DisableLog,
+ EnableLog,
+ ListLogCategories
+ };
+
+ Log::RegisterLogChannel (g_name, log_callbacks);
+ });
+}
Log *
ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (uint32_t mask)
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
index 93734067f13..c551f8eba59 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
@@ -35,6 +35,9 @@
class ProcessGDBRemoteLog
{
public:
+ static void
+ Initialize();
+
static lldb_private::Log *
GetLogIfAllCategoriesSet(uint32_t mask = 0);
OpenPOWER on IntegriCloud