summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-19 22:00:21 +0000
committerZachary Turner <zturner@google.com>2015-03-19 22:00:21 +0000
commit3a00691f3d6d281b5bf13564b81aef1d3e408c51 (patch)
tree3fffa3b54f17e54aea13d4389ba4948b2e6be19e /lldb/source/Core/Debugger.cpp
parent0efb51a072b06d5cfb97af6594c3a1fd0e80cc93 (diff)
downloadbcm5719-llvm-3a00691f3d6d281b5bf13564b81aef1d3e408c51.tar.gz
bcm5719-llvm-3a00691f3d6d281b5bf13564b81aef1d3e408c51.zip
Move LLDB initialization/shutdown to Initialization.
This creates a new top-level folder called Initialization which is intended to hold code specific to LLDB system initialization. Currently this holds the Initialize() and Terminate() functions, as well as the fatal error handler. This provides a means to break the massive dependency cycle which is caused by the fact that Debugger depends on Initialize and Terminate which then depends on the entire LLDB project. With this structure, it will be possible for applications to invoke lldb_private::Initialize() directly, and have that invoke Debugger::Initialize. llvm-svn: 232768
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp29
1 files changed, 5 insertions, 24 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 17eb92469ab..f93da0eb5cd 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -38,6 +38,7 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/Terminal.h"
#include "lldb/Host/ThreadLauncher.h"
+#include "lldb/Initialization/InitializeLLDB.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Interpreter/OptionValueSInt64.h"
@@ -185,7 +186,7 @@ enum
ePropertyEscapeNonPrintables
};
-Debugger::LoadPluginCallbackType Debugger::g_load_plugin_callback = NULL;
+LoadPluginCallbackType Debugger::g_load_plugin_callback = NULL;
Error
Debugger::SetPropertyValue (const ExecutionContext *exe_ctx,
@@ -412,27 +413,16 @@ Debugger::TestDebuggerRefCount ()
return g_shared_debugger_refcount;
}
-static bool lldb_initialized_for_llgs = false;
-void
-Debugger::InitializeForLLGS (LoadPluginCallbackType load_plugin_callback)
-{
- lldb_initialized_for_llgs = true;
- g_shared_debugger_refcount++;
- g_load_plugin_callback = load_plugin_callback;
- lldb_private::InitializeForLLGS();
-}
-
static bool lldb_initialized = true;
void
-Debugger::Initialize (LoadPluginCallbackType load_plugin_callback)
+Debugger::Initialize(LoadPluginCallbackType load_plugin_callback)
{
lldb_initialized = true;
g_shared_debugger_refcount++;
g_load_plugin_callback = load_plugin_callback;
- lldb_private::Initialize();
}
-void
+int
Debugger::Terminate ()
{
if (g_shared_debugger_refcount > 0)
@@ -440,21 +430,12 @@ Debugger::Terminate ()
g_shared_debugger_refcount--;
if (g_shared_debugger_refcount == 0)
{
- lldb_private::WillTerminate();
- if (lldb_initialized_for_llgs) {
- lldb_initialized_for_llgs = false;
- lldb_private::TerminateLLGS();
- }
- if (lldb_initialized) {
- lldb_initialized = false;
- lldb_private::Terminate();
- }
-
// Clear our master list of debugger objects
Mutex::Locker locker (GetDebuggerListMutex ());
GetDebuggerList().clear();
}
}
+ return g_shared_debugger_refcount;
}
void
OpenPOWER on IntegriCloud