Very large changes that were needed in order to allow multiple connections
to the debugger from GUI windows. Previously there was one global debugger
instance that could be accessed that had its own command interpreter and
current state (current target/process/thread/frame). When a GUI debugger
was attached, if it opened more than one window that each had a console
window, there were issues where the last one to setup the global debugger
object won and got control of the debugger.
To avoid this we now create instances of the lldb_private::Debugger that each
has its own state:
- target list for targets the debugger instance owns
- current process/thread/frame
- its own command interpreter
- its own input, output and error file handles to avoid conflicts
- its own input reader stack
So now clients should call:
SBDebugger::Initialize(); // (static function)
SBDebugger debugger (SBDebugger::Create());
// Use which ever file handles you wish
debugger.SetErrorFileHandle (stderr, false);
debugger.SetOutputFileHandle (stdout, false);
debugger.SetInputFileHandle (stdin, true);
// main loop
SBDebugger::Terminate(); // (static function)
SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to
ensure nothing gets destroyed too early when multiple clients might be
attached.
Cleaned up the command interpreter and the CommandObject and all subclasses
to take more appropriate arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106615 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBSymbol.cpp b/source/API/SBSymbol.cpp
index 8500c8b..502efaa 100644
--- a/source/API/SBSymbol.cpp
+++ b/source/API/SBSymbol.cpp
@@ -14,39 +14,39 @@
SBSymbol::SBSymbol () :
- m_lldb_object_ptr (NULL)
+ m_opaque_ptr (NULL)
{
}
SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) :
- m_lldb_object_ptr (lldb_object_ptr)
+ m_opaque_ptr (lldb_object_ptr)
{
}
SBSymbol::~SBSymbol ()
{
- m_lldb_object_ptr = NULL;
+ m_opaque_ptr = NULL;
}
bool
SBSymbol::IsValid () const
{
- return m_lldb_object_ptr != NULL;
+ return m_opaque_ptr != NULL;
}
const char *
SBSymbol::GetName() const
{
- if (m_lldb_object_ptr)
- return m_lldb_object_ptr->GetMangled().GetName().AsCString();
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetMangled().GetName().AsCString();
return NULL;
}
const char *
SBSymbol::GetMangledName () const
{
- if (m_lldb_object_ptr)
- return m_lldb_object_ptr->GetMangled().GetMangledName().AsCString();
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetMangled().GetMangledName().AsCString();
return NULL;
}
@@ -54,11 +54,11 @@
bool
SBSymbol::operator == (const SBSymbol &rhs) const
{
- return m_lldb_object_ptr == rhs.m_lldb_object_ptr;
+ return m_opaque_ptr == rhs.m_opaque_ptr;
}
bool
SBSymbol::operator != (const SBSymbol &rhs) const
{
- return m_lldb_object_ptr != rhs.m_lldb_object_ptr;
+ return m_opaque_ptr != rhs.m_opaque_ptr;
}