]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Host/common/NativeBreakpoint.h
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Host / common / NativeBreakpoint.h
1 //===-- NativeBreakpoint.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_NativeBreakpoint_h_
11 #define liblldb_NativeBreakpoint_h_
12
13 #include "lldb/lldb-types.h"
14
15 namespace lldb_private {
16 class NativeBreakpointList;
17
18 class NativeBreakpoint {
19   friend class NativeBreakpointList;
20
21 public:
22   // The assumption is that derived breakpoints are enabled when created.
23   NativeBreakpoint(lldb::addr_t addr);
24
25   virtual ~NativeBreakpoint();
26
27   Status Enable();
28
29   Status Disable();
30
31   lldb::addr_t GetAddress() const { return m_addr; }
32
33   bool IsEnabled() const { return m_enabled; }
34
35   virtual bool IsSoftwareBreakpoint() const = 0;
36
37 protected:
38   const lldb::addr_t m_addr;
39   int32_t m_ref_count;
40
41   virtual Status DoEnable() = 0;
42
43   virtual Status DoDisable() = 0;
44
45 private:
46   bool m_enabled;
47
48   // ----------------------------------------------------------- interface for
49   // NativeBreakpointList
50   // -----------------------------------------------------------
51   void AddRef();
52   int32_t DecRef();
53 };
54 }
55
56 #endif // ifndef liblldb_NativeBreakpoint_h_