28 lines · cpp
1//===-- SetBreakpointsRequestHandler.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-exception6//7//===----------------------------------------------------------------------===//8 9#include "DAP.h"10#include "Protocol/ProtocolRequests.h"11#include "RequestHandler.h"12 13namespace lldb_dap {14 15/// Sets multiple breakpoints for a single source and clears all previous16/// breakpoints in that source. To clear all breakpoint for a source, specify an17/// empty array. When a breakpoint is hit, a `stopped` event (with reason18/// `breakpoint`) is generated.19llvm::Expected<protocol::SetBreakpointsResponseBody>20SetBreakpointsRequestHandler::Run(21 const protocol::SetBreakpointsArguments &args) const {22 std::vector<protocol::Breakpoint> response_breakpoints =23 dap.SetSourceBreakpoints(args.source, args.breakpoints);24 return protocol::SetBreakpointsResponseBody{std::move(response_breakpoints)};25}26 27} // namespace lldb_dap28