Commit ac2012a7 authored by hjk's avatar hjk

Debugger: De-virtualize *Engine::notify* functions

Most were never re-implemented, so just for debugging purposes
in the mixed engine.

Change-Id: If569e0e553e3fdd5ef83b3bdfdbd22fd0ad5b90f
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 0e92b085
......@@ -340,44 +340,45 @@ protected:
// The base notify*() function implementation should be sufficient
// in most cases, but engines are free to override them to do some
// engine specific cleanup like stopping timers etc.
virtual void notifyEngineSetupOk();
virtual void notifyEngineSetupFailed();
virtual void notifyEngineRunFailed();
void notifyEngineSetupOk();
void notifyEngineSetupFailed();
void notifyEngineRunFailed();
virtual void notifyInferiorSetupOk();
virtual void notifyInferiorSetupFailed();
void notifyInferiorSetupOk();
void notifyInferiorSetupFailed();
virtual void notifyEngineRunAndInferiorRunOk();
virtual void notifyEngineRunAndInferiorStopOk();
virtual void notifyEngineRunOkAndInferiorUnrunnable(); // Called by CoreAdapter.
void notifyEngineRunAndInferiorRunOk();
void notifyEngineRunAndInferiorStopOk();
void notifyEngineRunOkAndInferiorUnrunnable(); // Called by CoreAdapter.
// Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead.
//virtual void notifyInferiorSpontaneousRun();
// void notifyInferiorSpontaneousRun();
virtual void notifyInferiorRunRequested();
virtual void notifyInferiorRunOk();
virtual void notifyInferiorRunFailed();
void notifyInferiorRunRequested();
void notifyInferiorRunOk();
void notifyInferiorRunFailed();
virtual void notifyInferiorStopOk();
virtual void notifyInferiorSpontaneousStop();
virtual void notifyInferiorStopFailed();
void notifyInferiorStopOk();
void notifyInferiorSpontaneousStop();
void notifyInferiorStopFailed();
public:
virtual void notifyInferiorExited();
public: // FIXME: Remove, currently needed for Android.
void notifyInferiorExited();
protected:
void notifyDebuggerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus,
const QString &backendName);
protected:
virtual void setState(DebuggerState state, bool forced = false);
virtual void notifyInferiorShutdownOk();
virtual void notifyInferiorShutdownFailed();
void notifyInferiorShutdownOk();
void notifyInferiorShutdownFailed();
virtual void notifyEngineSpontaneousShutdown();
virtual void notifyEngineShutdownOk();
virtual void notifyEngineShutdownFailed();
void notifyEngineSpontaneousShutdown();
void notifyEngineShutdownOk();
void notifyEngineShutdownFailed();
virtual void notifyEngineIll();
void notifyEngineIll();
virtual void setupEngine() = 0;
virtual void setupInferior() = 0;
......
......@@ -4106,14 +4106,6 @@ void GdbEngine::handleAdapterStartFailed(const QString &msg, Id settingsIdHint)
notifyEngineSetupFailed();
}
void GdbEngine::notifyInferiorSetupFailed()
{
// FIXME: that's not enough to stop gdb from getting confused
// by a timeout of the adapter.
//resetCommandQueue();
DebuggerEngine::notifyInferiorSetupFailed();
}
void GdbEngine::prepareForRestart()
{
m_rerunPending = false;
......@@ -4191,7 +4183,7 @@ void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
}
}
void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
void GdbEngine::notifyInferiorSetupFailedHelper(const QString &msg)
{
showStatusMessage(tr("Failed to start application:") + ' ' + msg);
if (state() == EngineSetupFailed) {
......@@ -4200,7 +4192,7 @@ void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
}
showMessage("INFERIOR START FAILED");
AsynchronousMessageBox::critical(tr("Failed to start application"), msg);
DebuggerEngine::notifyInferiorSetupFailed();
notifyInferiorSetupFailed();
}
void GdbEngine::handleAdapterCrashed(const QString &msg)
......@@ -4633,13 +4625,13 @@ void GdbEngine::handleAttach(const DebuggerResponse &response)
}
case ResultError:
if (response.data["msg"].data() == "ptrace: Operation not permitted.") {
notifyInferiorSetupFailed(msgPtraceError(runParameters().startMode));
notifyInferiorSetupFailedHelper(msgPtraceError(runParameters().startMode));
break;
}
notifyInferiorSetupFailed(response.data["msg"].data());
notifyInferiorSetupFailedHelper(response.data["msg"].data());
break;
default:
notifyInferiorSetupFailed(response.data["msg"].data());
notifyInferiorSetupFailedHelper(response.data["msg"].data());
break;
}
......@@ -4702,7 +4694,7 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
showMessage(msg, StatusBar);
callTargetRemote(); // Proceed nevertheless.
} else {
notifyInferiorSetupFailed(msg);
notifyInferiorSetupFailedHelper(msg);
}
}
......@@ -4718,7 +4710,7 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
"in the core file.")
+ ' ' + tr("Try to specify the binary using the "
"<i>Debug->Start Debugging->Attach to Core</i> dialog.");
notifyInferiorSetupFailed(msg);
notifyInferiorSetupFailedHelper(msg);
}
} else if (isPlainEngine()) {
......@@ -4730,7 +4722,7 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
// Extend the message a bit in unknown cases.
if (!msg.endsWith("File format not recognized"))
msg = tr("Starting executable failed:") + '\n' + msg;
notifyInferiorSetupFailed(msg);
notifyInferiorSetupFailedHelper(msg);
}
}
......@@ -4817,7 +4809,7 @@ void GdbEngine::handleTargetRemote(const DebuggerResponse &response)
handleInferiorPrepared();
} else {
// 16^error,msg="hd:5555: Connection timed out."
notifyInferiorSetupFailed(msgConnectRemoteServerFailed(response.data["msg"].data()));
notifyInferiorSetupFailedHelper(msgConnectRemoteServerFailed(response.data["msg"].data()));
}
}
......@@ -4851,14 +4843,14 @@ void GdbEngine::handleTargetExtendedRemote(const DebuggerResponse &response)
mb->button(QMessageBox::Ok)->setText(tr("Stop Debugging"));
if (mb->exec() == QMessageBox::Ok) {
showMessage("KILLING DEBUGGER AS REQUESTED BY USER");
notifyInferiorSetupFailed(title);
notifyInferiorSetupFailedHelper(title);
} else {
showMessage("CONTINUE DEBUGGER AS REQUESTED BY USER");
handleInferiorPrepared(); // This will likely fail.
}
}
} else {
notifyInferiorSetupFailed(msgConnectRemoteServerFailed(response.data["msg"].data()));
notifyInferiorSetupFailedHelper(msgConnectRemoteServerFailed(response.data["msg"].data()));
}
}
......@@ -4869,7 +4861,7 @@ void GdbEngine::handleTargetExtendedAttach(const DebuggerResponse &response)
// gdb server will stop the remote application itself.
handleInferiorPrepared();
} else {
notifyInferiorSetupFailed(msgConnectRemoteServerFailed(response.data["msg"].data()));
notifyInferiorSetupFailedHelper(msgConnectRemoteServerFailed(response.data["msg"].data()));
}
}
......@@ -4891,7 +4883,7 @@ void GdbEngine::handleTargetQnx(const DebuggerResponse &response)
handleInferiorPrepared();
} else {
// 16^error,msg="hd:5555: Connection timed out."
notifyInferiorSetupFailed(response.data["msg"].data());
notifyInferiorSetupFailedHelper(response.data["msg"].data());
}
}
......@@ -4908,7 +4900,7 @@ void GdbEngine::handleSetNtoExecutable(const DebuggerResponse &response)
}
case ResultError:
default:
notifyInferiorSetupFailed(response.data["msg"].data());
notifyInferiorSetupFailedHelper(response.data["msg"].data());
}
}
......
......@@ -78,7 +78,6 @@ private: ////////// General Interface //////////
DebuggerEngine *cppEngine() final { return this; }
void handleGdbStartFailed();
void notifyInferiorSetupFailed() final;
void prepareForRestart() final;
bool hasCapability(unsigned) const final;
......@@ -118,8 +117,8 @@ private: ////////// General Interface //////////
void handleDebugInfoLocation(const DebuggerResponse &response);
// The adapter is still running just fine, but it failed to acquire a debuggee.
void notifyInferiorSetupFailed(const QString &msg);
// The engine is still running just fine, but it failed to acquire a debuggee.
void notifyInferiorSetupFailedHelper(const QString &msg);
void notifyAdapterShutdownOk();
void notifyAdapterShutdownFailed();
......
......@@ -378,36 +378,6 @@ void QmlCppEngine::setupEngine()
m_cppEngine->setupSlaveEngine();
}
void QmlCppEngine::notifyEngineRunAndInferiorRunOk()
{
EDEBUG("\nMASTER NOTIFY ENGINE RUN AND INFERIOR RUN OK");
DebuggerEngine::notifyEngineRunAndInferiorRunOk();
}
void QmlCppEngine::notifyInferiorRunOk()
{
EDEBUG("\nMASTER NOTIFY INFERIOR RUN OK");
DebuggerEngine::notifyInferiorRunOk();
}
void QmlCppEngine::notifyInferiorSpontaneousStop()
{
EDEBUG("\nMASTER SPONTANEOUS STOP OK");
DebuggerEngine::notifyInferiorSpontaneousStop();
}
void QmlCppEngine::notifyInferiorShutdownOk()
{
EDEBUG("\nMASTER INFERIOR SHUTDOWN OK");
DebuggerEngine::notifyInferiorShutdownOk();
}
void QmlCppEngine::notifyInferiorSetupOk()
{
EDEBUG("\nMASTER INFERIOR SETUP OK");
DebuggerEngine::notifyInferiorSetupOk();
}
void QmlCppEngine::setupInferior()
{
EDEBUG("\nMASTER SETUP INFERIOR");
......
......@@ -114,12 +114,6 @@ protected:
void quitDebugger() override;
void abortDebugger() override;
void notifyInferiorRunOk() override;
void notifyInferiorSpontaneousStop() override;
void notifyEngineRunAndInferiorRunOk() override;
void notifyInferiorShutdownOk() override;
void notifyInferiorSetupOk() override;
void loadAdditionalQmlStack() override;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment