Debugger: Register "Reload Debugging Helper" action

This allows assigning shortcuts via Tools->Options, Environment,
Keyboard Shortcuts

Fixes: QTCREATORBUG-25900
Change-Id: I6dfa6b0f3ff12ad971444b2d3adb427c8acf783c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-06-23 11:24:42 +02:00
parent 10af72100d
commit 1955c82d5c
4 changed files with 19 additions and 12 deletions

View File

@@ -642,6 +642,7 @@ public:
void attachToQmlPort();
void runScheduled();
void attachCore();
void reloadDebuggingHelpers();
void remoteCommand(const QStringList &options);
@@ -683,6 +684,7 @@ public:
QAction m_watchAction{tr("Add Expression Evaluator")};
Command *m_watchCommand = nullptr;
QAction m_breakAction{tr("Toggle Breakpoint")};
QAction m_reloadDebuggingHelpersAction{tr("Reload Debugging Helpers")};
BreakpointManager m_breakpointManager;
QString m_lastPermanentStatusMessage;
@@ -1115,6 +1117,10 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
debugMenu->addSeparator();
ActionManager::registerAction(&m_reloadDebuggingHelpersAction, Constants::RELOAD_DEBUGGING_HELPERS);
connect(&m_reloadDebuggingHelpersAction, &QAction::triggered,
this, &DebuggerPluginPrivate::reloadDebuggingHelpers);
cmd = m_watchCommand = ActionManager::registerAction(&m_watchAction, Constants::WATCH);
debugMenu->addAction(cmd);
@@ -1548,6 +1554,15 @@ void DebuggerPluginPrivate::attachCore()
debugger->startRunControl();
}
void DebuggerPluginPrivate::reloadDebuggingHelpers()
{
if (DebuggerEngine *engine = EngineManager::currentEngine())
engine->reloadDebuggingHelpers();
else
DebuggerMainWindow::showStatusMessage(
tr("Reload debugging helpers skipped as no engine is running."), 5000);
}
void DebuggerPluginPrivate::startRemoteCdbSession()
{
const QString connectionKey = "CdbRemoteConnection";