Debugger: Introduce a Ctrl-F9 shortcut to enable/disable breakpoints

Since "toggle" now becomes ambiguous, change "Toggle Breakpoint"
to "Set or Remove Breakpoint" and add a new "Enable or Disable
Breakpoint"

Fixes: QTCREATORBUG-26788
Change-Id: I7902308298570360af202fced90bf44fc1a59adb
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2022-01-03 10:30:08 +01:00
parent 32ed2df2f9
commit f2dea561ba
4 changed files with 53 additions and 18 deletions

View File

@@ -2490,7 +2490,7 @@ void BreakpointManager::createBreakpointForEngine(const BreakpointParameters &pa
engine->breakHandler()->tryClaimBreakpoint(gbp);
}
void BreakpointManager::toggleBreakpoint(const ContextData &location, const QString &tracePointMessage)
void BreakpointManager::setOrRemoveBreakpoint(const ContextData &location, const QString &tracePointMessage)
{
QTC_ASSERT(location.isValid(), return);
GlobalBreakpoint gbp = findBreakpointFromContext(location);
@@ -2517,6 +2517,15 @@ void BreakpointManager::toggleBreakpoint(const ContextData &location, const QStr
}
}
void BreakpointManager::enableOrDisableBreakpoint(const ContextData &location)
{
QTC_ASSERT(location.isValid(), return);
if (GlobalBreakpoint gbp = findBreakpointFromContext(location))
gbp->setEnabled(!gbp->isEnabled());
else
setOrRemoveBreakpoint(location);
}
GlobalBreakpoint BreakpointManager::findBreakpointFromContext(const ContextData &location)
{
int matchLevel = 0;