forked from qt-creator/qt-creator
GdbEngine: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals. Change-Id: Icf3e3d8cfdae3890cb4991da8b7d7e74e529ad39 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -167,10 +167,8 @@ GdbEngine::GdbEngine()
|
|||||||
connect(&s.useDynamicType, &BaseAspect::changed,
|
connect(&s.useDynamicType, &BaseAspect::changed,
|
||||||
this, &GdbEngine::reloadLocals);
|
this, &GdbEngine::reloadLocals);
|
||||||
|
|
||||||
connect(&m_gdbProc, &QtcProcess::errorOccurred,
|
connect(&m_gdbProc, &QtcProcess::done,
|
||||||
this, &GdbEngine::handleGdbError);
|
this, &GdbEngine::handleGdbDone);
|
||||||
connect(&m_gdbProc, &QtcProcess::finished,
|
|
||||||
this, &GdbEngine::handleGdbFinished);
|
|
||||||
connect(&m_gdbProc, &QtcProcess::readyReadStandardOutput,
|
connect(&m_gdbProc, &QtcProcess::readyReadStandardOutput,
|
||||||
this, &GdbEngine::readGdbStandardOutput);
|
this, &GdbEngine::readGdbStandardOutput);
|
||||||
connect(&m_gdbProc, &QtcProcess::readyReadStandardError,
|
connect(&m_gdbProc, &QtcProcess::readyReadStandardError,
|
||||||
@@ -4074,35 +4072,22 @@ void GdbEngine::reloadDebuggingHelpers()
|
|||||||
reloadLocals();
|
reloadLocals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::handleGdbError(QProcess::ProcessError error)
|
void GdbEngine::handleGdbDone()
|
||||||
{
|
{
|
||||||
QString msg = RunWorker::userMessageForProcessError(error, runParameters().debugger.command.executable());
|
const QProcess::ProcessError error = m_gdbProc.error();
|
||||||
QString errorString = m_gdbProc.errorString();
|
if (error != QProcess::UnknownError) {
|
||||||
if (!errorString.isEmpty())
|
QString msg = RunWorker::userMessageForProcessError(error,
|
||||||
msg += '\n' + errorString;
|
runParameters().debugger.command.executable());
|
||||||
showMessage("HANDLE GDB ERROR: " + msg);
|
const QString errorString = m_gdbProc.errorString();
|
||||||
// Show a message box for asynchronously reported issues.
|
if (!errorString.isEmpty())
|
||||||
switch (error) {
|
msg += '\n' + errorString;
|
||||||
case QProcess::FailedToStart:
|
showMessage("HANDLE GDB ERROR: " + msg);
|
||||||
// This should be handled by the code trying to start the process.
|
|
||||||
break;
|
|
||||||
case QProcess::Crashed:
|
|
||||||
// At this time, m_gdbProc.state() can still return Running.
|
|
||||||
// Wait for finished() instead.
|
|
||||||
break;
|
|
||||||
case QProcess::ReadError:
|
|
||||||
case QProcess::WriteError:
|
|
||||||
case QProcess::Timedout:
|
|
||||||
default:
|
|
||||||
//m_gdbProc->kill();
|
|
||||||
//notifyEngineIll();
|
|
||||||
AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GdbEngine::handleGdbFinished()
|
if (error == QProcess::FailedToStart)
|
||||||
{
|
return; // This should be handled by the code trying to start the process.
|
||||||
|
|
||||||
|
AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
|
||||||
|
}
|
||||||
if (m_commandTimer.isActive())
|
if (m_commandTimer.isActive())
|
||||||
m_commandTimer.stop();
|
m_commandTimer.stop();
|
||||||
|
|
||||||
|
|||||||
@@ -111,8 +111,7 @@ private: ////////// General Interface //////////
|
|||||||
// The engine is still running just fine, but it failed to acquire a debuggee.
|
// The engine is still running just fine, but it failed to acquire a debuggee.
|
||||||
void notifyInferiorSetupFailedHelper(const QString &msg);
|
void notifyInferiorSetupFailedHelper(const QString &msg);
|
||||||
|
|
||||||
void handleGdbFinished();
|
void handleGdbDone();
|
||||||
void handleGdbError(QProcess::ProcessError error);
|
|
||||||
void readGdbStandardOutput();
|
void readGdbStandardOutput();
|
||||||
void readGdbStandardError();
|
void readGdbStandardError();
|
||||||
void readDebuggeeOutput(const QByteArray &ba);
|
void readDebuggeeOutput(const QByteArray &ba);
|
||||||
|
|||||||
Reference in New Issue
Block a user