[Lldb-commits] [lldb] r216581 - llgs: remove all Initialize() calls except for Debugger::Initialize().
Todd Fiala
todd.fiala at gmail.com
Wed Aug 27 12:56:59 PDT 2014
Author: tfiala
Date: Wed Aug 27 14:56:58 2014
New Revision: 216581
URL: http://llvm.org/viewvc/llvm-project?rev=216581&view=rev
Log:
llgs: remove all Initialize() calls except for Debugger::Initialize().
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012580.html
The original change I made there was due to a segfault. That was
caused by me directly calling PluginManager::Initialize (), with
PluginManager::Initialize() depending on HostInfo::Initialize () to
have been called already (which it wasn't).
The call to PluginManager::Initialize () was erroneous (at least at the
current time) since that method is already called by Debugger::Initialize()'s
implementation.
We will want to revisit initializing a smaller core of the debugger
suitable for lldb-gdbserver and lldb-platform.
Modified:
lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp
Modified: lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp?rev=216581&r1=216580&r2=216581&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-gdbserver/lldb-gdbserver.cpp Wed Aug 27 14:56:58 2014
@@ -32,7 +32,6 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/StreamFile.h"
-#include "lldb/Host/HostInfo.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/Socket.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -151,21 +150,6 @@ dump_available_platforms (FILE *output_f
}
static void
-initialize_lldb_gdbserver ()
-{
- HostInfo::Initialize ();
- PluginManager::Initialize ();
- Debugger::Initialize (NULL);
-}
-
-static void
-terminate_lldb_gdbserver ()
-{
- Debugger::Terminate ();
- PluginManager::Terminate ();
-}
-
-static void
run_lldb_commands (const lldb::DebuggerSP &debugger_sp, const std::vector<std::string> lldb_commands)
{
for (const auto &lldb_command : lldb_commands)
@@ -510,7 +494,7 @@ main (int argc, char *argv[])
std::string named_pipe_path;
bool reverse_connect = false;
- initialize_lldb_gdbserver ();
+ Debugger::Initialize (NULL);
lldb::DebuggerSP debugger_sp = Debugger::CreateInstance ();
@@ -684,7 +668,7 @@ main (int argc, char *argv[])
ConnectToRemote (gdb_server, reverse_connect, host_and_port, progname, named_pipe_path.c_str ());
- terminate_lldb_gdbserver ();
+ Debugger::Terminate ();
fprintf(stderr, "lldb-gdbserver exiting...\n");
More information about the lldb-commits
mailing list