1 //===-- NativeBreakpointList.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_NativeBreakpointList_h_
11 #define liblldb_NativeBreakpointList_h_
13 #include "lldb/Utility/Status.h"
14 #include "lldb/lldb-private-forward.h"
15 // #include "lldb/Host/NativeBreakpoint.h"
21 namespace lldb_private {
23 struct HardwareBreakpoint {
28 using HardwareBreakpointMap = std::map<lldb::addr_t, HardwareBreakpoint>;
30 class NativeBreakpointList {
32 typedef std::function<Status(lldb::addr_t addr, size_t size_hint,
34 NativeBreakpointSP &breakpoint_sp)>
37 NativeBreakpointList();
39 Status AddRef(lldb::addr_t addr, size_t size_hint, bool hardware,
40 CreateBreakpointFunc create_func);
42 Status DecRef(lldb::addr_t addr);
44 Status EnableBreakpoint(lldb::addr_t addr);
46 Status DisableBreakpoint(lldb::addr_t addr);
48 Status GetBreakpoint(lldb::addr_t addr, NativeBreakpointSP &breakpoint_sp);
50 Status RemoveTrapsFromBuffer(lldb::addr_t addr, void *buf, size_t size) const;
53 typedef std::map<lldb::addr_t, NativeBreakpointSP> BreakpointMap;
55 std::recursive_mutex m_mutex;
56 BreakpointMap m_breakpoints;
60 #endif // ifndef liblldb_NativeBreakpointList_h_