1//===-- BreakpointBase.cpp --------------------------------------*- 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#include "BreakpointBase.h"
10
11using namespace lldb_dap;
12
13BreakpointBase::BreakpointBase(DAP &d,
14 const std::optional<std::string> &condition,
15 const std::optional<std::string> &hit_condition)
16 : m_dap(d), m_condition(condition.value_or(u: "")),
17 m_hit_condition(hit_condition.value_or(u: "")) {}
18
19void BreakpointBase::UpdateBreakpoint(const BreakpointBase &request_bp) {
20 if (m_condition != request_bp.m_condition) {
21 m_condition = request_bp.m_condition;
22 SetCondition();
23 }
24 if (m_hit_condition != request_bp.m_hit_condition) {
25 m_hit_condition = request_bp.m_hit_condition;
26 SetHitCondition();
27 }
28}
29

source code of lldb/tools/lldb-dap/BreakpointBase.cpp