[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.

Bruce Mitchener via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 23 06:41:52 PDT 2017


brucem created this revision.

SBBreakpointLocation exposed the ignore count, but didn't expose
the hit count. Both values were exposed by SBBreakpoint and
SBWatchpoint, so this makes things a bit more consistent.


https://reviews.llvm.org/D31283

Files:
  include/lldb/API/SBBreakpointLocation.h
  scripts/interface/SBBreakpointLocation.i
  source/API/SBBreakpointLocation.cpp


Index: source/API/SBBreakpointLocation.cpp
===================================================================
--- source/API/SBBreakpointLocation.cpp
+++ source/API/SBBreakpointLocation.cpp
@@ -100,6 +100,16 @@
     return false;
 }
 
+uint32_t SBBreakpointLocation::GetHitCount() {
+  BreakpointLocationSP loc_sp = GetSP();
+  if (loc_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        loc_sp->GetTarget().GetAPIMutex());
+    return loc_sp->GetHitCount();
+  } else
+    return 0;
+}
+
 uint32_t SBBreakpointLocation::GetIgnoreCount() {
   BreakpointLocationSP loc_sp = GetSP();
   if (loc_sp) {
Index: scripts/interface/SBBreakpointLocation.i
===================================================================
--- scripts/interface/SBBreakpointLocation.i
+++ scripts/interface/SBBreakpointLocation.i
@@ -48,6 +48,9 @@
     IsEnabled ();
 
     uint32_t
+    GetHitCount ();
+
+    uint32_t
     GetIgnoreCount ();
 
     void
Index: include/lldb/API/SBBreakpointLocation.h
===================================================================
--- include/lldb/API/SBBreakpointLocation.h
+++ include/lldb/API/SBBreakpointLocation.h
@@ -38,6 +38,8 @@
 
   bool IsEnabled();
 
+  uint32_t GetHitCount();
+
   uint32_t GetIgnoreCount();
 
   void SetIgnoreCount(uint32_t n);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31283.92787.patch
Type: text/x-patch
Size: 1288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170323/53131d12/attachment.bin>


More information about the lldb-commits mailing list