mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 20:00:38 -06:00
source: Pass trivial dap::*Event by value
This commit is contained in:
committed by
Brad King
parent
0bcb8d6e3c
commit
99c10afc26
@@ -164,8 +164,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
|
||||
});
|
||||
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Threads
|
||||
Session->registerHandler([this](dap::ThreadsRequest const& req) {
|
||||
(void)req;
|
||||
Session->registerHandler([this](dap::ThreadsRequest /*unused*/) {
|
||||
std::unique_lock<std::mutex> lock(Mutex);
|
||||
dap::ThreadsResponse response;
|
||||
|
||||
@@ -196,7 +195,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
|
||||
});
|
||||
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Scopes
|
||||
Session->registerHandler([this](dap::ScopesRequest const& request)
|
||||
Session->registerHandler([this](dap::ScopesRequest request)
|
||||
-> dap::ResponseOrError<dap::ScopesResponse> {
|
||||
std::unique_lock<std::mutex> lock(Mutex);
|
||||
return DefaultThread->GetScopesResponse(request.frameId,
|
||||
@@ -210,8 +209,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
|
||||
});
|
||||
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Pause
|
||||
Session->registerHandler([this](dap::PauseRequest const& req) {
|
||||
(void)req;
|
||||
Session->registerHandler([this](dap::PauseRequest /*unused*/) {
|
||||
PauseRequest.store(true);
|
||||
return dap::PauseResponse();
|
||||
});
|
||||
@@ -286,8 +284,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
|
||||
// The ConfigurationDone request is made by the client once all configuration
|
||||
// requests have been made.
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ConfigurationDone
|
||||
Session->registerHandler([this](dap::ConfigurationDoneRequest const& req) {
|
||||
(void)req;
|
||||
Session->registerHandler([this](dap::ConfigurationDoneRequest /*unused*/) {
|
||||
ConfigurationDoneEvent->Fire();
|
||||
return dap::ConfigurationDoneResponse();
|
||||
});
|
||||
|
||||
@@ -25,8 +25,7 @@ cmDebuggerExceptionManager::cmDebuggerExceptionManager(
|
||||
});
|
||||
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ExceptionInfo
|
||||
DapSession->registerHandler([&](dap::ExceptionInfoRequest const& request) {
|
||||
(void)request;
|
||||
DapSession->registerHandler([&](dap::ExceptionInfoRequest /*unused*/) {
|
||||
return HandleExceptionInfoRequest();
|
||||
});
|
||||
|
||||
|
||||
@@ -83,16 +83,13 @@ bool runTest(std::function<bool(dap::Session&)> onThreadExitedEvent)
|
||||
|
||||
auto connection = std::make_shared<DebuggerLocalConnection>();
|
||||
std::unique_ptr<dap::Session> client = dap::Session::create();
|
||||
client->registerHandler([&](dap::InitializedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::InitializedEvent /*unused*/) {
|
||||
initializedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::ExitedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::ExitedEvent /*unused*/) {
|
||||
exitedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::TerminatedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::TerminatedEvent const& /*unused*/) {
|
||||
terminatedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::ThreadEvent const& e) {
|
||||
|
||||
@@ -76,16 +76,13 @@ bool testProtocolWithPipes()
|
||||
#endif
|
||||
|
||||
std::unique_ptr<dap::Session> client = dap::Session::create();
|
||||
client->registerHandler([&](dap::InitializedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::InitializedEvent /*unused*/) {
|
||||
initializedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::ExitedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::ExitedEvent /*unused*/) {
|
||||
exitedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::TerminatedEvent const& e) {
|
||||
(void)e;
|
||||
client->registerHandler([&](dap::TerminatedEvent const& /*unused*/) {
|
||||
terminatedEventReceivedPromise.set_value(true);
|
||||
});
|
||||
client->registerHandler([&](dap::ThreadEvent const& e) {
|
||||
|
||||
Reference in New Issue
Block a user