1 //===-- Watchpoint.h --------------------------------------------*- C++ -*-===// 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 #ifndef LLDB_TOOLS_LLDB_DAP_WATCHPOINT_H 10 #define LLDB_TOOLS_LLDB_DAP_WATCHPOINT_H 11 12 #include "BreakpointBase.h" 13 #include "DAPForward.h" 14 #include "lldb/API/SBError.h" 15 #include "lldb/API/SBWatchpoint.h" 16 #include "lldb/API/SBWatchpointOptions.h" 17 #include "lldb/lldb-types.h" 18 #include <cstddef> 19 20 namespace lldb_dap { 21 22 struct Watchpoint : public BreakpointBase { 23 lldb::addr_t addr; 24 size_t size; 25 lldb::SBWatchpointOptions options; 26 // The LLDB breakpoint associated wit this watchpoint. 27 lldb::SBWatchpoint wp; 28 lldb::SBError error; 29 30 Watchpoint(DAP &d, const llvm::json::Object &obj); 31 Watchpoint(DAP &d, lldb::SBWatchpoint wp) : BreakpointBase(d), wp(wp) {} 32 33 void SetCondition() override; 34 void SetHitCondition() override; 35 void CreateJsonObject(llvm::json::Object &object) override; 36 37 void SetWatchpoint(); 38 }; 39 } // namespace lldb_dap 40 41 #endif 42