summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadSpec.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-03-07 22:03:04 +0000
committerJim Ingham <jingham@apple.com>2012-03-07 22:03:04 +0000
commit3d90292297690de3878cab4fd40f52d102cdc66b (patch)
treea33f96b7dac97a3aff2cda19c7e51ed3d8691afb /lldb/source/Target/ThreadSpec.cpp
parente761213428bb1ad8a8835ac4bf52233ae2121f3c (diff)
downloadbcm5719-llvm-3d90292297690de3878cab4fd40f52d102cdc66b.tar.gz
bcm5719-llvm-3d90292297690de3878cab4fd40f52d102cdc66b.zip
When comparing a Thread against a ThreadSpec, don't fetch the Thread's Name or QueueName if the ThreadSpec doesn't specify them.
llvm-svn: 152245
Diffstat (limited to 'lldb/source/Target/ThreadSpec.cpp')
-rw-r--r--lldb/source/Target/ThreadSpec.cpp46
1 files changed, 41 insertions, 5 deletions
diff --git a/lldb/source/Target/ThreadSpec.cpp b/lldb/source/Target/ThreadSpec.cpp
index 07abf595c8d..fda54546186 100644
--- a/lldb/source/Target/ThreadSpec.cpp
+++ b/lldb/source/Target/ThreadSpec.cpp
@@ -58,22 +58,58 @@ ThreadSpec::GetQueueName () const
}
bool
-ThreadSpec::ThreadPassesBasicTests (Thread *thread) const
+ThreadSpec::TIDMatches (Thread &thread) const
+{
+ if (m_tid == LLDB_INVALID_THREAD_ID)
+ return true;
+
+ lldb::tid_t thread_id = thread.GetID();
+ return TIDMatches (thread_id);
+}
+bool
+ThreadSpec::IndexMatches (Thread &thread) const
+{
+ if (m_index == UINT32_MAX)
+ return true;
+ uint32_t index = thread.GetIndexID();
+ return IndexMatches (index);
+}
+bool
+ThreadSpec::NameMatches (Thread &thread) const
+{
+ if (m_name.empty())
+ return true;
+
+ const char *name = thread.GetName();
+ return NameMatches (name);
+}
+bool
+ThreadSpec::QueueNameMatches (Thread &thread) const
+{
+ if (m_queue_name.empty())
+ return true;
+
+ const char *queue_name = thread.GetQueueName();
+ return QueueNameMatches (queue_name);
+}
+
+bool
+ThreadSpec::ThreadPassesBasicTests (Thread &thread) const
{
if (!HasSpecification())
return true;
- if (!TIDMatches(thread->GetID()))
+ if (!TIDMatches(thread))
return false;
- if (!IndexMatches(thread->GetIndexID()))
+ if (!IndexMatches(thread))
return false;
- if (!NameMatches (thread->GetName()))
+ if (!NameMatches (thread))
return false;
- if (!QueueNameMatches (thread->GetQueueName()))
+ if (!QueueNameMatches (thread))
return false;
return true;
OpenPOWER on IntegriCloud