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