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;
|
type = DapResponseType::SetBreakpoints;
|
||||||
} else if (command == "setFunctionBreakpoints") {
|
} else if (command == "setFunctionBreakpoints") {
|
||||||
type = DapResponseType::SetFunctionBreakpoints;
|
type = DapResponseType::SetFunctionBreakpoints;
|
||||||
|
} else if (command == "attach") {
|
||||||
|
type = DapResponseType::Attach;
|
||||||
}
|
}
|
||||||
emit responseReady(type, ob);
|
emit responseReady(type, ob);
|
||||||
return;
|
return;
|
||||||
|
@@ -54,6 +54,7 @@ enum class DapResponseType
|
|||||||
Evaluate,
|
Evaluate,
|
||||||
SetBreakpoints,
|
SetBreakpoints,
|
||||||
SetFunctionBreakpoints,
|
SetFunctionBreakpoints,
|
||||||
|
Attach,
|
||||||
Unknown
|
Unknown
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -692,6 +692,9 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response
|
|||||||
case DapResponseType::SetBreakpoints:
|
case DapResponseType::SetBreakpoints:
|
||||||
handleBreakpointResponse(response);
|
handleBreakpointResponse(response);
|
||||||
break;
|
break;
|
||||||
|
case DapResponseType::Attach:
|
||||||
|
notifyInferiorRunOk();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
showMessage("UNKNOWN RESPONSE:" + command);
|
showMessage("UNKNOWN RESPONSE:" + command);
|
||||||
};
|
};
|
||||||
|
@@ -120,7 +120,15 @@ void LldbDapEngine::handleDapInitialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
|
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";
|
qCDebug(logCategory()) << "handleDapAttach";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,9 +154,6 @@ void LldbDapEngine::setupEngine()
|
|||||||
const DebuggerRunParameters &rp = runParameters();
|
const DebuggerRunParameters &rp = runParameters();
|
||||||
CommandLine cmd{rp.debugger.command.executable()};
|
CommandLine cmd{rp.debugger.command.executable()};
|
||||||
|
|
||||||
if (isLocalAttachEngine())
|
|
||||||
cmd.addArgs({"--debugger-pid", QString::number(rp.attachPID.pid())});
|
|
||||||
|
|
||||||
IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this);
|
IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this);
|
||||||
m_dapClient = new LldbDapClient(dataProvider, this);
|
m_dapClient = new LldbDapClient(dataProvider, this);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user