Commit e14bbccb authored by hjk's avatar hjk

Debugger: Add an option to import plain gdb pretty printers

This enables the use "official gdb"-styly pretty printers from
within Creator. In case there are both variants, Creator-style
pretty printers are preferred.

Change-Id: Iaa178d922dae4eaa1943e9d5b960a666f80fe4db
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent e1c4f12d
......@@ -357,6 +357,14 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item->setValue(true);
insertItem(LoadGdbInit, item);
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbDumpers"));
item->setDefaultValue(QString());
item->setCheckable(true);
item->setDefaultValue(true);
item->setValue(true);
insertItem(LoadGdbDumpers, item);
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoEnrichParameters"));
item->setDefaultValue(QString());
......
......@@ -117,6 +117,7 @@ enum DebuggerActionCode
// Gdb
LoadGdbInit,
LoadGdbDumpers,
AttemptQuickStart,
GdbStartupCommands,
GdbPostAttachCommands,
......
......@@ -262,6 +262,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
m_disassembleUsesComma = false;
m_terminalTrap = startParameters.useTerminal;
m_fullStartDone = false;
m_systemDumpersLoaded = false;
m_forceAsyncModel = false;
m_pythonAttemptedToLoad = false;
......@@ -1606,6 +1607,12 @@ void GdbEngine::handleStop1(const GdbMi &data)
else
m_resultVarName.clear();
if (!m_systemDumpersLoaded) {
m_systemDumpersLoaded = true;
if (debuggerCore()->boolSetting(LoadGdbDumpers))
postCommand("importPlainDumpers");
}
bool initHelpers = m_debuggingHelperState == DebuggingHelperUninitialized
|| m_debuggingHelperState == DebuggingHelperLoadTried;
// Don't load helpers on stops triggered by signals unless it's
......
......@@ -708,6 +708,7 @@ protected:
// debug information.
bool attemptQuickStart() const;
bool m_fullStartDone;
bool m_systemDumpersLoaded;
bool m_pythonAttemptedToLoad;
// Test
......
......@@ -74,6 +74,7 @@ public:
QCheckBox *checkBoxAdjustBreakpointLocations;
QCheckBox *checkBoxUseDynamicType;
QCheckBox *checkBoxLoadGdbInit;
QCheckBox *checkBoxLoadGdbDumpers;
QCheckBox *checkBoxIntelFlavor;
QGroupBox *groupBoxStartupCommands;
......@@ -155,6 +156,13 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
"Allows or inhibits reading the user's default\n"
".gdbinit file on debugger startup."));
checkBoxLoadGdbDumpers = new QCheckBox(groupBoxGeneral);
checkBoxLoadGdbDumpers->setText(GdbOptionsPage::tr("Load system gdb pretty printers"));
checkBoxLoadGdbDumpers->setToolTip(GdbOptionsPage::tr(
"Allows or inhibits using the default gdb pretty printers "
"installed in your system or linked to the libraries your "
"application uses.\n"));
checkBoxIntelFlavor = new QCheckBox(groupBoxGeneral);
checkBoxIntelFlavor->setText(GdbOptionsPage::tr("Use Intel style disassembly"));
checkBoxIntelFlavor->setToolTip(GdbOptionsPage::tr(
......@@ -226,6 +234,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
formLayout->addRow(checkBoxAdjustBreakpointLocations);
formLayout->addRow(checkBoxUseDynamicType);
formLayout->addRow(checkBoxLoadGdbInit);
formLayout->addRow(checkBoxLoadGdbDumpers);
formLayout->addRow(checkBoxIntelFlavor);
QGridLayout *startLayout = new QGridLayout(groupBoxStartupCommands);
......@@ -256,6 +265,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
group.insert(dc->action(GdbStartupCommands), textEditStartupCommands);
group.insert(dc->action(GdbPostAttachCommands), textEditPostAttachCommands);
group.insert(dc->action(LoadGdbInit), checkBoxLoadGdbInit);
group.insert(dc->action(LoadGdbDumpers), checkBoxLoadGdbDumpers);
group.insert(dc->action(UseDynamicType), checkBoxUseDynamicType);
group.insert(dc->action(AdjustBreakpointLocations), checkBoxAdjustBreakpointLocations);
group.insert(dc->action(GdbWatchdogTimeout), spinBoxGdbWatchdogTimeout);
......@@ -272,6 +282,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
QTextStream(&searchKeywords)
<< sep << groupBoxGeneral->title()
<< sep << checkBoxLoadGdbInit->text()
<< sep << checkBoxLoadGdbDumpers->text()
<< sep << checkBoxUseDynamicType->text()
<< sep << labelGdbWatchdogTimeout->text()
<< sep << checkBoxSkipKnownFrames->text()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment