Send Breakpoint Changed events for all the relevant changes to breakpoints.
Also, provide and use accessors for the thread options on breakpoints so we
can control sending the appropriate events.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150057 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBBreakpoint.cpp b/source/API/SBBreakpoint.cpp
index 33bdbe0..6b8ac6e 100644
--- a/source/API/SBBreakpoint.cpp
+++ b/source/API/SBBreakpoint.cpp
@@ -557,6 +557,13 @@
return m_opaque_sp;
}
+bool
+SBBreakpoint::EventIsBreakpointEvent (const lldb::SBEvent &event)
+{
+ return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) != NULL;
+
+}
+
BreakpointEventType
SBBreakpoint::GetBreakpointEventTypeFromEvent (const SBEvent& event)
{
@@ -583,4 +590,13 @@
return sb_breakpoint_loc;
}
+uint32_t
+SBBreakpoint::GetNumBreakpointLocationsFromEvent (const lldb::SBEvent &event)
+{
+ uint32_t num_locations = 0;
+ if (event.IsValid())
+ num_locations = (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (event.GetSP()));
+ return num_locations;
+}
+
diff --git a/source/API/SBBreakpointLocation.cpp b/source/API/SBBreakpointLocation.cpp
index 57cf5a1..d7fc1dc 100644
--- a/source/API/SBBreakpointLocation.cpp
+++ b/source/API/SBBreakpointLocation.cpp
@@ -176,9 +176,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetLocationOptions()->GetThreadSpecNoCreate();
- if (thread_spec)
- tid = thread_spec->GetTID();
+ return m_opaque_sp->GetThreadID();
}
return tid;
}
@@ -189,7 +187,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetIndex (index);
+ m_opaque_sp->SetThreadIndex (index);
}
}
@@ -200,9 +198,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
- if (thread_spec)
- thread_idx = thread_spec->GetIndex();
+ return m_opaque_sp->GetThreadIndex();
}
return thread_idx;
}
@@ -214,7 +210,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetName (thread_name);
+ m_opaque_sp->SetThreadName (thread_name);
}
}
@@ -224,9 +220,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
- if (thread_spec)
- return thread_spec->GetName();
+ return m_opaque_sp->GetThreadName();
}
return NULL;
}
@@ -237,7 +231,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- m_opaque_sp->GetLocationOptions()->GetThreadSpec()->SetQueueName (queue_name);
+ m_opaque_sp->SetQueueName (queue_name);
}
}
@@ -247,9 +241,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptionsNoCreate()->GetThreadSpecNoCreate();
- if (thread_spec)
- return thread_spec->GetQueueName();
+ m_opaque_sp->GetQueueName ();
}
return NULL;
}
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 4b4e840..5fc7196 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -740,6 +740,11 @@
return process;
}
+bool
+SBProcess::EventIsProcessEvent (const SBEvent &event)
+{
+ return Process::ProcessEventData::GetEventDataFromEvent(event.get()) != NULL;
+}
SBBroadcaster
SBProcess::GetBroadcaster () const