forked from qt-creator/qt-creator
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:
@@ -540,7 +540,6 @@ public:
|
|||||||
"Move to Called Frame")};
|
"Move to Called Frame")};
|
||||||
QAction m_openMemoryEditorAction{QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
|
QAction m_openMemoryEditorAction{QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
|
||||||
"Memory...")};
|
"Memory...")};
|
||||||
|
|
||||||
// In the Debug menu.
|
// In the Debug menu.
|
||||||
QAction m_returnFromFunctionAction{tr("Immediately Return From Inner Function")};
|
QAction m_returnFromFunctionAction{tr("Immediately Return From Inner Function")};
|
||||||
QAction m_stepOverAction{tr("Step Over")};
|
QAction m_stepOverAction{tr("Step Over")};
|
||||||
|
@@ -52,6 +52,7 @@ const char FRAME_UP[] = "Debugger.FrameUp";
|
|||||||
const char FRAME_DOWN[] = "Debugger.FrameDown";
|
const char FRAME_DOWN[] = "Debugger.FrameDown";
|
||||||
const char QML_SHOW_APP_ON_TOP[] = "Debugger.QmlShowAppOnTop";
|
const char QML_SHOW_APP_ON_TOP[] = "Debugger.QmlShowAppOnTop";
|
||||||
const char QML_SELECTTOOL[] = "Debugger.QmlSelectTool";
|
const char QML_SELECTTOOL[] = "Debugger.QmlSelectTool";
|
||||||
|
const char RELOAD_DEBUGGING_HELPERS[] = "Debugger.ReloadDebuggingHelpers";
|
||||||
|
|
||||||
const char DEBUGGER_COMMON_SETTINGS_ID[] = "A.Debugger.General";
|
const char DEBUGGER_COMMON_SETTINGS_ID[] = "A.Debugger.General";
|
||||||
const char DEBUGGER_SETTINGS_CATEGORY[] = "O.Debugger";
|
const char DEBUGGER_SETTINGS_CATEGORY[] = "O.Debugger";
|
||||||
|
@@ -642,6 +642,7 @@ public:
|
|||||||
void attachToQmlPort();
|
void attachToQmlPort();
|
||||||
void runScheduled();
|
void runScheduled();
|
||||||
void attachCore();
|
void attachCore();
|
||||||
|
void reloadDebuggingHelpers();
|
||||||
|
|
||||||
void remoteCommand(const QStringList &options);
|
void remoteCommand(const QStringList &options);
|
||||||
|
|
||||||
@@ -683,6 +684,7 @@ public:
|
|||||||
QAction m_watchAction{tr("Add Expression Evaluator")};
|
QAction m_watchAction{tr("Add Expression Evaluator")};
|
||||||
Command *m_watchCommand = nullptr;
|
Command *m_watchCommand = nullptr;
|
||||||
QAction m_breakAction{tr("Toggle Breakpoint")};
|
QAction m_breakAction{tr("Toggle Breakpoint")};
|
||||||
|
QAction m_reloadDebuggingHelpersAction{tr("Reload Debugging Helpers")};
|
||||||
|
|
||||||
BreakpointManager m_breakpointManager;
|
BreakpointManager m_breakpointManager;
|
||||||
QString m_lastPermanentStatusMessage;
|
QString m_lastPermanentStatusMessage;
|
||||||
@@ -1115,6 +1117,10 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
|||||||
|
|
||||||
debugMenu->addSeparator();
|
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);
|
cmd = m_watchCommand = ActionManager::registerAction(&m_watchAction, Constants::WATCH);
|
||||||
debugMenu->addAction(cmd);
|
debugMenu->addAction(cmd);
|
||||||
|
|
||||||
@@ -1548,6 +1554,15 @@ void DebuggerPluginPrivate::attachCore()
|
|||||||
debugger->startRunControl();
|
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()
|
void DebuggerPluginPrivate::startRemoteCdbSession()
|
||||||
{
|
{
|
||||||
const QString connectionKey = "CdbRemoteConnection";
|
const QString connectionKey = "CdbRemoteConnection";
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "debuggercore.h"
|
#include "debuggercore.h"
|
||||||
#include "debuggerengine.h"
|
#include "debuggerengine.h"
|
||||||
#include "debuggericons.h"
|
#include "debuggericons.h"
|
||||||
|
#include "debuggerinternalconstants.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
@@ -46,6 +47,7 @@
|
|||||||
|
|
||||||
#include <app/app_version.h>
|
#include <app/app_version.h>
|
||||||
|
|
||||||
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
#include <coreplugin/minisplitter.h>
|
#include <coreplugin/minisplitter.h>
|
||||||
#include <coreplugin/find/basetextfind.h>
|
#include <coreplugin/find/basetextfind.h>
|
||||||
@@ -208,10 +210,6 @@ public:
|
|||||||
m_saveContentsAction->setEnabled(true);
|
m_saveContentsAction->setEnabled(true);
|
||||||
connect(m_saveContentsAction, &QAction::triggered,
|
connect(m_saveContentsAction, &QAction::triggered,
|
||||||
this, &DebuggerPane::saveContents);
|
this, &DebuggerPane::saveContents);
|
||||||
|
|
||||||
m_reloadDebuggingHelpersAction = new QAction(this);
|
|
||||||
m_reloadDebuggingHelpersAction->setText(tr("Reload Debugging Helpers"));
|
|
||||||
m_reloadDebuggingHelpersAction->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void contextMenuEvent(QContextMenuEvent *ev) override
|
void contextMenuEvent(QContextMenuEvent *ev) override
|
||||||
@@ -220,7 +218,7 @@ public:
|
|||||||
menu->addAction(m_clearContentsAction);
|
menu->addAction(m_clearContentsAction);
|
||||||
menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts
|
menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts
|
||||||
menu->addAction(debuggerSettings()->logTimeStamps.action());
|
menu->addAction(debuggerSettings()->logTimeStamps.action());
|
||||||
menu->addAction(m_reloadDebuggingHelpersAction);
|
menu->addAction(Core::ActionManager::command(Constants::RELOAD_DEBUGGING_HELPERS)->action());
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||||
menu->exec(ev->globalPos());
|
menu->exec(ev->globalPos());
|
||||||
@@ -255,14 +253,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QAction *clearContentsAction() const { return m_clearContentsAction; }
|
QAction *clearContentsAction() const { return m_clearContentsAction; }
|
||||||
QAction *reloadDebuggingHelpersAction() const { return m_reloadDebuggingHelpersAction; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void saveContents() { writeLogContents(this, this); }
|
void saveContents() { writeLogContents(this, this); }
|
||||||
|
|
||||||
QAction *m_clearContentsAction;
|
QAction *m_clearContentsAction;
|
||||||
QAction *m_saveContentsAction;
|
QAction *m_saveContentsAction;
|
||||||
QAction *m_reloadDebuggingHelpersAction;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -281,8 +277,6 @@ public:
|
|||||||
{
|
{
|
||||||
connect(clearContentsAction(), &QAction::triggered,
|
connect(clearContentsAction(), &QAction::triggered,
|
||||||
logWindow, &LogWindow::clearContents);
|
logWindow, &LogWindow::clearContents);
|
||||||
connect(reloadDebuggingHelpersAction(), &QAction::triggered,
|
|
||||||
logWindow->engine(), &DebuggerEngine::reloadDebuggingHelpers);
|
|
||||||
(void) new InputHighlighter(this);
|
(void) new InputHighlighter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,8 +345,6 @@ public:
|
|||||||
(void) new OutputHighlighter(this);
|
(void) new OutputHighlighter(this);
|
||||||
connect(clearContentsAction(), &QAction::triggered,
|
connect(clearContentsAction(), &QAction::triggered,
|
||||||
logWindow, &LogWindow::clearContents);
|
logWindow, &LogWindow::clearContents);
|
||||||
connect(reloadDebuggingHelpersAction(), &QAction::triggered,
|
|
||||||
logWindow->engine(), &DebuggerEngine::reloadDebuggingHelpers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gotoResult(int i)
|
void gotoResult(int i)
|
||||||
|
Reference in New Issue
Block a user