From bdf4c6ac4f76b2ee32c848162a897c82c29ab499 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 15 Dec 2010 20:50:06 +0000 Subject: [PATCH] Fixed an error where the thread index was being returned as zero in "uint32_t SBBreakpoint::GetThreadIndex() const" even when it isn't specified. It should be UINT32_MAX to indicate there is no thread index set for the breakpoint (the breakpoint isn't thread specific). Also fixed the ThreadSpec.cpp to use UINT32_MAX instead of -1. Fixed the logging Printf statement in "uint32_t SBBreakpoint::GetThreadIndex() const" to not print the address of the "index" function from ! llvm-svn: 121896 --- lldb/source/API/SBBreakpoint.cpp | 6 +++--- lldb/source/Target/ThreadSpec.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp index f2dccf935194..238229c5108c 100644 --- a/lldb/source/API/SBBreakpoint.cpp +++ b/lldb/source/API/SBBreakpoint.cpp @@ -310,7 +310,7 @@ SBBreakpoint::SetThreadIndex (uint32_t index) uint32_t SBBreakpoint::GetThreadIndex() const { - uint32_t thread_idx = 0; + uint32_t thread_idx = UINT32_MAX; if (m_opaque_sp) { const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec(); @@ -319,9 +319,9 @@ SBBreakpoint::GetThreadIndex() const } LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); if (log) - log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), index); + log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), thread_idx); - return 0; + return UINT32_MAX; } diff --git a/lldb/source/Target/ThreadSpec.cpp b/lldb/source/Target/ThreadSpec.cpp index e29655826887..07abf595c8d5 100644 --- a/lldb/source/Target/ThreadSpec.cpp +++ b/lldb/source/Target/ThreadSpec.cpp @@ -14,7 +14,7 @@ using namespace lldb; using namespace lldb_private; ThreadSpec::ThreadSpec() : - m_index (-1), + m_index (UINT32_MAX), m_tid (LLDB_INVALID_THREAD_ID), m_name(), m_queue_name () @@ -83,7 +83,7 @@ ThreadSpec::ThreadPassesBasicTests (Thread *thread) const bool ThreadSpec::HasSpecification() const { - return (m_index != -1 || m_tid != LLDB_INVALID_THREAD_ID || !m_name.empty() || !m_queue_name.empty()); + return (m_index != UINT32_MAX || m_tid != LLDB_INVALID_THREAD_ID || !m_name.empty() || !m_queue_name.empty()); } void ThreadSpec::GetDescription (Stream *s, lldb::DescriptionLevel level) const @@ -106,7 +106,7 @@ ThreadSpec::GetDescription (Stream *s, lldb::DescriptionLevel level) const if (GetTID() != LLDB_INVALID_THREAD_ID) s->Printf("tid: 0x%llx ", GetTID()); - if (GetIndex() != -1) + if (GetIndex() != UINT32_MAX) s->Printf("index: %d ", GetIndex()); const char *name = GetName();