forked from qt-creator/qt-creator
Debugger: Fix LLDB-DAP attach to process
Change-Id: I464db537d85de7bce943334379b6ce499b32dc2b Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
This commit is contained in:
@@ -237,6 +237,8 @@ void DapClient::emitSignals(const QJsonDocument &doc)
|
||||
type = DapResponseType::SetBreakpoints;
|
||||
} else if (command == "setFunctionBreakpoints") {
|
||||
type = DapResponseType::SetFunctionBreakpoints;
|
||||
} else if (command == "attach") {
|
||||
type = DapResponseType::Attach;
|
||||
}
|
||||
emit responseReady(type, ob);
|
||||
return;
|
||||
|
@@ -54,6 +54,7 @@ enum class DapResponseType
|
||||
Evaluate,
|
||||
SetBreakpoints,
|
||||
SetFunctionBreakpoints,
|
||||
Attach,
|
||||
Unknown
|
||||
};
|
||||
|
||||
|
@@ -692,6 +692,9 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response
|
||||
case DapResponseType::SetBreakpoints:
|
||||
handleBreakpointResponse(response);
|
||||
break;
|
||||
case DapResponseType::Attach:
|
||||
notifyInferiorRunOk();
|
||||
break;
|
||||
default:
|
||||
showMessage("UNKNOWN RESPONSE:" + command);
|
||||
};
|
||||
|
@@ -120,7 +120,15 @@ void LldbDapEngine::handleDapInitialize()
|
||||
}
|
||||
|
||||
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
|
||||
m_dapClient->postRequest("attach", QJsonObject{{"__restart", ""}});
|
||||
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
m_dapClient->postRequest(
|
||||
"attach",
|
||||
QJsonObject{
|
||||
{"program", rp.inferior.command.executable().path()},
|
||||
{"pid", QString::number(rp.attachPID.pid())},
|
||||
{"__restart", ""}});
|
||||
|
||||
qCDebug(logCategory()) << "handleDapAttach";
|
||||
}
|
||||
|
||||
@@ -146,9 +154,6 @@ void LldbDapEngine::setupEngine()
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
CommandLine cmd{rp.debugger.command.executable()};
|
||||
|
||||
if (isLocalAttachEngine())
|
||||
cmd.addArgs({"--debugger-pid", QString::number(rp.attachPID.pid())});
|
||||
|
||||
IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this);
|
||||
m_dapClient = new LldbDapClient(dataProvider, this);
|
||||
|
||||
|
Reference in New Issue
Block a user