Skip to content

Commit a56e05a

Browse files
committed
Fixing post-merge changes.
1 parent 093a3b5 commit a56e05a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void DAP::Send(const Message &message) {
258258
Response cancelled{/*request_seq=*/resp->request_seq,
259259
/*command=*/resp->command,
260260
/*success=*/false,
261-
/*message=*/Response::Message::cancelled,
261+
/*message=*/eResponseMessageCancelled,
262262
/*body=*/std::nullopt};
263263
if (llvm::Error err = transport.Write(cancelled))
264264
DAP_LOG_ERROR(log, std::move(err), "({1}) write failed: {0}",

lldb/tools/lldb-dap/Handler/RequestHandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "Handler/ResponseHandler.h"
1212
#include "JSONUtils.h"
1313
#include "LLDBUtils.h"
14+
#include "Protocol/ProtocolBase.h"
1415
#include "RunInTerminal.h"
1516
#include "llvm/Support/Error.h"
1617

@@ -173,7 +174,7 @@ void BaseRequestHandler::Run(const Request &request) {
173174
Response cancelled{/*request_seq=*/request.seq,
174175
/*command=*/request.command,
175176
/*success=*/false,
176-
/*message=*/Response::Message::cancelled,
177+
/*message=*/eResponseMessageCancelled,
177178
/*body=*/std::nullopt};
178179
dap.Send(cancelled);
179180
return;

lldb/tools/lldb-dap/Handler/RequestHandler.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ class RequestHandler : public BaseRequestHandler {
163163
response.body = std::move(*body);
164164
}
165165

166+
// Mark the request as 'cancelled' if the debugger was interrupted while
167+
// evaluating this handler.
168+
if (dap.debugger.InterruptRequested()) {
169+
dap.debugger.CancelInterruptRequest();
170+
response.success = false;
171+
response.message = protocol::eResponseMessageCancelled;
172+
response.body = std::nullopt;
173+
}
174+
166175
dap.Send(response);
167176
};
168177

@@ -472,8 +481,8 @@ class CancelRequestHandler
472481
public:
473482
using RequestHandler::RequestHandler;
474483
static llvm::StringLiteral GetCommand() { return "cancel"; }
475-
llvm::StringMap<bool> GetCapabilities() const override {
476-
return {{"supportsCancelRequest", true}};
484+
FeatureSet GetSupportedFeatures() const override {
485+
return {protocol::eAdapterFeatureCancelRequest};
477486
}
478487
llvm::Expected<protocol::CancelResponseBody>
479488
Run(const protocol::CancelArguments &args) const override;

0 commit comments

Comments
 (0)