summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-01-23 23:03:59 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-01-23 23:03:59 +0000
commitfab7a91d92f1af58b2cfd04d01d6a6080d49a66e (patch)
tree4af873b7306a1f4b8ae43250d0f62c603c9bb48c
parent820417af07eef55e6e68ea1761b655132b25f4c8 (diff)
downloadbcm5719-llvm-fab7a91d92f1af58b2cfd04d01d6a6080d49a66e.tar.gz
bcm5719-llvm-fab7a91d92f1af58b2cfd04d01d6a6080d49a66e.zip
Tiny refactoring to use member functions instead of directly accessing member fields.
llvm-svn: 148743
-rw-r--r--lldb/include/lldb/Breakpoint/StoppointLocation.h5
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointSite.cpp2
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp7
4 files changed, 11 insertions, 7 deletions
diff --git a/lldb/include/lldb/Breakpoint/StoppointLocation.h b/lldb/include/lldb/Breakpoint/StoppointLocation.h
index dbc4f961f87..7007d342960 100644
--- a/lldb/include/lldb/Breakpoint/StoppointLocation.h
+++ b/lldb/include/lldb/Breakpoint/StoppointLocation.h
@@ -70,7 +70,10 @@ public:
}
void
- IncrementHitCount ();
+ IncrementHitCount ()
+ {
+ ++m_hit_count;
+ }
uint32_t
GetHardwareIndex () const
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index 6693c469cc6..5d7206e2846 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -212,12 +212,12 @@ BreakpointLocation::ShouldStop (StoppointCallbackContext *context)
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:
diff --git a/lldb/source/Breakpoint/BreakpointSite.cpp b/lldb/source/Breakpoint/BreakpointSite.cpp
index 40489c86ab8..962117c27df 100644
--- a/lldb/source/Breakpoint/BreakpointSite.cpp
+++ b/lldb/source/Breakpoint/BreakpointSite.cpp
@@ -61,7 +61,7 @@ BreakpointSite::GetNextID()
bool
BreakpointSite::ShouldStop (StoppointCallbackContext *context)
{
- m_hit_count++;
+ IncrementHitCount();
return m_owners.ShouldStop (context);
}
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index e9b314b24ac..f33ec72f962 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -66,7 +66,8 @@ Watchpoint::SetDeclInfo (std::string &str)
return;
}
-
+// Override default impl of StoppointLocation::IsHardware() since m_is_hardware
+// member field is more accurate.
bool
Watchpoint::IsHardware () const
{
@@ -79,12 +80,12 @@ Watchpoint::IsHardware () const
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;
OpenPOWER on IntegriCloud