diff options
Diffstat (limited to 'source/Breakpoint')
-rw-r--r-- | source/Breakpoint/Breakpoint.cpp | 8 | ||||
-rw-r--r-- | source/Breakpoint/BreakpointLocation.cpp | 15 | ||||
-rw-r--r-- | source/Breakpoint/StoppointLocation.cpp | 7 |
3 files changed, 27 insertions, 3 deletions
diff --git a/source/Breakpoint/Breakpoint.cpp b/source/Breakpoint/Breakpoint.cpp index bc269cdb95ac..beb0f6bc5a6e 100644 --- a/source/Breakpoint/Breakpoint.cpp +++ b/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/source/Breakpoint/BreakpointLocation.cpp b/source/Breakpoint/BreakpointLocation.cpp index 11ecfecc5bc7..85233c9374cb 100644 --- a/source/Breakpoint/BreakpointLocation.cpp +++ b/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/source/Breakpoint/StoppointLocation.cpp b/source/Breakpoint/StoppointLocation.cpp index 9d8d9241253a..35e5979bd9e7 100644 --- a/source/Breakpoint/StoppointLocation.cpp +++ b/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; +} |