debugger: make reading of .gdbinit optional

This commit is contained in:
hjk
2010-12-21 11:52:21 +01:00
parent 6159e5b860
commit a71050b63f
5 changed files with 27 additions and 32 deletions

View File

@@ -254,9 +254,12 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
// //
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("Environment")); item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbInit"));
item->setDefaultValue(QString()); item->setDefaultValue(QString());
insertItem(GdbEnvironment, item); item->setCheckable(true);
item->setDefaultValue(true);
item->setValue(true);
insertItem(LoadGdbInit, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ScriptFile")); item->setSettingsKey(debugModeGroup, QLatin1String("ScriptFile"));

View File

@@ -103,7 +103,7 @@ enum DebuggerActionCode
RegisterForPostMortem, RegisterForPostMortem,
// Gdb // Gdb
GdbEnvironment, LoadGdbInit,
GdbScriptFile, GdbScriptFile,
ExecuteCommand, ExecuteCommand,
GdbWatchdogTimeout, GdbWatchdogTimeout,

View File

@@ -4059,10 +4059,11 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
GdbOptionsPage::settingsId()); GdbOptionsPage::settingsId());
return false; return false;
} }
showMessage(_("STARTING GDB ") + m_gdb);
QStringList gdbArgs; QStringList gdbArgs;
gdbArgs << _("-i"); gdbArgs << _("-i");
gdbArgs << _("mi"); gdbArgs << _("mi");
if (!debuggerCore()->boolSetting(LoadGdbInit))
gdbArgs << _("-n");
gdbArgs += args; gdbArgs += args;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@@ -4115,6 +4116,7 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
connect(gdbProc(), SIGNAL(readyReadStandardError()), connect(gdbProc(), SIGNAL(readyReadStandardError()),
SLOT(readGdbStandardError())); SLOT(readGdbStandardError()));
showMessage(_("STARTING ") + m_gdb + _(" ") + gdbArgs.join(_(" ")));
gdbProc()->start(m_gdb, gdbArgs); gdbProc()->start(m_gdb, gdbArgs);
if (!gdbProc()->waitForStarted()) { if (!gdbProc()->waitForStarted()) {

View File

@@ -184,8 +184,8 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
m_group.clear(); m_group.clear();
m_group.insert(debuggerCore()->action(GdbScriptFile), m_group.insert(debuggerCore()->action(GdbScriptFile),
m_ui->scriptFileChooser); m_ui->scriptFileChooser);
m_group.insert(debuggerCore()->action(GdbEnvironment), m_group.insert(debuggerCore()->action(LoadGdbInit),
m_ui->environmentEdit); m_ui->checkBoxLoadGdbInit);
m_group.insert(debuggerCore()->action(AdjustBreakpointLocations), m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
m_ui->checkBoxAdjustBreakpointLocations); m_ui->checkBoxAdjustBreakpointLocations);
m_group.insert(debuggerCore()->action(GdbWatchdogTimeout), m_group.insert(debuggerCore()->action(GdbWatchdogTimeout),
@@ -217,15 +217,11 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
connect(m_ui->radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)), connect(m_ui->radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
m_ui->lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool))); m_ui->lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool)));
// FIXME
m_ui->environmentEdit->hide();
m_ui->labelEnvironment->hide();
if (m_searchKeywords.isEmpty()) { if (m_searchKeywords.isEmpty()) {
QLatin1Char sep(' '); QLatin1Char sep(' ');
QTextStream(&m_searchKeywords) QTextStream(&m_searchKeywords)
<< sep << m_ui->groupBoxLocations->title() << sep << m_ui->groupBoxLocations->title()
<< sep << m_ui->labelEnvironment->text() << sep << m_ui->checkBoxLoadGdbInit->text()
<< sep << m_ui->labelGdbStartupScript->text() << sep << m_ui->labelGdbStartupScript->text()
<< sep << m_ui->labelGdbWatchdogTimeout->text() << sep << m_ui->labelGdbWatchdogTimeout->text()
<< sep << m_ui->checkBoxEnableReverseDebugging->text() << sep << m_ui->checkBoxEnableReverseDebugging->text()

View File

@@ -25,19 +25,6 @@
<widget class="Debugger::Internal::GdbChooserWidget" name="gdbChooserWidget" native="true"/> <widget class="Debugger::Internal::GdbChooserWidget" name="gdbChooserWidget" native="true"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelEnvironment">
<property name="text">
<string>Environment:</string>
</property>
<property name="buddy">
<cstring>environmentEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelGdbStartupScript"> <widget class="QLabel" name="labelGdbStartupScript">
<property name="toolTip"> <property name="toolTip">
<string>This is either empty or points to a file containing gdb commands that will be executed immediately after gdb starts up.</string> <string>This is either empty or points to a file containing gdb commands that will be executed immediately after gdb starts up.</string>
@@ -47,17 +34,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="1" column="1">
<widget class="Utils::PathChooser" name="scriptFileChooser"/> <widget class="Utils::PathChooser" name="scriptFileChooser"/>
</item> </item>
<item row="3" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelGdbWatchdogTimeout"> <widget class="QLabel" name="labelGdbWatchdogTimeout">
<property name="text"> <property name="text">
<string>Gdb timeout:</string> <string>Gdb timeout:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="spinBoxGdbWatchdogTimeout"> <widget class="QSpinBox" name="spinBoxGdbWatchdogTimeout">
<property name="toolTip"> <property name="toolTip">
<string>This is the number of seconds Qt Creator will wait before <string>This is the number of seconds Qt Creator will wait before
@@ -83,14 +70,14 @@ on slow machines. In this case, the value should be increased.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging"> <widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
<property name="text"> <property name="text">
<string>Enable reverse debugging</string> <string>Enable reverse debugging</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2"> <item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSkipKnownFrames"> <widget class="QCheckBox" name="checkBoxSkipKnownFrames">
<property name="toolTip"> <property name="toolTip">
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic <string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic
@@ -101,17 +88,24 @@ on slow machines. In this case, the value should be increased.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="2"> <item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals"> <widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals">
<property name="text"> <property name="text">
<string>Show a message box when receiving a signal</string> <string>Show a message box when receiving a signal</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2"> <item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations"> <widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations">
<property name="text"> <property name="text">
<string>Adjust Breakpoint Locations</string> <string>Adjust breakpoint locations</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxLoadGdbInit">
<property name="text">
<string>Load .gdbinit file on startup</string>
</property> </property>
</widget> </widget>
</item> </item>