forked from qt-creator/qt-creator
Debugger: allow user commands after attaching to a remote target
Change-Id: I365f34a8ddc6d895bb3fcb09bd991b24108d922b Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -396,6 +396,11 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
|||||||
item->setDefaultValue(QString());
|
item->setDefaultValue(QString());
|
||||||
insertItem(GdbStartupCommands, item);
|
insertItem(GdbStartupCommands, item);
|
||||||
|
|
||||||
|
item = new SavedAction(this);
|
||||||
|
item->setSettingsKey(debugModeGroup, QLatin1String("GdbPostAttachCommands"));
|
||||||
|
item->setDefaultValue(QString());
|
||||||
|
insertItem(GdbPostAttachCommands, item);
|
||||||
|
|
||||||
item = new SavedAction(this);
|
item = new SavedAction(this);
|
||||||
item->setSettingsKey(debugModeGroup, QLatin1String("CloseBuffersOnExit"));
|
item->setSettingsKey(debugModeGroup, QLatin1String("CloseBuffersOnExit"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ enum DebuggerActionCode
|
|||||||
LoadGdbInit,
|
LoadGdbInit,
|
||||||
AttemptQuickStart,
|
AttemptQuickStart,
|
||||||
GdbStartupCommands,
|
GdbStartupCommands,
|
||||||
|
GdbPostAttachCommands,
|
||||||
GdbWatchdogTimeout,
|
GdbWatchdogTimeout,
|
||||||
AutoEnrichParameters,
|
AutoEnrichParameters,
|
||||||
UseDynamicType,
|
UseDynamicType,
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public:
|
|||||||
|
|
||||||
QGroupBox *groupBoxStartupCommands;
|
QGroupBox *groupBoxStartupCommands;
|
||||||
QTextEdit *textEditStartupCommands;
|
QTextEdit *textEditStartupCommands;
|
||||||
|
QGroupBox *groupBoxPostAttachCommands;
|
||||||
|
QTextEdit *textEditPostAttachCommands;
|
||||||
|
|
||||||
//QGroupBox *groupBoxPluginDebugging;
|
//QGroupBox *groupBoxPluginDebugging;
|
||||||
//QRadioButton *radioButtonAllPluginBreakpoints;
|
//QRadioButton *radioButtonAllPluginBreakpoints;
|
||||||
@@ -221,6 +223,19 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
|||||||
textEditStartupCommands->setAcceptRichText(false);
|
textEditStartupCommands->setAcceptRichText(false);
|
||||||
textEditStartupCommands->setToolTip(groupBoxStartupCommands->toolTip());
|
textEditStartupCommands->setToolTip(groupBoxStartupCommands->toolTip());
|
||||||
|
|
||||||
|
groupBoxPostAttachCommands = new QGroupBox(this);
|
||||||
|
groupBoxPostAttachCommands->setTitle(GdbOptionsPage::tr("Additional Attach Commands"));
|
||||||
|
groupBoxPostAttachCommands->setToolTip(GdbOptionsPage::tr(
|
||||||
|
"<html><head/><body><p>GDB commands entered here will be executed after "
|
||||||
|
"GDB has successfully attached to remote targets.</p>"
|
||||||
|
"<p>You can add commands to further set up the target here, "
|
||||||
|
"such as \"monitor reset\" or \"load\"."
|
||||||
|
"</body></html>"));
|
||||||
|
|
||||||
|
textEditPostAttachCommands = new QTextEdit(groupBoxPostAttachCommands);
|
||||||
|
textEditPostAttachCommands->setAcceptRichText(false);
|
||||||
|
textEditPostAttachCommands->setToolTip(groupBoxPostAttachCommands->toolTip());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
groupBoxPluginDebugging = new QGroupBox(q);
|
groupBoxPluginDebugging = new QGroupBox(q);
|
||||||
groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr(
|
groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr(
|
||||||
@@ -268,14 +283,18 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
|||||||
QGridLayout *startLayout = new QGridLayout(groupBoxStartupCommands);
|
QGridLayout *startLayout = new QGridLayout(groupBoxStartupCommands);
|
||||||
startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1);
|
startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1);
|
||||||
|
|
||||||
|
QGridLayout *postAttachLayout = new QGridLayout(groupBoxPostAttachCommands);
|
||||||
|
postAttachLayout->addWidget(textEditPostAttachCommands, 0, 0, 1, 1);
|
||||||
|
|
||||||
//QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
//QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
||||||
//horizontalLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Preferred, QSizePolicy::Minimum));
|
//horizontalLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Preferred, QSizePolicy::Minimum));
|
||||||
//horizontalLayout->addWidget(labelSelectedPluginBreakpoints);
|
//horizontalLayout->addWidget(labelSelectedPluginBreakpoints);
|
||||||
//horizontalLayout->addWidget(lineEditSelectedPluginBreakpointsPattern);
|
//horizontalLayout->addWidget(lineEditSelectedPluginBreakpointsPattern);
|
||||||
|
|
||||||
QGridLayout *gridLayout = new QGridLayout(this);
|
QGridLayout *gridLayout = new QGridLayout(this);
|
||||||
gridLayout->addWidget(groupBoxGeneral, 0, 0);
|
gridLayout->addWidget(groupBoxGeneral, 0, 0, 2, 1);
|
||||||
gridLayout->addWidget(groupBoxStartupCommands, 0, 1);
|
gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 1, 1);
|
||||||
|
gridLayout->addWidget(groupBoxPostAttachCommands, 1, 1, 1, 1);
|
||||||
|
|
||||||
//gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 1, 1);
|
//gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 1, 1);
|
||||||
//gridLayout->addWidget(radioButtonAllPluginBreakpoints, 0, 0, 1, 1);
|
//gridLayout->addWidget(radioButtonAllPluginBreakpoints, 0, 0, 1, 1);
|
||||||
@@ -287,6 +306,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
|||||||
|
|
||||||
DebuggerCore *dc = debuggerCore();
|
DebuggerCore *dc = debuggerCore();
|
||||||
group.insert(dc->action(GdbStartupCommands), textEditStartupCommands);
|
group.insert(dc->action(GdbStartupCommands), textEditStartupCommands);
|
||||||
|
group.insert(dc->action(GdbPostAttachCommands), textEditPostAttachCommands);
|
||||||
group.insert(dc->action(LoadGdbInit), checkBoxLoadGdbInit);
|
group.insert(dc->action(LoadGdbInit), checkBoxLoadGdbInit);
|
||||||
group.insert(dc->action(AutoEnrichParameters), checkBoxAutoEnrichParameters);
|
group.insert(dc->action(AutoEnrichParameters), checkBoxAutoEnrichParameters);
|
||||||
group.insert(dc->action(UseDynamicType), checkBoxUseDynamicType);
|
group.insert(dc->action(UseDynamicType), checkBoxUseDynamicType);
|
||||||
|
|||||||
@@ -282,6 +282,11 @@ void GdbRemoteServerEngine::handleTargetRemote(const GdbResponse &record)
|
|||||||
// gdb server will stop the remote application itself.
|
// gdb server will stop the remote application itself.
|
||||||
showMessage(_("INFERIOR STARTED"));
|
showMessage(_("INFERIOR STARTED"));
|
||||||
showMessage(msgAttachedToStoppedInferior(), StatusBar);
|
showMessage(msgAttachedToStoppedInferior(), StatusBar);
|
||||||
|
QString postAttachCommands = debuggerCore()->stringSetting(GdbPostAttachCommands);
|
||||||
|
if (!postAttachCommands.isEmpty()) {
|
||||||
|
foreach (const QString &cmd, postAttachCommands.split(QLatin1Char('\n')))
|
||||||
|
postCommand(cmd.toLatin1());
|
||||||
|
}
|
||||||
handleInferiorPrepared();
|
handleInferiorPrepared();
|
||||||
} else {
|
} else {
|
||||||
// 16^error,msg="hd:5555: Connection timed out."
|
// 16^error,msg="hd:5555: Connection timed out."
|
||||||
|
|||||||
Reference in New Issue
Block a user