summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointOptions.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-06-16 02:00:15 +0000
committerJim Ingham <jingham@apple.com>2010-06-16 02:00:15 +0000
commit1b54c88cc4f8582222644d65dfd61703206430ef (patch)
tree8f720e2946e32ece13de194e4ccfafffa21d9b3f /lldb/source/Breakpoint/BreakpointOptions.cpp
parentbabff2ce5644a5f2af3a9cac323c1a97f39a90a1 (diff)
downloadbcm5719-llvm-1b54c88cc4f8582222644d65dfd61703206430ef.tar.gz
bcm5719-llvm-1b54c88cc4f8582222644d65dfd61703206430ef.zip
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.) llvm-svn: 106078
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointOptions.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointOptions.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp
index 4f664c4692f..695f4ee5ccd 100644
--- a/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/lldb/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 @@ BreakpointOptions::BreakpointOptions() :
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 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions& rhs) :
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 @@ BreakpointOptions::operator=(const BreakpointOptions& rhs)
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 @@ BreakpointOptions::GetBaton ()
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,19 +151,26 @@ BreakpointOptions::SetIgnoreCount (int32_t n)
m_ignore_count = n;
}
-void
-BreakpointOptions::SetThreadID (lldb::tid_t thread_id)
+const ThreadSpec *
+BreakpointOptions::GetThreadSpec () const
{
- m_thread_id = thread_id;
+ return m_thread_spec_ap.get();
}
-lldb::tid_t
-BreakpointOptions::GetThreadID () const
+ThreadSpec *
+BreakpointOptions::GetThreadSpec ()
{
- return m_thread_id;
+ 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)
+{
+ GetThreadSpec()->SetTID(thread_id);
+}
void
BreakpointOptions::CommandBaton::GetDescription (Stream *s, lldb::DescriptionLevel level) const
OpenPOWER on IntegriCloud