[Lldb-commits] [lldb] r121896 - in /lldb/trunk/source: API/SBBreakpoint.cpp Target/ThreadSpec.cpp

Greg Clayton gclayton at apple.com
Wed Dec 15 12:50:06 PST 2010


Author: gclayton
Date: Wed Dec 15 14:50:06 2010
New Revision: 121896

URL: http://llvm.org/viewvc/llvm-project?rev=121896&view=rev
Log:
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 <string.h>!

Modified:
    lldb/trunk/source/API/SBBreakpoint.cpp
    lldb/trunk/source/Target/ThreadSpec.cpp

Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=121896&r1=121895&r2=121896&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Wed Dec 15 14:50:06 2010
@@ -310,7 +310,7 @@
 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 @@
     }
     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;
 }
     
 

Modified: lldb/trunk/source/Target/ThreadSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadSpec.cpp?rev=121896&r1=121895&r2=121896&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadSpec.cpp (original)
+++ lldb/trunk/source/Target/ThreadSpec.cpp Wed Dec 15 14:50:06 2010
@@ -14,7 +14,7 @@
 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 @@
 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 @@
             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();





More information about the lldb-commits mailing list