DAP: Add Python debugging

Added Python support to the DAP engine in Qt Creator.

Note:
Locals aren't displayed for python. It will be fixed
in the following commit.

Change-Id: I6d3b41fecc98b92951ed0522e9201401293034d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-08-25 15:40:18 +02:00
parent 270a9839e2
commit cecf577dc4
14 changed files with 259 additions and 26 deletions

View File

@@ -67,6 +67,12 @@ void DapClient::sendLaunch(const Utils::FilePath &executable)
QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}});
}
void DapClient::sendAttach()
{
postRequest("attach",
QJsonObject{{"__restart", ""}});
}
void DapClient::sendConfigurationDone()
{
postRequest("configurationDone");
@@ -93,7 +99,6 @@ void DapClient::sendPause()
postRequest("pause");
}
void DapClient::sendStepIn(int threadId)
{
QTC_ASSERT(threadId != -1, return);
@@ -190,7 +195,9 @@ void DapClient::emitSignals(const QJsonDocument &doc)
if (type == "response") {
DapResponseType type = DapResponseType::Unknown;
const QString command = ob.value("command").toString();
if (command == "configurationDone") {
if (command == "initialize") {
type = DapResponseType::Initialize;
} else if (command == "configurationDone") {
type = DapResponseType::ConfigurationDone;
} else if (command == "continue") {
type = DapResponseType::Continue;
@@ -208,6 +215,8 @@ void DapClient::emitSignals(const QJsonDocument &doc)
type = DapResponseType::StepOver;
} else if (command == "threads") {
type = DapResponseType::DapThreads;
} else if (command == "pause") {
type = DapResponseType::Pause;
}
emit responseReady(type, ob);
return;