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: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-01-31 15:50:31 +01:00
parent 6d22196dd1
commit 20904b2411
3 changed files with 10 additions and 6 deletions

View File

@@ -1940,10 +1940,13 @@ QString BreakpointItem::toolTip() const
<< "<tr><td>" << Tr::tr("Marker File:") << "<tr><td>" << Tr::tr("Marker File:")
<< "</td><td>" << markerFileName().toUserOutput() << "</td></tr>" << "</td><td>" << markerFileName().toUserOutput() << "</td></tr>"
<< "<tr><td>" << Tr::tr("Marker Line:") << "<tr><td>" << Tr::tr("Marker Line:")
<< "</td><td>" << markerLineNumber() << "</td></tr>" << "</td><td>" << markerLineNumber() << "</td></tr>";
<< "<tr><td>" << Tr::tr("Hit Count:") if (m_parameters.hitCount) {
<< "</td><td>" << m_parameters.hitCount << "</td></tr>" str << "<tr><td>" << Tr::tr("Hit Count:")
<< "</table><br><table>" << "</td><td>" << *m_parameters.hitCount << "</td></tr>";
}
str << "</table><br><table>"
<< "<tr><th>" << Tr::tr("Property") << "<tr><th>" << Tr::tr("Property")
<< "</th><th>" << Tr::tr("Requested") << "</th><th>" << Tr::tr("Requested")
<< "</th><th>" << Tr::tr("Obtained") << "</th></tr>"; << "</th><th>" << Tr::tr("Obtained") << "</th></tr>";

View File

@@ -207,7 +207,8 @@ QString BreakpointParameters::toString() const
ts << " [pending]"; ts << " [pending]";
if (!functionName.isEmpty()) if (!functionName.isEmpty())
ts << " Function: " << functionName; ts << " Function: " << functionName;
ts << " Hit: " << hitCount << " times"; if (hitCount)
ts << " Hit: " << *hitCount << " times";
ts << ' '; ts << ' ';
return result; return result;

View File

@@ -155,7 +155,7 @@ public:
bool oneShot; //!< Should this breakpoint trigger only once? bool oneShot; //!< Should this breakpoint trigger only once?
bool pending = true; //!< Breakpoint not fully resolved. bool pending = true; //!< Breakpoint not fully resolved.
int hitCount = 0; //!< Number of times this has been hit. std::optional<int> hitCount; //!< Number of times this has been hit.
}; };
} // namespace Internal } // namespace Internal