summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2010-01-06 15:42:20 +0100
committercon <qtc-committer@nokia.com>2010-01-06 15:57:10 +0100
commit0de840cb43bf40cb58530e41e0b1c29397d34827 (patch)
tree5f2520f0c4bfd6abe7e458f8bc4f5e7eb126390a
parentca637fdc3381988e1fad338f43921a3f97732c6c (diff)
downloadqt-creator-0de840cb43bf40cb58530e41e0b1c29397d34827.tar.gz
debugger: make watchdog timeout configurable
(cherry picked from commit bf077800b85fcb598e316f16b1e5dce98eae7ad5) Conflicts: src/plugins/debugger/debuggerplugin.cpp src/plugins/debugger/gdb/gdboptionspage.ui
-rw-r--r--src/plugins/debugger/debuggeractions.cpp6
-rw-r--r--src/plugins/debugger/debuggeractions.h1
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp1
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp3
-rw-r--r--src/plugins/debugger/gdb/gdbengine.h1
-rw-r--r--src/plugins/debugger/gdb/gdboptionspage.cpp3
-rw-r--r--src/plugins/debugger/gdb/gdboptionspage.ui52
7 files changed, 57 insertions, 10 deletions
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 38b431696e..c57118e960 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -383,6 +383,12 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Execute line"));
instance->insertItem(ExecuteCommand, item);
+ item = new SavedAction(instance);
+ item->setSettingsKey(debugModeGroup, QLatin1String("WatchdogTimeout"));
+ item->setDefaultValue(20);
+ instance->insertItem(GdbWatchdogTimeout, item);
+
+
return instance;
}
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index faa2e3e6b1..bcb23b175f 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -100,6 +100,7 @@ enum DebuggerActionCode
GdbEnvironment,
GdbScriptFile,
ExecuteCommand,
+ GdbWatchdogTimeout,
// Stack
MaximalStackDepth,
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 58148c9831..753fc4e48b 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -359,6 +359,7 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_ui.checkBoxEnableReverseDebugging);
m_group.insert(theDebuggerAction(MaximalStackDepth),
m_ui.spinBoxMaximalStackDepth);
+ m_group.insert(theDebuggerAction(GdbWatchdogTimeout), 0);
m_group.insert(theDebuggerAction(LogTimeStamps), 0);
m_group.insert(theDebuggerAction(UsePreciseBreakpoints), 0);
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 6b44001fba..a2f97db8f2 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -195,7 +195,8 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
m_commandTimer = new QTimer(this);
m_commandTimer->setSingleShot(true);
- m_commandTimer->setInterval(COMMAND_TIMEOUT);
+ m_commandTimer->setInterval(
+ 1000 * qMin(20, theDebuggerAction(GdbWatchdogTimeout)->value().toInt()));
connect(m_commandTimer, SIGNAL(timeout()), SLOT(commandTimeout()));
// Needs no resetting in initializeVariables()
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index 519df6b317..1d6b1666eb 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -234,7 +234,6 @@ private: ////////// Gdb Command Management //////////
QHash<int, GdbCommand> m_cookieForToken;
QTimer *m_commandTimer;
- enum { COMMAND_TIMEOUT = 20000 };
QByteArray m_pendingConsoleStreamOutput;
QByteArray m_pendingLogStreamOutput;
diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp
index 44e2624d55..561f2ad059 100644
--- a/src/plugins/debugger/gdb/gdboptionspage.cpp
+++ b/src/plugins/debugger/gdb/gdboptionspage.cpp
@@ -52,6 +52,9 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
m_ui.environmentEdit);
m_group.insert(theDebuggerAction(UsePreciseBreakpoints),
m_ui.checkBoxUsePreciseBreakpoints);
+ m_group.insert(theDebuggerAction(GdbWatchdogTimeout),
+ m_ui.spinBoxGdbWatchdogTimeout);
+
#if 1
m_ui.groupBoxPluginDebugging->hide();
diff --git a/src/plugins/debugger/gdb/gdboptionspage.ui b/src/plugins/debugger/gdb/gdboptionspage.ui
index d2b4c18bcf..df703a5692 100644
--- a/src/plugins/debugger/gdb/gdboptionspage.ui
+++ b/src/plugins/debugger/gdb/gdboptionspage.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>429</width>
- <height>452</height>
+ <width>397</width>
+ <height>322</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -36,6 +36,9 @@
</property>
</widget>
</item>
+ <item row="0" column="1">
+ <widget class="Utils::PathChooser" name="gdbLocationChooser" native="true"/>
+ </item>
<item row="1" column="0">
<widget class="QLabel" name="labelEnvironment">
<property name="text">
@@ -59,20 +62,53 @@
<item row="2" column="1">
<widget class="Utils::PathChooser" name="scriptFileChooser" native="true"/>
</item>
- <item row="0" column="1">
- <widget class="Utils::PathChooser" name="gdbLocationChooser" native="true"/>
- </item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUsePreciseBreakpoints">
- <property name="text">
- <string>Use full path information to set breakpoints</string>
- </property>
<property name="toolTip">
<string>When this option is checked, the debugger plugin attempts
to extract full path information for all source files from gdb. This is a
slow process but enables setting breakpoints in files with the same file
name in different directories.</string>
</property>
+ <property name="text">
+ <string>Use full path information to set breakpoints</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="labelGdbWatchdogTimeout">
+ <property name="text">
+ <string>Gdb timeout:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QSpinBox" name="spinBoxGdbWatchdogTimeout">
+ <property name="toolTip">
+ <string>This is the number of second Qt Creator will wait before
+it terminates non-reacting gdb process. The default value of 20 seconds
+should be sufficient for most applications, but there are situations when
+loading big libraries or listing source files takes much longer than that
+on slow machines. In this case the value should be increased.</string>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="specialValueText">
+ <string>&lt;unlimited&gt;</string>
+ </property>
+ <property name="minimum">
+ <number>20</number>
+ </property>
+ <property name="maximum">
+ <number>1000000</number>
+ </property>
+ <property name="singleStep">
+ <number>20</number>
+ </property>
+ <property name="value">
+ <number>20</number>
+ </property>
</widget>
</item>
</layout>