SBBreakpoint.h revision 54e7afa84d945f9137f9372ecde432f9e1a702fc
1//===-- SBBreakpoint.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 LLDB_SBBreakpoint_h_ 11#define LLDB_SBBreakpoint_h_ 12 13#include "lldb/API/SBDefines.h" 14#include <stdio.h> 15 16namespace lldb { 17 18class SBBreakpoint 19{ 20public: 21 22 typedef bool (*BreakpointHitCallback) (void *baton, 23 SBProcess &process, 24 SBThread &thread, 25 lldb::SBBreakpointLocation &location); 26 27 SBBreakpoint (); 28 29 SBBreakpoint (const lldb::SBBreakpoint& rhs); 30 31 ~SBBreakpoint(); 32 33#ifndef SWIG 34 const SBBreakpoint & 35 operator = (const SBBreakpoint& rhs); 36#endif 37 38 break_id_t 39 GetID () const; 40 41 bool 42 IsValid() const; 43 44 void 45 Dump (FILE *f); 46 47 void 48 ClearAllBreakpointSites (); 49 50 lldb::SBBreakpointLocation 51 FindLocationByAddress (lldb::addr_t vm_addr); 52 53 lldb::break_id_t 54 FindLocationIDByAddress (lldb::addr_t vm_addr); 55 56 lldb::SBBreakpointLocation 57 FindLocationByID (lldb::break_id_t bp_loc_id); 58 59 lldb::SBBreakpointLocation 60 GetLocationAtIndex (uint32_t index); 61 62 void 63 ListLocations (FILE *, const char *description_level = "full"); 64 65 void 66 SetEnabled (bool enable); 67 68 bool 69 IsEnabled (); 70 71 void 72 SetIgnoreCount (uint32_t count); 73 74 uint32_t 75 GetIgnoreCount () const; 76 77 void 78 SetThreadID (lldb::tid_t sb_thread_id); 79 80 lldb::tid_t 81 GetThreadID (); 82 83 void 84 SetThreadIndex (uint32_t index); 85 86 uint32_t 87 GetThreadIndex() const; 88 89 void 90 SetThreadName (const char *thread_name); 91 92 const char * 93 GetThreadName () const; 94 95 void 96 SetQueueName (const char *queue_name); 97 98 const char * 99 GetQueueName () const; 100 101 void 102 SetCallback (BreakpointHitCallback callback, void *baton); 103 104 size_t 105 GetNumResolvedLocations() const; 106 107 size_t 108 GetNumLocations() const; 109 110 void 111 GetDescription (FILE *, const char *description_level, bool describe_locations = false); 112 113 114 115private: 116 friend class SBBreakpointLocation; 117 friend class SBTarget; 118 119 SBBreakpoint (const lldb::BreakpointSP &bp_sp); 120 121#ifndef SWIG 122 123 lldb_private::Breakpoint * 124 operator->() const; 125 126 lldb_private::Breakpoint * 127 get() const; 128 129 lldb::BreakpointSP & 130 operator *(); 131 132 const lldb::BreakpointSP & 133 operator *() const; 134 135#endif 136 137 static bool 138 PrivateBreakpointHitCallback (void *baton, 139 lldb_private::StoppointCallbackContext *context, 140 lldb::user_id_t break_id, 141 lldb::user_id_t break_loc_id); 142 143 lldb::BreakpointSP m_opaque_sp; 144}; 145 146} // namespace lldb 147 148#endif // LLDB_SBBreakpoint_h_ 149