From 20904b2411bdce410d8dff79ca2918e3bbd9e772 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 31 Jan 2024 15:50:31 +0100 Subject: [PATCH] Debugger: Dont show invalid hit count The CDB Engine cannot report the hit count. Instead of showing "0", we don't show the hit count at all. Task-number: QTCREATORBUG-20069 Change-Id: Ie8b5478ba85c7255b13070cb488599a2b2ca4537 Reviewed-by: Reviewed-by: David Schulz --- src/plugins/debugger/breakhandler.cpp | 11 +++++++---- src/plugins/debugger/breakpoint.cpp | 3 ++- src/plugins/debugger/breakpoint.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 74626fbc863..a3f6cc2f11c 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -1940,10 +1940,13 @@ QString BreakpointItem::toolTip() const << "" << Tr::tr("Marker File:") << "" << markerFileName().toUserOutput() << "" << "" << Tr::tr("Marker Line:") - << "" << markerLineNumber() << "" - << "" << Tr::tr("Hit Count:") - << "" << m_parameters.hitCount << "" - << "
" + << ""; + if (m_parameters.hitCount) { + str << ""; + } + + str << "
" << markerLineNumber() << "
" << Tr::tr("Hit Count:") + << "" << *m_parameters.hitCount << "

" << ""; diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index 2fe9b2da368..4faf6a8a668 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -207,7 +207,8 @@ QString BreakpointParameters::toString() const ts << " [pending]"; if (!functionName.isEmpty()) ts << " Function: " << functionName; - ts << " Hit: " << hitCount << " times"; + if (hitCount) + ts << " Hit: " << *hitCount << " times"; ts << ' '; return result; diff --git a/src/plugins/debugger/breakpoint.h b/src/plugins/debugger/breakpoint.h index af96f43d055..4366139330b 100644 --- a/src/plugins/debugger/breakpoint.h +++ b/src/plugins/debugger/breakpoint.h @@ -155,7 +155,7 @@ public: bool oneShot; //!< Should this breakpoint trigger only once? bool pending = true; //!< Breakpoint not fully resolved. - int hitCount = 0; //!< Number of times this has been hit. + std::optional hitCount; //!< Number of times this has been hit. }; } // namespace Internal
" << Tr::tr("Property") << "" << Tr::tr("Requested") << "" << Tr::tr("Obtained") << "