1 //===-- SBWatchpoint.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_API_SBWATCHPOINT_H 10 #define LLDB_API_SBWATCHPOINT_H 11 12 #include "lldb/API/SBDefines.h" 13 14 namespace lldb { 15 16 class LLDB_API SBWatchpoint { 17 public: 18 SBWatchpoint(); 19 20 SBWatchpoint(const lldb::SBWatchpoint &rhs); 21 22 SBWatchpoint(const lldb::WatchpointSP &wp_sp); 23 24 ~SBWatchpoint(); 25 26 const lldb::SBWatchpoint &operator=(const lldb::SBWatchpoint &rhs); 27 28 explicit operator bool() const; 29 30 bool operator==(const SBWatchpoint &rhs) const; 31 32 bool operator!=(const SBWatchpoint &rhs) const; 33 34 bool IsValid() const; 35 36 SBError GetError(); 37 38 watch_id_t GetID(); 39 40 /// With -1 representing an invalid hardware index. 41 int32_t GetHardwareIndex(); 42 43 lldb::addr_t GetWatchAddress(); 44 45 size_t GetWatchSize(); 46 47 void SetEnabled(bool enabled); 48 49 bool IsEnabled(); 50 51 uint32_t GetHitCount(); 52 53 uint32_t GetIgnoreCount(); 54 55 void SetIgnoreCount(uint32_t n); 56 57 const char *GetCondition(); 58 59 void SetCondition(const char *condition); 60 61 bool GetDescription(lldb::SBStream &description, DescriptionLevel level); 62 63 void Clear(); 64 65 lldb::WatchpointSP GetSP() const; 66 67 void SetSP(const lldb::WatchpointSP &sp); 68 69 static bool EventIsWatchpointEvent(const lldb::SBEvent &event); 70 71 static lldb::WatchpointEventType 72 GetWatchpointEventTypeFromEvent(const lldb::SBEvent &event); 73 74 static lldb::SBWatchpoint GetWatchpointFromEvent(const lldb::SBEvent &event); 75 76 private: 77 friend class SBTarget; 78 friend class SBValue; 79 80 std::weak_ptr<lldb_private::Watchpoint> m_opaque_wp; 81 }; 82 83 } // namespace lldb 84 85 #endif // LLDB_API_SBWATCHPOINT_H 86