DAP: Add watcher feature

It is possible currently to add/remove watcher. Also it saves
expanded structure during the debugging process.

Note:
It doesn't work for CMake because of the issue #25282.

Change-Id: Ia0a48ca5cd0062617ae427b56b001ef87d5894ed
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-09-25 16:08:16 +02:00
parent 6d92639a2d
commit 19faf1a25a
5 changed files with 188 additions and 94 deletions

View File

@@ -114,11 +114,19 @@ void DapClient::sendStepOver(int threadId)
postRequest("next", QJsonObject{{"threadId", threadId}});
}
void DapClient::evaluateVariable(const QString &expression, int frameId)
{
postRequest("evaluate",
QJsonObject{{"expression", expression},
{"frameId", frameId},
{"context", "variables"}});
}
void DapClient::stackTrace(int threadId)
{
QTC_ASSERT(threadId != -1, return);
postRequest("stackTrace",
QJsonObject{{"threadId", threadId}, {"startFrame", 0}, {"levels", 10}});
QJsonObject{{"threadId", threadId}, {"startFrame", 0}, {"levels", 10}});
}
void DapClient::scopes(int frameId)
@@ -139,8 +147,8 @@ void DapClient::variables(int variablesReference)
void DapClient::setBreakpoints(const QJsonArray &breakpoints, const FilePath &fileName)
{
postRequest("setBreakpoints",
QJsonObject{{"source", QJsonObject{{"path", fileName.path()}}},
{"breakpoints", breakpoints}});
QJsonObject{{"source", QJsonObject{{"path", fileName.path()}}},
{"breakpoints", breakpoints}});
}
void DapClient::readOutput()
@@ -214,6 +222,8 @@ void DapClient::emitSignals(const QJsonDocument &doc)
type = DapResponseType::DapThreads;
} else if (command == "pause") {
type = DapResponseType::Pause;
} else if (command == "evaluate") {
type = DapResponseType::Evaluate;
}
emit responseReady(type, ob);
return;