1 //===-- SoftwareBreakpoint.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_SoftwareBreakpoint_h_
11 #define liblldb_SoftwareBreakpoint_h_
13 #include "lldb/lldb-private-forward.h"
14 #include "NativeBreakpoint.h"
16 namespace lldb_private
18 class SoftwareBreakpoint : public NativeBreakpoint
22 CreateSoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, size_t size_hint, NativeBreakpointSP &breakpoint_spn);
24 SoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, const uint8_t *saved_opcodes, const uint8_t *trap_opcodes, size_t opcode_size);
31 DoDisable () override;
34 IsSoftwareBreakpoint () const override;
37 /// Max number of bytes that a software trap opcode sequence can occupy.
38 static const size_t MAX_TRAP_OPCODE_SIZE = 8;
40 NativeProcessProtocol &m_process;
41 uint8_t m_saved_opcodes [MAX_TRAP_OPCODE_SIZE];
42 uint8_t m_trap_opcodes [MAX_TRAP_OPCODE_SIZE];
43 const size_t m_opcode_size;
46 EnableSoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, size_t bp_opcode_size, const uint8_t *bp_opcode_bytes, uint8_t *saved_opcode_bytes);
51 #endif // #ifndef liblldb_SoftwareBreakpoint_h_