| 1 | //===-- ExceptionBreakpoint.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_EXCEPTIONBREAKPOINT_H |
| 10 | #define LLDB_TOOLS_LLDB_DAP_EXCEPTIONBREAKPOINT_H |
| 11 | |
| 12 | #include "DAPForward.h" |
| 13 | #include "lldb/API/SBBreakpoint.h" |
| 14 | #include "lldb/lldb-enumerations.h" |
| 15 | #include "llvm/ADT/StringRef.h" |
| 16 | #include <string> |
| 17 | #include <utility> |
| 18 | |
| 19 | namespace lldb_dap { |
| 20 | |
| 21 | class ExceptionBreakpoint { |
| 22 | public: |
| 23 | ExceptionBreakpoint(DAP &d, std::string f, std::string l, |
| 24 | lldb::LanguageType lang) |
| 25 | : m_dap(d), m_filter(std::move(f)), m_label(std::move(l)), |
| 26 | m_language(lang), m_bp() {} |
| 27 | |
| 28 | void SetBreakpoint(); |
| 29 | void ClearBreakpoint(); |
| 30 | |
| 31 | lldb::break_id_t GetID() const { return m_bp.GetID(); } |
| 32 | llvm::StringRef GetFilter() const { return m_filter; } |
| 33 | llvm::StringRef GetLabel() const { return m_label; } |
| 34 | |
| 35 | static constexpr bool kDefaultValue = false; |
| 36 | |
| 37 | protected: |
| 38 | DAP &m_dap; |
| 39 | std::string m_filter; |
| 40 | std::string m_label; |
| 41 | lldb::LanguageType m_language; |
| 42 | lldb::SBBreakpoint m_bp; |
| 43 | }; |
| 44 | |
| 45 | } // namespace lldb_dap |
| 46 | |
| 47 | #endif |
| 48 |
