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/SBAddress.cpp b/source/API/SBAddress.cpp
index 482ecec..c93b46b 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -15,22 +15,22 @@
SBAddress::SBAddress () :
- m_lldb_object_ap ()
+ m_opaque_ap ()
{
}
SBAddress::SBAddress (const lldb_private::Address *lldb_object_ptr) :
- m_lldb_object_ap ()
+ m_opaque_ap ()
{
if (lldb_object_ptr)
- m_lldb_object_ap.reset (new lldb_private::Address(*lldb_object_ptr));
+ m_opaque_ap.reset (new lldb_private::Address(*lldb_object_ptr));
}
SBAddress::SBAddress (const SBAddress &rhs) :
- m_lldb_object_ap ()
+ m_opaque_ap ()
{
if (rhs.IsValid())
- m_lldb_object_ap.reset (new lldb_private::Address(*rhs.m_lldb_object_ap.get()));
+ m_opaque_ap.reset (new lldb_private::Address(*rhs.m_opaque_ap.get()));
}
SBAddress::~SBAddress ()
@@ -43,7 +43,7 @@
if (this != &rhs)
{
if (rhs.IsValid())
- m_lldb_object_ap.reset (new lldb_private::Address(*rhs.m_lldb_object_ap.get()));
+ m_opaque_ap.reset (new lldb_private::Address(*rhs.m_opaque_ap.get()));
}
return *this;
}
@@ -51,7 +51,7 @@
bool
SBAddress::IsValid () const
{
- return m_lldb_object_ap.get() != NULL && m_lldb_object_ap->IsValid();
+ return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
}
void
@@ -59,21 +59,21 @@
{
if (lldb_object_ptr)
{
- if (m_lldb_object_ap.get())
- *m_lldb_object_ap = *lldb_object_ptr;
+ if (m_opaque_ap.get())
+ *m_opaque_ap = *lldb_object_ptr;
else
- m_lldb_object_ap.reset (new lldb_private::Address(*lldb_object_ptr));
+ m_opaque_ap.reset (new lldb_private::Address(*lldb_object_ptr));
return;
}
- if (m_lldb_object_ap.get())
- m_lldb_object_ap->Clear();
+ if (m_opaque_ap.get())
+ m_opaque_ap->Clear();
}
lldb::addr_t
SBAddress::GetFileAddress () const
{
- if (m_lldb_object_ap.get())
- return m_lldb_object_ap->GetFileAddress();
+ if (m_opaque_ap.get())
+ return m_opaque_ap->GetFileAddress();
else
return LLDB_INVALID_ADDRESS;
}
@@ -81,8 +81,8 @@
lldb::addr_t
SBAddress::GetLoadAddress (const SBProcess &process) const
{
- if (m_lldb_object_ap.get())
- return m_lldb_object_ap->GetLoadAddress(process.get());
+ if (m_opaque_ap.get())
+ return m_opaque_ap->GetLoadAddress(process.get());
else
return LLDB_INVALID_ADDRESS;
}
@@ -90,12 +90,12 @@
bool
SBAddress::OffsetAddress (addr_t offset)
{
- if (m_lldb_object_ap.get())
+ if (m_opaque_ap.get())
{
- addr_t addr_offset = m_lldb_object_ap->GetOffset();
+ addr_t addr_offset = m_opaque_ap->GetOffset();
if (addr_offset != LLDB_INVALID_ADDRESS)
{
- m_lldb_object_ap->SetOffset(addr_offset + offset);
+ m_opaque_ap->SetOffset(addr_offset + offset);
return true;
}
}
@@ -106,13 +106,13 @@
const lldb_private::Address *
SBAddress::operator->() const
{
- return m_lldb_object_ap.get();
+ return m_opaque_ap.get();
}
const lldb_private::Address &
SBAddress::operator*() const
{
- return *m_lldb_object_ap;
+ return *m_opaque_ap;
}