1//===-- TestGetTargetBreakpointsRequestHandler.cpp ------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "DAP.h"
10#include "EventHelper.h"
11#include "JSONUtils.h"
12#include "RequestHandler.h"
13
14namespace lldb_dap {
15
16void TestGetTargetBreakpointsRequestHandler::operator()(
17 const llvm::json::Object &request) const {
18 llvm::json::Object response;
19 FillResponse(request, response);
20 llvm::json::Array response_breakpoints;
21 for (uint32_t i = 0; dap.target.GetBreakpointAtIndex(idx: i).IsValid(); ++i) {
22 auto bp = Breakpoint(dap, dap.target.GetBreakpointAtIndex(idx: i));
23 response_breakpoints.push_back(E: bp.ToProtocolBreakpoint());
24 }
25 llvm::json::Object body;
26 body.try_emplace(K: "breakpoints", Args: std::move(response_breakpoints));
27 response.try_emplace(K: "body", Args: std::move(body));
28 dap.SendJSON(json: llvm::json::Value(std::move(response)));
29}
30
31} // namespace lldb_dap
32

source code of lldb/tools/lldb-dap/Handler/TestGetTargetBreakpointsRequestHandler.cpp