diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index f3755adcce29bda9276fad66f06c2167c2da9841..9341d1d74e2b8a19031ee1b4f542fa74c96b47d5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -277,7 +277,7 @@ QString GdbEngine::errorMessage(QProcess::ProcessError error) return tr("The gdb process failed to start. Either the " "invoked program \"%1\" is missing, or you may have insufficient " "permissions to invoke the program.\n%2") - .arg(m_gdb, gdbProc()->errorString()); + .arg(m_gdb, m_gdbProc->errorString()); case QProcess::Crashed: if (targetState() == DebuggerFinished) return tr("The gdb process crashed some time after starting " @@ -300,11 +300,6 @@ QString GdbEngine::errorMessage(QProcess::ProcessError error) } } -GdbProcess *GdbEngine::gdbProc() const -{ - return m_gdbProc; -} - #if 0 static void dump(const char *first, const char *middle, const QString & to) { @@ -794,7 +789,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) void GdbEngine::readGdbStandardError() { - QByteArray err = gdbProc()->readAllStandardError(); + QByteArray err = m_gdbProc->readAllStandardError(); showMessage(_("UNEXPECTED GDB STDERR: " + err)); if (err == "Undefined command: \"bb\". Try \"help\".\n") return; @@ -810,7 +805,7 @@ void GdbEngine::readGdbStandardOutput() int newstart = 0; int scan = m_inbuffer.size(); - QByteArray out = gdbProc()->readAllStandardOutput(); + QByteArray out = m_gdbProc->readAllStandardOutput(); m_inbuffer.append(out); // This can trigger when a dialog starts a nested event loop. @@ -974,7 +969,7 @@ void GdbEngine::flushCommand(const GdbCommand &cmd0) return; } - QTC_ASSERT(gdbProc()->state() == QProcess::Running, return); + QTC_ASSERT(m_gdbProc->state() == QProcess::Running, return); const int token = ++currentToken(); @@ -1055,7 +1050,7 @@ void GdbEngine::commandTimeout() if (mb->exec() == QMessageBox::Ok) { showMessage(_("KILLING DEBUGGER AS REQUESTED BY USER")); // This is an undefined state, so we just pull the emergency brake. - gdbProc()->kill(); + m_gdbProc->kill(); } else { showMessage(_("CONTINUE DEBUGGER AS REQUESTED BY USER")); } @@ -2044,9 +2039,9 @@ void GdbEngine::notifyAdapterShutdownOk() { QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state()); showMessage(_("INITIATE GDBENGINE SHUTDOWN IN STATE %1, PROC: %2") - .arg(lastGoodState()).arg(gdbProc()->state())); + .arg(lastGoodState()).arg(m_gdbProc->state())); m_commandsDoneCallback = 0; - switch (gdbProc()->state()) { + switch (m_gdbProc->state()) { case QProcess::Running: postCommand("-gdb-exit", GdbEngine::ExitRequest, CB(handleGdbExit)); break; @@ -2056,7 +2051,7 @@ void GdbEngine::notifyAdapterShutdownOk() break; case QProcess::Starting: showMessage(_("GDB NOT REALLY RUNNING; KILLING IT")); - gdbProc()->kill(); + m_gdbProc->kill(); notifyEngineShutdownFailed(); break; } @@ -2073,7 +2068,7 @@ void GdbEngine::handleGdbExit(const GdbResponse &response) QString::fromLocal8Bit(response.data["msg"].data())); qDebug() << (_("GDB WON'T EXIT (%1); KILLING IT").arg(msg)); showMessage(_("GDB WON'T EXIT (%1); KILLING IT").arg(msg)); - gdbProc()->kill(); + m_gdbProc->kill(); } } @@ -4758,7 +4753,7 @@ void GdbEngine::startGdb(const QStringList &args) foreach (int test, m_testCases) showMessage(_("ENABLING TEST CASE: " + QByteArray::number(test))); - gdbProc()->disconnect(); // From any previous runs + m_gdbProc->disconnect(); // From any previous runs const DebuggerStartParameters &sp = startParameters(); m_gdb = gdbBinary(sp); @@ -4783,19 +4778,19 @@ void GdbEngine::startGdb(const QStringList &args) } gdbArgs += args; - connect(gdbProc(), SIGNAL(error(QProcess::ProcessError)), + connect(m_gdbProc, SIGNAL(error(QProcess::ProcessError)), SLOT(handleGdbError(QProcess::ProcessError))); - connect(gdbProc(), SIGNAL(finished(int,QProcess::ExitStatus)), + connect(m_gdbProc, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(handleGdbFinished(int,QProcess::ExitStatus))); - connect(gdbProc(), SIGNAL(readyReadStandardOutput()), + connect(m_gdbProc, SIGNAL(readyReadStandardOutput()), SLOT(readGdbStandardOutput())); - connect(gdbProc(), SIGNAL(readyReadStandardError()), + connect(m_gdbProc, SIGNAL(readyReadStandardError()), SLOT(readGdbStandardError())); showMessage(_("STARTING ") + m_gdb + _(" ") + gdbArgs.join(_(" "))); - gdbProc()->start(m_gdb, gdbArgs); + m_gdbProc->start(m_gdb, gdbArgs); - if (!gdbProc()->waitForStarted()) { + if (!m_gdbProc->waitForStarted()) { handleGdbStartFailed(); const QString msg = errorMessage(QProcess::FailedToStart); handleAdapterStartFailed(msg); @@ -5009,7 +5004,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error) case QProcess::WriteError: case QProcess::Timedout: default: - //gdbProc()->kill(); + //m_gdbProc->kill(); //notifyEngineIll(); showMessageBox(QMessageBox::Critical, tr("GDB I/O Error"), msg); break; @@ -5050,8 +5045,8 @@ void GdbEngine::abortDebugger() if (targetState() == DebuggerFinished) { // We already tried. Try harder. showMessage(_("ABORTING DEBUGGER. SECOND TIME.")); - QTC_ASSERT(gdbProc(), return); - gdbProc()->kill(); + QTC_ASSERT(m_gdbProc, return); + m_gdbProc->kill(); } else { // Be friendly the first time. This will change targetState(). showMessage(_("ABORTING DEBUGGER. FIRST TIME.")); @@ -5240,7 +5235,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg) notifyEngineIll(); // No point in being friendly here ... - gdbProc()->kill(); + m_gdbProc->kill(); if (!msg.isEmpty()) showMessageBox(QMessageBox::Critical, tr("Adapter crashed"), msg); @@ -5385,7 +5380,7 @@ bool GdbEngine::attemptQuickStart() const void GdbEngine::write(const QByteArray &data) { - gdbProc()->write(data); + m_gdbProc->write(data); } bool GdbEngine::prepareCommand() diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index fd278d51ae9d4ad807d9b7de42bb39f9ad732b50..592be2b0a986e0ee0ae976b747466c9d9f2b526e 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -649,7 +649,6 @@ protected: // Convenience Functions // QString errorMessage(QProcess::ProcessError error); - GdbProcess *gdbProc() const; void showExecutionError(const QString &message); static QByteArray tooltipIName(const QString &exp);