setObjectName(QLatin1String("GdbEngine"));
qRegisterMetaType<WatchData>("WatchData");
- m_commandTimer = new QTimer(this);
- m_commandTimer->setSingleShot(true);
- connect(m_commandTimer, SIGNAL(timeout()), SLOT(commandTimeout()));
+ m_commandTimer.setSingleShot(true);
+ connect(&m_commandTimer, SIGNAL(timeout()), SLOT(commandTimeout()));
// Needs no resetting in initializeVariables()
m_busy = false;
m_inbuffer.clear();
m_resultVarName.clear();
- m_commandTimer->stop();
+ m_commandTimer.stop();
// ConverterState has no reset() function.
m_outputCodecState.~ConverterState();
void GdbEngine::readGdbStandardOutput()
{
- if (m_commandTimer->isActive())
- m_commandTimer->start(); // Retrigger
+ m_commandTimer.start(); // Restart timer.
int newstart = 0;
int scan = m_inbuffer.size();
m_inbuffer.append(gdbProc()->readAllStandardOutput());
- // This can trigger when a dialog starts a nested event loop
+ // This can trigger when a dialog starts a nested event loop.
if (m_busy)
return;
m_gdbAdapter->write(cmd.command + "\r\n");
// Start Watchdog.
- if (m_commandTimer->interval() <= 20000)
- m_commandTimer->setInterval(commandTimeoutTime());
+ if (m_commandTimer.interval() <= 20000)
+ m_commandTimer.setInterval(commandTimeoutTime());
// 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
// to bark in that case since the only possible outcome is a dead
// process anyway.
if (!cmd.command.endsWith("-gdb-exit"))
- m_commandTimer->start();
+ m_commandTimer.start();
//if (cmd.flags & LosesChild)
// notifyInferiorIll();
}
if (killIt) {
showMessage(_("TIMED OUT WAITING FOR GDB REPLY. COMMANDS STILL IN PROGRESS:"));
- int timeOut = m_commandTimer->interval();
- //m_commandTimer->stop();
+ int timeOut = m_commandTimer.interval();
+ //m_commandTimer.stop();
const QString msg = tr("The gdb process has not responded "
"to a command within %1 seconds. This could mean it is stuck "
"in an endless loop or taking longer than expected to perform "
}
if (m_cookieForToken.isEmpty())
- m_commandTimer->stop();
+ m_commandTimer.stop();
}
void GdbEngine::executeDebuggerCommand(const QString &command)
void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
{
- if (m_commandTimer && m_commandTimer->isActive())
- m_commandTimer->stop();
+ if (m_commandTimer.isActive())
+ m_commandTimer.stop();
//qDebug() << "GDB PROCESS FINISHED";
showMessage(_("GDB PROCESS FINISHED, status %1, code %2").arg(type).arg(code));
void GdbEngine::resetCommandQueue()
{
- m_commandTimer->stop();
+ m_commandTimer.stop();
if (!m_cookieForToken.isEmpty()) {
QString msg;
QTextStream ts(&msg);