]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Host/common/NativeBreakpointList.h
MFV: r276862
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Host / common / NativeBreakpointList.h
1 //===-- NativeBreakpointList.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_NativeBreakpointList_h_
11 #define liblldb_NativeBreakpointList_h_
12
13 #include "lldb/lldb-private-forward.h"
14 #include "lldb/Core/Error.h"
15 #include "lldb/Host/Mutex.h"
16 // #include "lldb/Host/NativeBreakpoint.h"
17
18 #include <functional>
19 #include <map>
20
21 namespace lldb_private
22 {
23     class NativeBreakpointList
24     {
25     public:
26         typedef std::function<Error (lldb::addr_t addr, size_t size_hint, bool hardware, NativeBreakpointSP &breakpoint_sp)> CreateBreakpointFunc;
27
28         NativeBreakpointList ();
29
30         Error
31         AddRef (lldb::addr_t addr, size_t size_hint, bool hardware, CreateBreakpointFunc create_func);
32
33         Error
34         DecRef (lldb::addr_t addr);
35
36         Error
37         EnableBreakpoint (lldb::addr_t addr);
38
39         Error
40         DisableBreakpoint (lldb::addr_t addr);
41
42         Error
43         GetBreakpoint (lldb::addr_t addr, NativeBreakpointSP &breakpoint_sp);
44
45     private:
46         typedef std::map<lldb::addr_t, NativeBreakpointSP> BreakpointMap;
47
48         Mutex m_mutex;
49         BreakpointMap m_breakpoints;
50     };
51 }
52
53 #endif // ifndef liblldb_NativeBreakpointList_h_