forked from qt-creator/qt-creator
Debugger: Merge EngineSetup and InferiorSetup start phases
It was needed in the past to trigger e.g. gdbserver setup in remote cases which is nowadays handled by separate RunWorkers. Change-Id: I30bce071dab0779cce2e7abef7b31550d8539461 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -199,13 +199,7 @@ void LldbEngine::setupEngine()
|
||||
return;
|
||||
}
|
||||
m_lldbProc.waitForReadyRead(1000);
|
||||
m_lldbProc.write("sc print('@\\nlldbstartupok@\\n')\n");
|
||||
}
|
||||
|
||||
// FIXME: splitting of startLldb() necessary to support LLDB <= 310 - revert asap
|
||||
void LldbEngine::startLldbStage2()
|
||||
{
|
||||
showMessage("ADAPTER STARTED");
|
||||
showStatusMessage(tr("Setting up inferior..."));
|
||||
|
||||
const QByteArray dumperSourcePath =
|
||||
@@ -216,13 +210,11 @@ void LldbEngine::startLldbStage2()
|
||||
m_lldbProc.write("script print(dir())\n");
|
||||
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
|
||||
|
||||
const QString commands = nativeStartupCommands();
|
||||
QString commands = nativeStartupCommands();
|
||||
if (!commands.isEmpty())
|
||||
m_lldbProc.write(commands.toLocal8Bit() + '\n');
|
||||
}
|
||||
|
||||
void LldbEngine::setupInferior()
|
||||
{
|
||||
|
||||
const QString path = stringSetting(ExtraDumperFile);
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
DebuggerCommand cmd("addDumperModule");
|
||||
@@ -230,7 +222,7 @@ void LldbEngine::setupInferior()
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
const QString commands = stringSetting(ExtraDumperCommands);
|
||||
commands = stringSetting(ExtraDumperCommands);
|
||||
if (!commands.isEmpty()) {
|
||||
DebuggerCommand cmd("executeDebuggerCommand");
|
||||
cmd.arg("command", commands);
|
||||
@@ -261,7 +253,6 @@ void LldbEngine::setupInferior()
|
||||
cmd2.arg("processargs", args.toUnixArgs());
|
||||
|
||||
if (terminal()) {
|
||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||
const qint64 attachedPID = terminal()->applicationPid();
|
||||
const qint64 attachedMainThreadID = terminal()->applicationMainThreadId();
|
||||
const QString msg = (attachedMainThreadID != -1)
|
||||
@@ -301,9 +292,9 @@ void LldbEngine::setupInferior()
|
||||
.arg(bp.id().toString()).arg(bp.state()));
|
||||
}
|
||||
}
|
||||
notifyInferiorSetupOk();
|
||||
notifyEngineSetupOk();
|
||||
} else {
|
||||
notifyInferiorSetupFailed();
|
||||
notifyEngineSetupFailed();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -467,7 +458,7 @@ void LldbEngine::selectThread(ThreadId threadId)
|
||||
bool LldbEngine::stateAcceptsBreakpointChanges() const
|
||||
{
|
||||
switch (state()) {
|
||||
case InferiorSetupRequested:
|
||||
case EngineSetupRequested:
|
||||
case InferiorRunRequested:
|
||||
case InferiorRunOk:
|
||||
case InferiorStopRequested:
|
||||
@@ -809,10 +800,7 @@ void LldbEngine::readLldbStandardOutput()
|
||||
break;
|
||||
QString response = m_inbuffer.left(pos).trimmed();
|
||||
m_inbuffer = m_inbuffer.mid(pos + 2);
|
||||
if (response == "lldbstartupok")
|
||||
startLldbStage2();
|
||||
else
|
||||
emit outputReady(response);
|
||||
emit outputReady(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user