forked from qt-creator/qt-creator
debugger: add option to use intel-style disassembly
Change-Id: I549981e8314b52fafe2da387a0bb6312670578fa Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -444,6 +444,12 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
item->setDefaultValue(false);
|
||||
insertItem(MultiInferior, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("IntelFlavor"));
|
||||
item->setCheckable(true);
|
||||
item->setDefaultValue(false);
|
||||
insertItem(IntelFlavor, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTips"));
|
||||
item->setText(tr("Use tooltips in main editor when debugging"));
|
||||
|
||||
@@ -126,6 +126,7 @@ enum DebuggerActionCode
|
||||
TargetAsync,
|
||||
WarnOnReleaseBuilds,
|
||||
MultiInferior,
|
||||
IntelFlavor,
|
||||
|
||||
// Stack
|
||||
MaximalStackDepth,
|
||||
|
||||
@@ -279,6 +279,8 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
|
||||
SLOT(reloadLocals()));
|
||||
connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)),
|
||||
SLOT(reloadLocals()));
|
||||
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
|
||||
SLOT(reloadDisassembly()));
|
||||
}
|
||||
|
||||
GdbEngine::~GdbEngine()
|
||||
@@ -4582,6 +4584,12 @@ DisassemblerLines GdbEngine::parseDisassembler(const GdbResponse &response)
|
||||
return parseCliDisassembler(response.consoleStreamOutput);
|
||||
}
|
||||
|
||||
void GdbEngine::reloadDisassembly()
|
||||
{
|
||||
setTokenBarrier();
|
||||
updateLocals();
|
||||
}
|
||||
|
||||
void GdbEngine::handleDisassemblerCheck(const GdbResponse &response)
|
||||
{
|
||||
m_disassembleUsesComma = response.resultClass != GdbResultDone;
|
||||
@@ -4999,6 +5007,11 @@ void GdbEngine::handleInferiorPrepared()
|
||||
|
||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||
|
||||
if (debuggerCore()->boolSetting(IntelFlavor)) {
|
||||
//postCommand("set follow-exec-mode new");
|
||||
postCommand("set disassembly-flavor intel");
|
||||
}
|
||||
|
||||
if (sp.breakOnMain) {
|
||||
QByteArray cmd = "tbreak ";
|
||||
cmd += sp.toolChainAbi.os() == Abi::WindowsOS ? "qMain" : "main";
|
||||
|
||||
@@ -526,6 +526,8 @@ private: ////////// View & Data Stuff //////////
|
||||
DisassemblerLines parseDisassembler(const GdbResponse &response);
|
||||
DisassemblerLines parseCliDisassembler(const QByteArray &response);
|
||||
DisassemblerLines parseMiDisassembler(const GdbMi &response);
|
||||
void reloadDisassembly();
|
||||
|
||||
|
||||
bool m_disassembleUsesComma;
|
||||
|
||||
@@ -664,7 +666,6 @@ protected:
|
||||
QString tooltipExpression() const;
|
||||
QScopedPointer<GdbToolTipContext> m_toolTipContext;
|
||||
|
||||
|
||||
// For short-circuiting stack and thread list evaluation.
|
||||
bool m_stackNeeded;
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
QCheckBox *checkBoxEnableReverseDebugging;
|
||||
QCheckBox *checkBoxAttemptQuickStart;
|
||||
QCheckBox *checkBoxMultiInferior;
|
||||
QCheckBox *checkBoxIntelFlavor;
|
||||
|
||||
QGroupBox *groupBoxStartupCommands;
|
||||
QTextEdit *textEditStartupCommands;
|
||||
@@ -216,6 +217,12 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
||||
"<html><head/><body>Keep debugging all children after a fork."
|
||||
"</body></html>"));
|
||||
|
||||
checkBoxIntelFlavor = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxIntelFlavor->setText(GdbOptionsPage::tr("Use Intel style disassembly"));
|
||||
checkBoxIntelFlavor->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>GDB shows by default AT&&T style disassembly."
|
||||
"</body></html>"));
|
||||
|
||||
groupBoxStartupCommands = new QGroupBox(this);
|
||||
groupBoxStartupCommands->setTitle(GdbOptionsPage::tr("Additional Startup Commands"));
|
||||
groupBoxStartupCommands->setToolTip(GdbOptionsPage::tr(
|
||||
@@ -277,6 +284,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
||||
formLayout->addRow(checkBoxUseDynamicType);
|
||||
formLayout->addRow(checkBoxLoadGdbInit);
|
||||
formLayout->addRow(checkBoxWarnOnReleaseBuilds);
|
||||
formLayout->addRow(checkBoxIntelFlavor);
|
||||
formLayout->addRow(new QLabel(QString()));
|
||||
formLayout->addRow(labelDangerous);
|
||||
formLayout->addRow(checkBoxTargetAsync);
|
||||
@@ -327,6 +335,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
|
||||
group.insert(dc->action(GdbWatchdogTimeout), spinBoxGdbWatchdogTimeout);
|
||||
group.insert(dc->action(AttemptQuickStart), checkBoxAttemptQuickStart);
|
||||
group.insert(dc->action(MultiInferior), checkBoxMultiInferior);
|
||||
group.insert(dc->action(IntelFlavor), checkBoxIntelFlavor);
|
||||
|
||||
group.insert(dc->action(UseMessageBoxForSignals), checkBoxUseMessageBoxForSignals);
|
||||
group.insert(dc->action(SkipKnownFrames), checkBoxSkipKnownFrames);
|
||||
|
||||
Reference in New Issue
Block a user