diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-06-23 01:19:29 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-06-23 01:19:29 +0000 |
| commit | 6611103cfe7a8c08554816fc08abef2e2960e799 (patch) | |
| tree | b940bb129b59af3cf6923f8d69f095d2d9fc8dca /lldb/source/API/SBModule.cpp | |
| parent | ef5a4383ad679e58743c540c25d6a1bab0c77423 (diff) | |
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.
llvm-svn: 106615
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
| -rw-r--r-- | lldb/source/API/SBModule.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 6a54c2177bf9..011197ad7cd0 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -15,12 +15,12 @@ using namespace lldb; SBModule::SBModule () : - m_lldb_object_sp () + m_opaque_sp () { } SBModule::SBModule (const lldb::ModuleSP& module_sp) : - m_lldb_object_sp (module_sp) + m_opaque_sp (module_sp) { } @@ -31,23 +31,23 @@ SBModule::~SBModule () bool SBModule::IsValid () const { - return m_lldb_object_sp.get() != NULL; + return m_opaque_sp.get() != NULL; } SBFileSpec SBModule::GetFileSpec () const { SBFileSpec file_spec; - if (m_lldb_object_sp) - file_spec.SetFileSpec(m_lldb_object_sp->GetFileSpec()); + if (m_opaque_sp) + file_spec.SetFileSpec(m_opaque_sp->GetFileSpec()); return file_spec; } const uint8_t * SBModule::GetUUIDBytes () const { - if (m_lldb_object_sp) - return (const uint8_t *)m_lldb_object_sp->GetUUID().GetBytes(); + if (m_opaque_sp) + return (const uint8_t *)m_opaque_sp->GetUUID().GetBytes(); return NULL; } @@ -55,53 +55,53 @@ SBModule::GetUUIDBytes () const bool SBModule::operator == (const SBModule &rhs) const { - if (m_lldb_object_sp) - return m_lldb_object_sp.get() == rhs.m_lldb_object_sp.get(); + if (m_opaque_sp) + return m_opaque_sp.get() == rhs.m_opaque_sp.get(); return false; } bool SBModule::operator != (const SBModule &rhs) const { - if (m_lldb_object_sp) - return m_lldb_object_sp.get() != rhs.m_lldb_object_sp.get(); + if (m_opaque_sp) + return m_opaque_sp.get() != rhs.m_opaque_sp.get(); return false; } lldb::ModuleSP & SBModule::operator *() { - return m_lldb_object_sp; + return m_opaque_sp; } lldb_private::Module * SBModule::operator ->() { - return m_lldb_object_sp.get(); + return m_opaque_sp.get(); } const lldb_private::Module * SBModule::operator ->() const { - return m_lldb_object_sp.get(); + return m_opaque_sp.get(); } lldb_private::Module * SBModule::get() { - return m_lldb_object_sp.get(); + return m_opaque_sp.get(); } const lldb_private::Module * SBModule::get() const { - return m_lldb_object_sp.get(); + return m_opaque_sp.get(); } void SBModule::SetModule (const lldb::ModuleSP& module_sp) { - m_lldb_object_sp = module_sp; + m_opaque_sp = module_sp; } |
