[Lldb-commits] [lldb] r148743 - in /lldb/trunk: include/lldb/Breakpoint/StoppointLocation.h source/Breakpoint/BreakpointLocation.cpp source/Breakpoint/BreakpointSite.cpp source/Breakpoint/Watchpoint.cpp

Johnny Chen johnny.chen at apple.com
Mon Jan 23 15:04:00 PST 2012


Author: johnny
Date: Mon Jan 23 17:03:59 2012
New Revision: 148743

URL: http://llvm.org/viewvc/llvm-project?rev=148743&view=rev
Log:
Tiny refactoring to use member functions instead of directly accessing member fields.

Modified:
    lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h
    lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
    lldb/trunk/source/Breakpoint/BreakpointSite.cpp
    lldb/trunk/source/Breakpoint/Watchpoint.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h?rev=148743&r1=148742&r2=148743&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h Mon Jan 23 17:03:59 2012
@@ -70,7 +70,10 @@
     }
 
     void
-    IncrementHitCount ();
+    IncrementHitCount ()
+    {
+        ++m_hit_count;
+    }
 
     uint32_t
     GetHardwareIndex () const

Modified: lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointLocation.cpp?rev=148743&r1=148742&r2=148743&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointLocation.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointLocation.cpp Mon Jan 23 17:03:59 2012
@@ -212,12 +212,12 @@
     bool should_stop = true;
     LogSP log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
 
-    m_hit_count++;
+    IncrementHitCount();
 
     if (!IsEnabled())
         return false;
 
-    if (m_hit_count <= GetIgnoreCount())
+    if (GetHitCount() <= GetIgnoreCount())
         return false;
 
     // We only run synchronous callbacks in ShouldStop:

Modified: lldb/trunk/source/Breakpoint/BreakpointSite.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointSite.cpp?rev=148743&r1=148742&r2=148743&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointSite.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointSite.cpp Mon Jan 23 17:03:59 2012
@@ -61,7 +61,7 @@
 bool
 BreakpointSite::ShouldStop (StoppointCallbackContext *context)
 {
-    m_hit_count++;
+    IncrementHitCount();
     return m_owners.ShouldStop (context);
 }
 

Modified: lldb/trunk/source/Breakpoint/Watchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Watchpoint.cpp?rev=148743&r1=148742&r2=148743&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/Watchpoint.cpp (original)
+++ lldb/trunk/source/Breakpoint/Watchpoint.cpp Mon Jan 23 17:03:59 2012
@@ -66,7 +66,8 @@
     return;
 }
 
-
+// Override default impl of StoppointLocation::IsHardware() since m_is_hardware
+// member field is more accurate.
 bool
 Watchpoint::IsHardware () const
 {
@@ -79,12 +80,12 @@
 bool
 Watchpoint::ShouldStop (StoppointCallbackContext *context)
 {
-    ++m_hit_count;
+    IncrementHitCount();
 
     if (!IsEnabled())
         return false;
 
-    if (m_hit_count <= GetIgnoreCount())
+    if (GetHitCount() <= GetIgnoreCount())
         return false;
 
     return true;





More information about the lldb-commits mailing list