diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 0cbb08ea1d1..f4922e4ab2a 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -399,6 +399,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 6ea017350b6..c43d7caae41 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 0684b11d5ac..00bbd650247 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -362,6 +362,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(ShowStdNamespace), 0); m_group.insert(theDebuggerAction(ShowQtNamespace), 0); m_group.insert(theDebuggerAction(LogTimeStamps), 0); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index e471d4d9791..f03b07a7004 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -194,7 +194,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 731791d677f..92937913479 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -235,7 +235,6 @@ private: ////////// Gdb Command Management ////////// QHash 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 d209f6b12cd..67fe0637e2b 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -51,6 +51,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 a7c90a27557..3a46c86fd49 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.ui +++ b/src/plugins/debugger/gdb/gdboptionspage.ui @@ -2,6 +2,14 @@ GdbOptionsPage + + + 0 + 0 + 397 + 322 + + @@ -29,7 +37,7 @@ - + @@ -55,19 +63,55 @@ - + - - Use full path information to set breakpoints - 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. + + Use full path information to set breakpoints + + + + + + + Gdb timeout: + + + + + + + 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. + + + Qt::LeftToRight + + + <unlimited> + + + 20 + + + 1000000 + + + 20 + + + 20 +