1 //===-- StoppointLocation.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_StoppointLocation_h_
11 #define liblldb_StoppointLocation_h_
15 // Other libraries and framework includes
17 #include "lldb/lldb-private.h"
18 #include "lldb/Core/UserID.h"
19 // #include "lldb/Breakpoint/BreakpointOptions.h"
21 namespace lldb_private {
23 class StoppointLocation
26 //------------------------------------------------------------------
27 // Constructors and Destructors
28 //------------------------------------------------------------------
29 StoppointLocation (lldb::break_id_t bid,
33 StoppointLocation (lldb::break_id_t bid,
39 ~StoppointLocation ();
41 //------------------------------------------------------------------
43 //------------------------------------------------------------------
45 //------------------------------------------------------------------
47 //------------------------------------------------------------------
49 GetLoadAddress() const
55 SetLoadAddress (lldb::addr_t addr)
73 GetHardwareIndex () const
80 HardwarePreferred () const
82 return m_hw_preferred;
88 return m_hw_index != LLDB_INVALID_INDEX32;
93 ShouldStop (StoppointCallbackContext *context)
99 Dump (Stream *stream) const
104 SetHardwareIndex (uint32_t index)
117 //------------------------------------------------------------------
118 // Classes that inherit from StoppointLocation can see and modify these
119 //------------------------------------------------------------------
120 lldb::break_id_t m_loc_id; // Stoppoint location ID
121 lldb::addr_t m_addr; // The load address of this stop point. The base Stoppoint doesn't
122 // store a full Address since that's not needed for the breakpoint sites.
123 bool m_hw_preferred; // 1 if this point has been requested to be set using hardware (which may fail due to lack of resources)
124 uint32_t m_hw_index; // The hardware resource index for this breakpoint/watchpoint
125 uint32_t m_byte_size; // The size in bytes of stop location. e.g. the length of the trap opcode for
126 // software breakpoints, or the optional length in bytes for
127 // hardware breakpoints, or the length of the watchpoint.
128 uint32_t m_hit_count; // Number of times this breakpoint/watchpoint has been hit
130 // If you override this, be sure to call the base class to increment the internal counter.
138 //------------------------------------------------------------------
139 // For StoppointLocation only
140 //------------------------------------------------------------------
141 DISALLOW_COPY_AND_ASSIGN(StoppointLocation);
142 StoppointLocation(); // Disallow default constructor
145 } // namespace lldb_private
147 #endif // liblldb_StoppointLocation_h_