| 1 | //===-- Breakpoint.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_BREAKPOINT_H |
| 10 | #define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H |
| 11 | |
| 12 | #include "BreakpointBase.h" |
| 13 | #include "DAPForward.h" |
| 14 | #include "lldb/API/SBBreakpoint.h" |
| 15 | |
| 16 | namespace lldb_dap { |
| 17 | |
| 18 | class Breakpoint : public BreakpointBase { |
| 19 | public: |
| 20 | Breakpoint(DAP &d, const std::optional<std::string> &condition, |
| 21 | const std::optional<std::string> &hit_condition) |
| 22 | : BreakpointBase(d, condition, hit_condition) {} |
| 23 | Breakpoint(DAP &d, lldb::SBBreakpoint bp) : BreakpointBase(d), m_bp(bp) {} |
| 24 | |
| 25 | lldb::break_id_t GetID() const { return m_bp.GetID(); } |
| 26 | |
| 27 | void SetCondition() override; |
| 28 | void SetHitCondition() override; |
| 29 | protocol::Breakpoint ToProtocolBreakpoint() override; |
| 30 | |
| 31 | bool MatchesName(const char *name); |
| 32 | void SetBreakpoint(); |
| 33 | |
| 34 | protected: |
| 35 | /// The LLDB breakpoint associated wit this source breakpoint. |
| 36 | lldb::SBBreakpoint m_bp; |
| 37 | }; |
| 38 | } // namespace lldb_dap |
| 39 | |
| 40 | #endif |
| 41 | |