forked from qt-creator/qt-creator
debugger: introduce "expert mode" for rarely used start modes
Change-Id: Ic249a9e745dde926f789a12670a58406a48f8223 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -473,6 +473,13 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
insertItem(RegisterForPostMortem, item);
|
||||
#endif
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("ProvideMoreStartOptions"));
|
||||
item->setText(tr("Provide More Options to Start Debugging"));
|
||||
item->setCheckable(true);
|
||||
item->setDefaultValue(false);
|
||||
insertItem(ProvideMoreStartModes, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("AllPluginBreakpoints"));
|
||||
item->setDefaultValue(true);
|
||||
|
||||
@@ -114,6 +114,7 @@ enum DebuggerActionCode
|
||||
UseAddressInStackView,
|
||||
|
||||
RegisterForPostMortem,
|
||||
ProvideMoreStartModes,
|
||||
|
||||
// Gdb
|
||||
LoadGdbInit,
|
||||
|
||||
@@ -518,7 +518,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Misc
|
||||
@@ -670,6 +669,14 @@ public slots:
|
||||
m_returnWindow->header()->resizeSection(section, newSize);
|
||||
}
|
||||
|
||||
void setExpertMode(bool on)
|
||||
{
|
||||
m_startLocalProcessAction->setVisible(on);
|
||||
m_attachToRemoteServerAction->setVisible(on);
|
||||
m_startRemoteProcessAction->setVisible(on);
|
||||
m_startRemoteServerAction->setVisible(on);
|
||||
}
|
||||
|
||||
void sourceFilesDockToggled(bool on)
|
||||
{
|
||||
if (on && m_currentEngine->state() == InferiorStopOk)
|
||||
@@ -1039,7 +1046,7 @@ public:
|
||||
Utils::ProxyAction *m_hiddenStopAction;
|
||||
QAction *m_startAction;
|
||||
QAction *m_debugWithoutDeployAction;
|
||||
QAction *m_startExternalProcessAction;
|
||||
QAction *m_startLocalProcessAction;
|
||||
QAction *m_startRemoteProcessAction;
|
||||
QAction *m_startRemoteServerAction;
|
||||
QAction *m_attachToRemoteProcessAction;
|
||||
@@ -1047,7 +1054,7 @@ public:
|
||||
QAction *m_attachToRemoteServerAction;
|
||||
QAction *m_startRemoteCdbAction;
|
||||
QAction *m_startRemoteLldbAction;
|
||||
QAction *m_attachExternalAction;
|
||||
QAction *m_attachToLocalProcessAction;
|
||||
QAction *m_attachToCoreAction;
|
||||
QAction *m_detachAction;
|
||||
QAction *m_continueAction;
|
||||
@@ -1160,14 +1167,14 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
|
||||
m_reverseToolButton = 0;
|
||||
m_startAction = 0;
|
||||
m_debugWithoutDeployAction = 0;
|
||||
m_startExternalProcessAction = 0;
|
||||
m_startLocalProcessAction = 0;
|
||||
m_startRemoteProcessAction = 0;
|
||||
m_attachToRemoteServerAction = 0;
|
||||
//m_attachToRemoteProcessAction = 0;
|
||||
m_attachToRemoteProcessAction = 0;
|
||||
m_attachToQmlPortAction = 0;
|
||||
m_startRemoteCdbAction = 0;
|
||||
m_startRemoteLldbAction = 0;
|
||||
m_attachExternalAction = 0;
|
||||
m_attachToLocalProcessAction = 0;
|
||||
m_attachToCoreAction = 0;
|
||||
m_detachAction = 0;
|
||||
|
||||
@@ -2181,13 +2188,13 @@ void DebuggerPluginPrivate::setInitialState()
|
||||
m_reverseDirectionAction->setEnabled(false);
|
||||
m_toolTipManager->closeAllToolTips();
|
||||
|
||||
m_startExternalProcessAction->setEnabled(true);
|
||||
m_attachExternalAction->setEnabled(true);
|
||||
m_startLocalProcessAction->setEnabled(true);
|
||||
m_attachToLocalProcessAction->setEnabled(true);
|
||||
m_attachToQmlPortAction->setEnabled(true);
|
||||
m_attachToCoreAction->setEnabled(true);
|
||||
m_startRemoteProcessAction->setEnabled(true);
|
||||
m_attachToRemoteServerAction->setEnabled(true);
|
||||
//m_attachToRemoteProcessAction->setEnabled(true);
|
||||
m_attachToRemoteProcessAction->setEnabled(true);
|
||||
m_detachAction->setEnabled(false);
|
||||
|
||||
m_watchAction1->setEnabled(true);
|
||||
@@ -2306,9 +2313,9 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_hiddenStopAction->setAction(m_undisturbableAction);
|
||||
}
|
||||
|
||||
m_startExternalProcessAction->setEnabled(true);
|
||||
m_startLocalProcessAction->setEnabled(true);
|
||||
m_attachToQmlPortAction->setEnabled(true);
|
||||
m_attachExternalAction->setEnabled(true);
|
||||
m_attachToLocalProcessAction->setEnabled(true);
|
||||
m_attachToCoreAction->setEnabled(true);
|
||||
m_startRemoteProcessAction->setEnabled(true);
|
||||
m_attachToRemoteServerAction->setEnabled(true);
|
||||
@@ -2859,7 +2866,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
|
||||
const Context globalcontext(CC::C_GLOBAL);
|
||||
const Context cppDebuggercontext(C_CPPDEBUGGER);
|
||||
const Context qmlDebuggerContext(C_QMLDEBUGGER);
|
||||
const Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
|
||||
|
||||
m_startIcon = QIcon(_(":/debugger/images/debugger_start_small.png"));
|
||||
@@ -3059,11 +3065,11 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
connect(act, SIGNAL(triggered()), this, SLOT(debugProject()));
|
||||
|
||||
act = m_debugWithoutDeployAction = new QAction(this);
|
||||
act->setText(tr("Debug Without Deployment"));
|
||||
act->setText(tr("Start Debugging Without Deployment"));
|
||||
connect(act, SIGNAL(triggered()), this, SLOT(debugProjectWithoutDeploy()));
|
||||
|
||||
// Handling of external applications.
|
||||
act = m_startExternalProcessAction = new QAction(this);
|
||||
act = m_startLocalProcessAction = new QAction(this);
|
||||
act->setText(tr("Start and Debug External Application..."));
|
||||
connect(act, SIGNAL(triggered()), SLOT(startExternalApplication()));
|
||||
|
||||
@@ -3073,12 +3079,12 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
connect(act, SIGNAL(triggered()), SLOT(startRemoteEngine()));
|
||||
#endif
|
||||
|
||||
act = m_attachExternalAction = new QAction(this);
|
||||
act->setText(tr("Attach to Running External Application..."));
|
||||
act = m_attachToLocalProcessAction = new QAction(this);
|
||||
act->setText(tr("Attach to Running Local Application..."));
|
||||
connect(act, SIGNAL(triggered()), SLOT(attachExternalApplication()));
|
||||
|
||||
act = m_attachToCoreAction = new QAction(this);
|
||||
act->setText(tr("Attach to Core..."));
|
||||
act->setText(tr("Load Core File..."));
|
||||
connect(act, SIGNAL(triggered()), SLOT(attachCore()));
|
||||
|
||||
act = m_startRemoteProcessAction = new QAction(this);
|
||||
@@ -3141,15 +3147,15 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
|
||||
|
||||
cmd = am->registerAction(m_attachExternalAction,
|
||||
"Debugger.AttachExternal", globalcontext);
|
||||
cmd = am->registerAction(m_attachToLocalProcessAction,
|
||||
"Debugger.AttachToLocalProcess", globalcontext);
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
mstart->addAction(cmd, Constants::G_START_LOCAL);
|
||||
|
||||
cmd = am->registerAction(m_startExternalProcessAction,
|
||||
"Debugger.StartExternal", globalcontext);
|
||||
cmd = am->registerAction(m_startLocalProcessAction,
|
||||
"Debugger.StartLocalProcess", globalcontext);
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
mstart->addAction(cmd, Constants::G_START_LOCAL);
|
||||
mstart->addAction(cmd, Debugger::Constants::G_START_LOCAL);
|
||||
|
||||
cmd = am->registerAction(m_attachToCoreAction,
|
||||
"Debugger.AttachCore", globalcontext);
|
||||
@@ -3164,12 +3170,12 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
cmd = am->registerAction(m_startRemoteProcessAction,
|
||||
"Debugger.StartRemoteProcess", globalcontext);
|
||||
cmd->setAttribute(Command::CA_Hide);
|
||||
mstart->addAction(cmd, Constants::G_AUTOMATIC_REMOTE);
|
||||
mstart->addAction(cmd, Constants::G_MANUAL_REMOTE);
|
||||
|
||||
cmd = am->registerAction(m_startRemoteServerAction,
|
||||
"Debugger.StartRemoteServer", globalcontext);
|
||||
cmd->setDefaultText(tr("Start Gdbserver"));
|
||||
mstart->addAction(cmd, Debugger::Constants::G_MANUAL_REMOTE);
|
||||
mstart->addAction(cmd, Constants::G_MANUAL_REMOTE);
|
||||
|
||||
cmd = am->registerAction(m_attachToRemoteProcessAction,
|
||||
"Debugger.AttachToRemoteProcess", globalcontext);
|
||||
@@ -3465,6 +3471,10 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
m_watchersWindow->setVisible(false);
|
||||
m_returnWindow->setVisible(false);
|
||||
|
||||
connect(action(ProvideMoreStartModes), SIGNAL(toggled(bool)),
|
||||
SLOT(setExpertMode(bool)));
|
||||
setExpertMode(boolSetting(ProvideMoreStartModes));
|
||||
|
||||
// time gdb -i mi -ex 'b debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin
|
||||
if (!m_scheduledStarts.isEmpty())
|
||||
QTimer::singleShot(0, this, SLOT(runScheduled()));
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
QCheckBox *checkBoxLoadGdbInit;
|
||||
QLabel *labelDangerous;
|
||||
QCheckBox *checkBoxTargetAsync;
|
||||
QCheckBox *checkBoxProvideMoreStartModes;
|
||||
QCheckBox *checkBoxAutoEnrichParameters;
|
||||
QCheckBox *checkBoxBreakOnWarning;
|
||||
QCheckBox *checkBoxBreakOnFatal;
|
||||
@@ -144,6 +145,10 @@ public:
|
||||
"This allows or inhibits reading the user's default\n"
|
||||
".gdbinit file on debugger startup."));
|
||||
|
||||
checkBoxProvideMoreStartModes = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxProvideMoreStartModes->setText(GdbOptionsPage::tr(
|
||||
"Show more start modes in the Debug->Start Debugging menu"));
|
||||
|
||||
labelDangerous = new QLabel(GdbOptionsPage::tr(
|
||||
"The options below should be used with care."));
|
||||
|
||||
@@ -211,6 +216,8 @@ public:
|
||||
formLayout->addRow(checkBoxAdjustBreakpointLocations);
|
||||
formLayout->addRow(checkBoxUseDynamicType);
|
||||
formLayout->addRow(checkBoxLoadGdbInit);
|
||||
formLayout->addRow(checkBoxProvideMoreStartModes);
|
||||
formLayout->addRow(new QLabel(QString()));
|
||||
formLayout->addRow(labelDangerous);
|
||||
formLayout->addRow(checkBoxTargetAsync);
|
||||
formLayout->addRow(checkBoxAutoEnrichParameters);
|
||||
@@ -286,6 +293,8 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
|
||||
m_ui->checkBoxUseDynamicType);
|
||||
m_group.insert(debuggerCore()->action(TargetAsync),
|
||||
m_ui->checkBoxTargetAsync);
|
||||
m_group.insert(debuggerCore()->action(ProvideMoreStartModes),
|
||||
m_ui->checkBoxProvideMoreStartModes);
|
||||
m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
|
||||
m_ui->checkBoxAdjustBreakpointLocations);
|
||||
m_group.insert(debuggerCore()->action(BreakOnWarning),
|
||||
@@ -316,6 +325,7 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
|
||||
<< sep << m_ui->groupBoxGeneral->title()
|
||||
<< sep << m_ui->checkBoxLoadGdbInit->text()
|
||||
<< sep << m_ui->checkBoxTargetAsync->text()
|
||||
<< sep << m_ui->checkBoxProvideMoreStartModes->text()
|
||||
<< sep << m_ui->checkBoxUseDynamicType->text()
|
||||
<< sep << m_ui->labelGdbWatchdogTimeout->text()
|
||||
<< sep << m_ui->checkBoxEnableReverseDebugging->text()
|
||||
|
||||
Reference in New Issue
Block a user