1 | //===-- NativeWatchpointList.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_HOST_COMMON_NATIVEWATCHPOINTLIST_H |
10 | #define LLDB_HOST_COMMON_NATIVEWATCHPOINTLIST_H |
11 | |
12 | #include "lldb/Utility/Status.h" |
13 | #include "lldb/lldb-private-forward.h" |
14 | |
15 | #include <map> |
16 | |
17 | namespace lldb_private { |
18 | struct NativeWatchpoint { |
19 | lldb::addr_t m_addr; |
20 | size_t m_size; |
21 | uint32_t m_watch_flags; |
22 | bool m_hardware; |
23 | }; |
24 | |
25 | class NativeWatchpointList { |
26 | public: |
27 | Status Add(lldb::addr_t addr, size_t size, uint32_t watch_flags, |
28 | bool hardware); |
29 | |
30 | Status Remove(lldb::addr_t addr); |
31 | |
32 | using WatchpointMap = std::map<lldb::addr_t, NativeWatchpoint>; |
33 | |
34 | const WatchpointMap &GetWatchpointMap() const; |
35 | |
36 | private: |
37 | WatchpointMap m_watchpoints; |
38 | }; |
39 | } |
40 | |
41 | #endif // LLDB_HOST_COMMON_NATIVEWATCHPOINTLIST_H |
42 | |