[Lldb-commits] [lldb] r106268 - in /lldb/trunk: include/lldb/API/SBBreakpoint.h include/lldb/API/SBBreakpointLocation.h source/API/SBBreakpoint.cpp source/API/SBBreakpointLocation.cpp

Jim Ingham jingham at apple.com
Thu Jun 17 18:47:08 PDT 2010


Author: jingham
Date: Thu Jun 17 20:47:08 2010
New Revision: 106268

URL: http://llvm.org/viewvc/llvm-project?rev=106268&view=rev
Log:
Adding setting thread specific breakpoints by name, ID, index & queue name to the SB interfaces.

Modified:
    lldb/trunk/include/lldb/API/SBBreakpoint.h
    lldb/trunk/include/lldb/API/SBBreakpointLocation.h
    lldb/trunk/source/API/SBBreakpoint.cpp
    lldb/trunk/source/API/SBBreakpointLocation.cpp

Modified: lldb/trunk/include/lldb/API/SBBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpoint.h?rev=106268&r1=106267&r2=106268&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBreakpoint.h (original)
+++ lldb/trunk/include/lldb/API/SBBreakpoint.h Thu Jun 17 20:47:08 2010
@@ -79,6 +79,24 @@
 
     lldb::tid_t
     GetThreadID ();
+    
+    void
+    SetThreadIndex (uint32_t index);
+    
+    uint32_t
+    GetThreadIndex() const;
+    
+    void
+    SetThreadName (const char *thread_name);
+    
+    const char *
+    GetThreadName () const;
+    
+    void 
+    SetQueueName (const char *queue_name);
+    
+    const char *
+    GetQueueName () const;
 
     void
     SetCallback (BreakpointHitCallback callback, void *baton);

Modified: lldb/trunk/include/lldb/API/SBBreakpointLocation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpointLocation.h?rev=106268&r1=106267&r2=106268&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBreakpointLocation.h (original)
+++ lldb/trunk/include/lldb/API/SBBreakpointLocation.h Thu Jun 17 20:47:08 2010
@@ -42,10 +42,28 @@
     SetIgnoreCount (int32_t n);
 
     void
-    SetThreadID (lldb::tid_t thread_id);
+    SetThreadID (lldb::tid_t sb_thread_id);
 
     lldb::tid_t
     GetThreadID ();
+    
+    void
+    SetThreadIndex (uint32_t index);
+    
+    uint32_t
+    GetThreadIndex() const;
+    
+    void
+    SetThreadName (const char *thread_name);
+    
+    const char *
+    GetThreadName () const;
+    
+    void 
+    SetQueueName (const char *queue_name);
+    
+    const char *
+    GetQueueName () const;
 
     bool
     IsResolved ();

Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=106268&r1=106267&r2=106268&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Thu Jun 17 20:47:08 2010
@@ -20,8 +20,9 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Target/Process.h"
-#include "lldb/Target/Thread.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Target/ThreadSpec.h"
 
 
 #include "lldb/lldb-enumerations.h"
@@ -276,6 +277,70 @@
     return lldb_thread_id;
 }
 
+void
+SBBreakpoint::SetThreadIndex (uint32_t index)
+{
+    if (m_break_sp)
+        m_break_sp->GetOptions()->GetThreadSpec()->SetIndex (index);
+}
+
+uint32_t
+SBBreakpoint::GetThreadIndex() const
+{
+    if (m_break_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_sp->GetOptions()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return 0;
+        else
+            return thread_spec->GetIndex();
+    }
+    return 0;
+}
+    
+
+void
+SBBreakpoint::SetThreadName (const char *thread_name)
+{
+    if (m_break_sp)
+        m_break_sp->GetOptions()->GetThreadSpec()->SetName (thread_name);
+}
+
+const char *
+SBBreakpoint::GetThreadName () const
+{
+    if (m_break_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_sp->GetOptions()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return NULL;
+        else
+            return thread_spec->GetName();
+    }
+    return NULL;
+}
+
+void
+SBBreakpoint::SetQueueName (const char *queue_name)
+{
+    if (m_break_sp)
+        m_break_sp->GetOptions()->GetThreadSpec()->SetQueueName (queue_name);
+}
+
+const char *
+SBBreakpoint::GetQueueName () const
+{
+    if (m_break_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_sp->GetOptions()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return NULL;
+        else
+            return thread_spec->GetQueueName();
+    }
+    return NULL;
+}
+
 size_t
 SBBreakpoint::GetNumResolvedLocations() const
 {

Modified: lldb/trunk/source/API/SBBreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpointLocation.cpp?rev=106268&r1=106267&r2=106268&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpointLocation.cpp (original)
+++ lldb/trunk/source/API/SBBreakpointLocation.cpp Thu Jun 17 20:47:08 2010
@@ -17,6 +17,7 @@
 #include "lldb/Target/ThreadSpec.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamFile.h"
+#include "lldb/Target/ThreadSpec.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -108,6 +109,70 @@
     return sb_thread_id;
 }
 
+void
+SBBreakpointLocation::SetThreadIndex (uint32_t index)
+{
+    if (m_break_loc_sp)
+        m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetIndex (index);
+}
+
+uint32_t
+SBBreakpointLocation::GetThreadIndex() const
+{
+    if (m_break_loc_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCopy()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return 0;
+        else
+            return thread_spec->GetIndex();
+    }
+    return 0;
+}
+    
+
+void
+SBBreakpointLocation::SetThreadName (const char *thread_name)
+{
+    if (m_break_loc_sp)
+        m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetName (thread_name);
+}
+
+const char *
+SBBreakpointLocation::GetThreadName () const
+{
+    if (m_break_loc_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCopy()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return NULL;
+        else
+            return thread_spec->GetName();
+    }
+    return NULL;
+}
+
+void
+SBBreakpointLocation::SetQueueName (const char *queue_name)
+{
+    if (m_break_loc_sp)
+        m_break_loc_sp->GetLocationOptions()->GetThreadSpec()->SetQueueName (queue_name);
+}
+
+const char *
+SBBreakpointLocation::GetQueueName () const
+{
+    if (m_break_loc_sp)
+    {
+        const ThreadSpec *thread_spec = m_break_loc_sp->GetOptionsNoCopy()->GetThreadSpec();
+        if (thread_spec == NULL)
+            return NULL;
+        else
+            return thread_spec->GetQueueName();
+    }
+    return NULL;
+}
+
 bool
 SBBreakpointLocation::IsResolved ()
 {





More information about the lldb-commits mailing list