Debugger: Rework timeout handling

Extend the range to start with 10sec, but default to 40secs.

Change-Id: Iede37afca0da2c9ba8fc0bb3fda65d403b8d0bcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2024-03-05 09:00:52 +01:00
parent 3691053760
commit feeb72d78c
3 changed files with 4 additions and 11 deletions

View File

@@ -784,8 +784,8 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
} }
// Start Watchdog. // Start Watchdog.
if (m_commandTimer.interval() <= 20000) const int watchDogMilliSecs = settings().gdbWatchdogTimeout() * 1000;
m_commandTimer.setInterval(commandTimeoutTime()); m_commandTimer.setInterval(watchDogMilliSecs);
// The process can die for external reason between the "-gdb-exit" was // The process can die for external reason between the "-gdb-exit" was
// sent and a response could be retrieved. We don't want the watchdog // sent and a response could be retrieved. We don't want the watchdog
// to bark in that case since the only possible outcome is a dead // to bark in that case since the only possible outcome is a dead
@@ -798,12 +798,6 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
} }
} }
int GdbEngine::commandTimeoutTime() const
{
const int time = settings().gdbWatchdogTimeout();
return 1000 * qMax(20, time);
}
void GdbEngine::commandTimeout() void GdbEngine::commandTimeout()
{ {
const QList<int> keys = Utils::sorted(m_commandForToken.keys()); const QList<int> keys = Utils::sorted(m_commandForToken.keys());

View File

@@ -116,7 +116,6 @@ private: ////////// General Interface //////////
QHash<int, DebuggerCommand> m_commandForToken; QHash<int, DebuggerCommand> m_commandForToken;
QHash<int, int> m_flagsForToken; QHash<int, int> m_flagsForToken;
int commandTimeoutTime() const;
QTimer m_commandTimer; QTimer m_commandTimer;
QString m_pendingConsoleStreamOutput; QString m_pendingConsoleStreamOutput;

View File

@@ -187,9 +187,9 @@ GdbSettings::GdbSettings()
"calls and is very likely to destroy your debugging session.</p></body></html>")); "calls and is very likely to destroy your debugging session.</p></body></html>"));
gdbWatchdogTimeout.setSettingsKey("WatchdogTimeout"); gdbWatchdogTimeout.setSettingsKey("WatchdogTimeout");
gdbWatchdogTimeout.setDefaultValue(20); gdbWatchdogTimeout.setDefaultValue(40);
gdbWatchdogTimeout.setSuffix(Tr::tr("sec")); gdbWatchdogTimeout.setSuffix(Tr::tr("sec"));
gdbWatchdogTimeout.setRange(20, 1000000); gdbWatchdogTimeout.setRange(10, 1000000);
gdbWatchdogTimeout.setLabelText(Tr::tr("GDB timeout:")); gdbWatchdogTimeout.setLabelText(Tr::tr("GDB timeout:"));
gdbWatchdogTimeout.setToolTip(Tr::tr( gdbWatchdogTimeout.setToolTip(Tr::tr(
"The number of seconds before a non-responsive GDB process is terminated.\n" "The number of seconds before a non-responsive GDB process is terminated.\n"