summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-01-15 01:41:04 +0000
committerJim Ingham <jingham@apple.com>2015-01-15 01:41:04 +0000
commitd762df8c2478a6bf9ac1f40787c77f7b9dd38f02 (patch)
tree952ea8add5ee23ed6270f37561f733954d37daf2 /lldb/source/Breakpoint
parentf90907207302f08c2176fabe14ed77ebf158aca1 (diff)
downloadbcm5719-llvm-d762df8c2478a6bf9ac1f40787c77f7b9dd38f02.tar.gz
bcm5719-llvm-d762df8c2478a6bf9ac1f40787c77f7b9dd38f02.zip
Make sure that when a breakpoint is hit but its condition is not met,
the hit count is not updated. Also, keep the hit count for the breakpoint in the breakpoint. We were using just the sum of the location's hit counts, but that was wrong since if a shared library is unloaded, and the location goes away, the breakpoint hit count should not suddenly drop by the number of hits there were on that location. llvm-svn: 226074
Diffstat (limited to 'lldb/source/Breakpoint')
-rw-r--r--lldb/source/Breakpoint/Breakpoint.cpp8
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp15
-rw-r--r--lldb/source/Breakpoint/StoppointLocation.cpp7
3 files changed, 27 insertions, 3 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index bc269cdb95a..beb0f6bc5a6 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -60,7 +60,8 @@ Breakpoint::Breakpoint(Target &target,
m_resolver_sp (resolver_sp),
m_options (),
m_locations (*this),
- m_resolve_indirect_symbols(resolve_indirect_symbols)
+ m_resolve_indirect_symbols(resolve_indirect_symbols),
+ m_hit_count(0)
{
m_being_created = false;
}
@@ -72,7 +73,8 @@ Breakpoint::Breakpoint (Target &new_target, Breakpoint &source_bp) :
m_name_list (source_bp.m_name_list),
m_options (source_bp.m_options),
m_locations(*this),
- m_resolve_indirect_symbols(source_bp.m_resolve_indirect_symbols)
+ m_resolve_indirect_symbols(source_bp.m_resolve_indirect_symbols),
+ m_hit_count(0)
{
// Now go through and copy the filter & resolver:
m_resolver_sp = source_bp.m_resolver_sp->CopyForBreakpoint(*this);
@@ -207,7 +209,7 @@ Breakpoint::IgnoreCountShouldStop ()
uint32_t
Breakpoint::GetHitCount () const
{
- return m_locations.GetHitCount();
+ return m_hit_count;
}
bool
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index 11ecfecc5bc..85233c9374c 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -477,7 +477,22 @@ void
BreakpointLocation::BumpHitCount()
{
if (IsEnabled())
+ {
+ // Step our hit count, and also step the hit count of the owner.
IncrementHitCount();
+ m_owner.IncrementHitCount();
+ }
+}
+
+void
+BreakpointLocation::UndoBumpHitCount()
+{
+ if (IsEnabled())
+ {
+ // Step our hit count, and also step the hit count of the owner.
+ DecrementHitCount();
+ m_owner.DecrementHitCount();
+ }
}
bool
diff --git a/lldb/source/Breakpoint/StoppointLocation.cpp b/lldb/source/Breakpoint/StoppointLocation.cpp
index 9d8d9241253..35e5979bd9e 100644
--- a/lldb/source/Breakpoint/StoppointLocation.cpp
+++ b/lldb/source/Breakpoint/StoppointLocation.cpp
@@ -46,3 +46,10 @@ StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, uint32_t byte
StoppointLocation::~StoppointLocation()
{
}
+
+void
+StoppointLocation::DecrementHitCount ()
+{
+ assert (m_hit_count > 0);
+ --m_hit_count;
+}
OpenPOWER on IntegriCloud