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/SBFunction.cpp b/source/API/SBFunction.cpp
index 010a5ec..c4beff1 100644
--- a/source/API/SBFunction.cpp
+++ b/source/API/SBFunction.cpp
@@ -15,50 +15,50 @@
SBFunction::SBFunction () :
- m_lldb_object_ptr (NULL)
+ m_opaque_ptr (NULL)
{
}
SBFunction::SBFunction (lldb_private::Function *lldb_object_ptr) :
- m_lldb_object_ptr (lldb_object_ptr)
+ m_opaque_ptr (lldb_object_ptr)
{
}
SBFunction::~SBFunction ()
{
- m_lldb_object_ptr = NULL;
+ m_opaque_ptr = NULL;
}
bool
SBFunction::IsValid () const
{
- return m_lldb_object_ptr != NULL;
+ return m_opaque_ptr != NULL;
}
const char *
SBFunction::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 *
SBFunction::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;
}
bool
SBFunction::operator == (const SBFunction &rhs) const
{
- return m_lldb_object_ptr == rhs.m_lldb_object_ptr;
+ return m_opaque_ptr == rhs.m_opaque_ptr;
}
bool
SBFunction::operator != (const SBFunction &rhs) const
{
- return m_lldb_object_ptr != rhs.m_lldb_object_ptr;
+ return m_opaque_ptr != rhs.m_opaque_ptr;
}