[Lldb-commits] [PATCH] Initialize ProcessGDBRemoteLog for LLGS by GDBRemoteCommunication::Initialize
Robert Flack
flackr at gmail.com
Mon Mar 9 15:57:17 PDT 2015
Hi tberghammer, ovyalov,
This was previously initialized by ProcessGDBRemote::Initialize but lldb-server does not contain ProcessGDBRemote anymore so this needs to be initialized directly.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D8186
Files:
source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
tools/lldb-server/lldb-server.cpp
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -138,6 +138,26 @@
}
}
+void
+GDBRemoteCommunication::Initialize()
+{
+ static ConstString g_name("gdb-remote");
+ static bool g_initialized = false;
+
+ if (g_initialized == false)
+ {
+ g_initialized = true;
+
+ Log::Callbacks log_callbacks = {
+ ProcessGDBRemoteLog::DisableLog,
+ ProcessGDBRemoteLog::EnableLog,
+ ProcessGDBRemoteLog::ListLogCategories
+ };
+
+ Log::RegisterLogChannel (g_name, log_callbacks);
+ }
+}
+
//----------------------------------------------------------------------
// GDBRemoteCommunication constructor
//----------------------------------------------------------------------
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -74,6 +74,12 @@
};
//------------------------------------------------------------------
+ // Public Static Methods
+ //------------------------------------------------------------------
+ static void
+ Initialize();
+
+ //------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
GDBRemoteCommunication(const char *comm_name,
Index: tools/lldb-server/lldb-server.cpp
===================================================================
--- tools/lldb-server/lldb-server.cpp
+++ tools/lldb-server/lldb-server.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/lldb-private.h"
+#include "Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp"
#include <stdio.h>
#include <stdlib.h>
@@ -30,6 +31,7 @@
initialize ()
{
lldb_private::InitializeForLLGS();
+ GDBRemoteCommunication::Initialize();
}
static void
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8186.21525.patch
Type: text/x-patch
Size: 2268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150309/472f13a5/attachment.bin>
More information about the lldb-commits
mailing list