Add a "thread specification" class that specifies thread specific breakpoints by name, index, queue or TID.
Push this through all the breakpoint management code. Allow this to be set when the breakpoint is created.
Fix the Process classes so that a breakpoint hit that is not for a particular thread is not reported as a
breakpoint hit event for that thread.
Added a "breakpoint configure" command to allow you to reset any of the thread
specific options (or the ignore count.)
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106078 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Breakpoint/BreakpointOptions.cpp b/source/Breakpoint/BreakpointOptions.cpp
index 4f664c4..695f4ee 100644
--- a/source/Breakpoint/BreakpointOptions.cpp
+++ b/source/Breakpoint/BreakpointOptions.cpp
@@ -16,6 +16,7 @@
#include "lldb/Core/Stream.h"
#include "lldb/Core/StringList.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Target/ThreadSpec.h"
using namespace lldb;
using namespace lldb_private;
@@ -35,7 +36,7 @@
m_callback_baton_sp (),
m_enabled (true),
m_ignore_count (0),
- m_thread_id (LLDB_INVALID_THREAD_ID)
+ m_thread_spec_ap (NULL)
{
}
@@ -48,8 +49,10 @@
m_callback_is_synchronous (rhs.m_callback_is_synchronous),
m_enabled (rhs.m_enabled),
m_ignore_count (rhs.m_ignore_count),
- m_thread_id (rhs.m_thread_id)
+ m_thread_spec_ap (NULL)
{
+ if (rhs.m_thread_spec_ap.get() != NULL)
+ m_thread_spec_ap.reset (new ThreadSpec(*rhs.m_thread_spec_ap.get()));
}
//----------------------------------------------------------------------
@@ -63,7 +66,8 @@
m_callback_is_synchronous = rhs.m_callback_is_synchronous;
m_enabled = rhs.m_enabled;
m_ignore_count = rhs.m_ignore_count;
- m_thread_id = rhs.m_thread_id;
+ if (rhs.m_thread_spec_ap.get() != NULL)
+ m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap.get()));
return *this;
}
@@ -98,6 +102,12 @@
return m_callback_baton_sp.get();
}
+const Baton *
+BreakpointOptions::GetBaton () const
+{
+ return m_callback_baton_sp.get();
+}
+
bool
BreakpointOptions::InvokeCallback (StoppointCallbackContext *context,
lldb::user_id_t break_id,
@@ -141,20 +151,27 @@
m_ignore_count = n;
}
+const ThreadSpec *
+BreakpointOptions::GetThreadSpec () const
+{
+ return m_thread_spec_ap.get();
+}
+
+ThreadSpec *
+BreakpointOptions::GetThreadSpec ()
+{
+ if (m_thread_spec_ap.get() == NULL)
+ m_thread_spec_ap.reset (new ThreadSpec());
+
+ return m_thread_spec_ap.get();
+}
+
void
BreakpointOptions::SetThreadID (lldb::tid_t thread_id)
{
- m_thread_id = thread_id;
+ GetThreadSpec()->SetTID(thread_id);
}
-lldb::tid_t
-BreakpointOptions::GetThreadID () const
-{
- return m_thread_id;
-}
-
-
-
void
BreakpointOptions::CommandBaton::GetDescription (Stream *s, lldb::DescriptionLevel level) const
{