summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBBreakpointLocation.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-06-23 01:19:29 +0000
committerGreg Clayton <gclayton@apple.com>2010-06-23 01:19:29 +0000
commit6611103cfe7a8c08554816fc08abef2e2960e799 (patch)
treeb940bb129b59af3cf6923f8d69f095d2d9fc8dca /lldb/source/API/SBBreakpointLocation.cpp
parentef5a4383ad679e58743c540c25d6a1bab0c77423 (diff)
downloadbcm5719-llvm-6611103cfe7a8c08554816fc08abef2e2960e799.tar.gz
bcm5719-llvm-6611103cfe7a8c08554816fc08abef2e2960e799.zip
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/SBBreakpointLocation.cpp')
-rw-r--r--lldb/source/API/SBBreakpointLocation.cpp73
1 files changed, 36 insertions, 37 deletions
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index b5e78596e87..f376f5368b5 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -31,7 +31,7 @@ SBBreakpointLocation::SBBreakpointLocation ()
}
SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) :
- m_break_loc_sp (break_loc_sp)
+ m_opaque_sp (break_loc_sp)
{
}
@@ -42,7 +42,7 @@ SBBreakpointLocation::~SBBreakpointLocation ()
bool
SBBreakpointLocation::IsValid() const
{
- return m_break_loc_sp.get() != NULL;
+ return m_opaque_sp.get() != NULL;
}
addr_t
@@ -50,9 +50,9 @@ SBBreakpointLocation::GetLoadAddress ()
{
addr_t ret_addr = LLDB_INVALID_ADDRESS;
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
- ret_addr = m_break_loc_sp->GetLoadAddress();
+ ret_addr = m_opaque_sp->GetLoadAddress();
}
return ret_addr;
@@ -61,17 +61,17 @@ SBBreakpointLocation::GetLoadAddress ()
void
SBBreakpointLocation::SetEnabled (bool enabled)
{
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
- m_break_loc_sp->SetEnabled (enabled);
+ m_opaque_sp->SetEnabled (enabled);
}
}
bool
SBBreakpointLocation::IsEnabled ()
{
- if (m_break_loc_sp)
- return m_break_loc_sp->IsEnabled();
+ if (m_opaque_sp)
+ return m_opaque_sp->IsEnabled();
else
return false;
}
@@ -79,8 +79,8 @@ SBBreakpointLocation::IsEnabled ()
int32_t
SBBreakpointLocation::GetIgnoreCount ()
{
- if (m_break_loc_sp)
- return m_break_loc_sp->GetIgnoreCount();
+ if (m_opaque_sp)
+ return m_opaque_sp->GetIgnoreCount();
else
return 0;
}
@@ -88,40 +88,39 @@ SBBreakpointLocation::GetIgnoreCount ()
void
SBBreakpointLocation::SetIgnoreCount (int32_t n)
{
- if (m_break_loc_sp)
- m_break_loc_sp->SetIgnoreCount (n);
+ if (m_opaque_sp)
+ m_opaque_sp->SetIgnoreCount (n);
}
void
SBBreakpointLocation::SetThreadID (tid_t thread_id)
{
- if (m_break_loc_sp)
- m_break_loc_sp->SetThreadID (thread_id);
+ if (m_opaque_sp)
+ m_opaque_sp->SetThreadID (thread_id);
}
tid_t
SBBreakpointLocation::GetThreadID ()
{
tid_t sb_thread_id = (lldb::tid_t) LLDB_INVALID_THREAD_ID;
- if (m_break_loc_sp)
- sb_thread_id = m_break_loc_sp->GetLocationOptions()->GetThreadSpecNoCreate()->GetTID();
-
+ if (m_opaque_sp)
+ sb_thread_id = m_opaque_sp->GetLocationOptions()->GetThreadSpecNoCreate()->GetTID();
return sb_thread_id;
}
void
SBBreakpointLocation::SetThreadIndex (uint32_t index)
{
- if (m_break_loc_sp)
- m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetIndex (index);
+ if (m_opaque_sp)
+ m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetIndex (index);
}
uint32_t
SBBreakpointLocation::GetThreadIndex() const
{
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
- const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
+ const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
if (thread_spec == NULL)
return 0;
else
@@ -134,16 +133,16 @@ SBBreakpointLocation::GetThreadIndex() const
void
SBBreakpointLocation::SetThreadName (const char *thread_name)
{
- if (m_break_loc_sp)
- m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetName (thread_name);
+ if (m_opaque_sp)
+ m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetName (thread_name);
}
const char *
SBBreakpointLocation::GetThreadName () const
{
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
- const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
+ const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
if (thread_spec == NULL)
return NULL;
else
@@ -155,16 +154,16 @@ SBBreakpointLocation::GetThreadName () const
void
SBBreakpointLocation::SetQueueName (const char *queue_name)
{
- if (m_break_loc_sp)
- m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetQueueName (queue_name);
+ if (m_opaque_sp)
+ m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetQueueName (queue_name);
}
const char *
SBBreakpointLocation::GetQueueName () const
{
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
- const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
+ const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
if (thread_spec == NULL)
return NULL;
else
@@ -176,8 +175,8 @@ SBBreakpointLocation::GetQueueName () const
bool
SBBreakpointLocation::IsResolved ()
{
- if (m_break_loc_sp)
- return m_break_loc_sp->IsResolved();
+ if (m_opaque_sp)
+ return m_opaque_sp->IsResolved();
else
return false;
}
@@ -185,11 +184,11 @@ SBBreakpointLocation::IsResolved ()
void
SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_sp)
{
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
// Uninstall the callbacks?
}
- m_break_loc_sp = break_loc_sp;
+ m_opaque_sp = break_loc_sp;
}
void
@@ -198,7 +197,7 @@ SBBreakpointLocation::GetDescription (FILE *f, const char *description_level)
if (f == NULL)
return;
- if (m_break_loc_sp)
+ if (m_opaque_sp)
{
DescriptionLevel level;
if (strcmp (description_level, "brief") == 0)
@@ -212,7 +211,7 @@ SBBreakpointLocation::GetDescription (FILE *f, const char *description_level)
StreamFile str (f);
- m_break_loc_sp->GetDescription (&str, level);
+ m_opaque_sp->GetDescription (&str, level);
str.EOL();
}
}
@@ -221,8 +220,8 @@ SBBreakpoint
SBBreakpointLocation::GetBreakpoint ()
{
SBBreakpoint sb_bp;
- if (m_break_loc_sp)
- *sb_bp = m_break_loc_sp->GetBreakpoint ().GetSP();
+ if (m_opaque_sp)
+ *sb_bp = m_opaque_sp->GetBreakpoint ().GetSP();
return sb_bp;
}
OpenPOWER on IntegriCloud