Class: LLDB::Breakpoint
- Inherits:
-
Object
- Object
- LLDB::Breakpoint
- Includes:
- NativeLifecycle
- Defined in:
- lib/lldb/breakpoint.rb
Instance Attribute Summary collapse
- #target ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
- #auto_continue=(value) ⇒ Object
- #auto_continue? ⇒ Boolean
- #condition ⇒ Object
- #condition=(expr) ⇒ Object
- #delete ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
- #enabled=(value) ⇒ Object
- #enabled? ⇒ Boolean
- #find_location_by_id(location_id) ⇒ Object
- #hardware? ⇒ Boolean
- #hit_count ⇒ Object
- #id ⇒ Object
- #ignore_count ⇒ Object
- #ignore_count=(count) ⇒ Object
-
#initialize(ptr, target:, context: target.context) ⇒ Breakpoint
constructor
A new instance of Breakpoint.
- #location_at_index(index) ⇒ Object
- #locations ⇒ Object
- #num_locations ⇒ Object
- #one_shot=(value) ⇒ Object
- #one_shot? ⇒ Boolean
- #thread_id ⇒ Object
- #thread_id=(value) ⇒ Object
- #thread_index ⇒ Object
- #thread_index=(value) ⇒ Object
- #thread_name ⇒ Object
- #thread_name=(value) ⇒ Object
- #to_ptr ⇒ Object
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Methods included from NativeLifecycle
#close, #closed?, #context, #context!, #ensure_open!, #initialize_native_object
Constructor Details
#initialize(ptr, target:, context: target.context) ⇒ Breakpoint
Returns a new instance of Breakpoint.
15 16 17 18 19 20 21 22 |
# File 'lib/lldb/breakpoint.rb', line 15 def initialize(ptr, target:, context: target.context) @target = target initialize_native_object( ptr, release: ->(released) { FFIBindings.lldb_breakpoint_destroy(released) }, context: context ) end |
Instance Attribute Details
#target ⇒ Object (readonly)
10 11 12 |
# File 'lib/lldb/breakpoint.rb', line 10 def target @target end |
Class Method Details
.release(ptr) ⇒ Object
26 27 28 |
# File 'lib/lldb/breakpoint.rb', line 26 def self.release(ptr) ->(_id) { FFIBindings.lldb_breakpoint_destroy(ptr) unless ptr.null? } end |
Instance Method Details
#auto_continue=(value) ⇒ Object
182 183 184 185 186 |
# File 'lib/lldb/breakpoint.rb', line 182 def auto_continue=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_auto_continue(@ptr, value ? 1 : 0) end |
#auto_continue? ⇒ Boolean
174 175 176 177 178 |
# File 'lib/lldb/breakpoint.rb', line 174 def auto_continue? return false unless valid? FFIBindings.lldb_breakpoint_get_auto_continue(@ptr) != 0 end |
#condition ⇒ Object
105 106 107 108 109 110 |
# File 'lib/lldb/breakpoint.rb', line 105 def condition return nil unless valid? cond = FFIBindings.lldb_breakpoint_get_condition(@ptr) cond.nil? || cond.empty? ? nil : cond end |
#condition=(expr) ⇒ Object
114 115 116 117 118 |
# File 'lib/lldb/breakpoint.rb', line 114 def condition=(expr) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_condition(@ptr, expr) end |
#delete ⇒ Object
128 129 130 131 132 |
# File 'lib/lldb/breakpoint.rb', line 128 def delete raise InvalidObjectError, 'Breakpoint is not valid' unless valid? target.delete_breakpoint(id) end |
#disable ⇒ Object
63 64 65 |
# File 'lib/lldb/breakpoint.rb', line 63 def disable self.enabled = false end |
#enable ⇒ Object
58 59 60 |
# File 'lib/lldb/breakpoint.rb', line 58 def enable self.enabled = true end |
#enabled=(value) ⇒ Object
51 52 53 54 55 |
# File 'lib/lldb/breakpoint.rb', line 51 def enabled=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_enabled(@ptr, value ? 1 : 0) end |
#enabled? ⇒ Boolean
43 44 45 46 47 |
# File 'lib/lldb/breakpoint.rb', line 43 def enabled? return false unless valid? FFIBindings.lldb_breakpoint_is_enabled(@ptr) != 0 end |
#find_location_by_id(location_id) ⇒ Object
152 153 154 155 156 157 158 159 |
# File 'lib/lldb/breakpoint.rb', line 152 def find_location_by_id(location_id) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? loc_ptr = FFIBindings.lldb_breakpoint_find_location_by_id(@ptr, location_id) return nil if loc_ptr.nil? || loc_ptr.null? BreakpointLocation.new(loc_ptr, breakpoint: self, context: context) end |
#hardware? ⇒ Boolean
167 168 169 170 171 |
# File 'lib/lldb/breakpoint.rb', line 167 def hardware? return false unless valid? FFIBindings.lldb_breakpoint_is_hardware(@ptr) != 0 end |
#hit_count ⇒ Object
83 84 85 86 87 |
# File 'lib/lldb/breakpoint.rb', line 83 def hit_count return 0 unless valid? FFIBindings.lldb_breakpoint_get_hit_count(@ptr) end |
#id ⇒ Object
36 37 38 39 40 |
# File 'lib/lldb/breakpoint.rb', line 36 def id return INVALID_BREAK_ID unless valid? FFIBindings.lldb_breakpoint_get_id(@ptr) end |
#ignore_count ⇒ Object
90 91 92 93 94 |
# File 'lib/lldb/breakpoint.rb', line 90 def ignore_count return 0 unless valid? FFIBindings.lldb_breakpoint_get_ignore_count(@ptr) end |
#ignore_count=(count) ⇒ Object
98 99 100 101 102 |
# File 'lib/lldb/breakpoint.rb', line 98 def ignore_count=(count) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_ignore_count(@ptr, count) end |
#location_at_index(index) ⇒ Object
141 142 143 144 145 146 147 148 |
# File 'lib/lldb/breakpoint.rb', line 141 def location_at_index(index) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? loc_ptr = FFIBindings.lldb_breakpoint_get_location_at_index(@ptr, index) return nil if loc_ptr.nil? || loc_ptr.null? BreakpointLocation.new(loc_ptr, breakpoint: self, context: context) end |
#locations ⇒ Object
162 163 164 |
# File 'lib/lldb/breakpoint.rb', line 162 def locations (0...num_locations).map { |i| location_at_index(i) }.compact end |
#num_locations ⇒ Object
121 122 123 124 125 |
# File 'lib/lldb/breakpoint.rb', line 121 def num_locations return 0 unless valid? FFIBindings.lldb_breakpoint_get_num_locations(@ptr) end |
#one_shot=(value) ⇒ Object
76 77 78 79 80 |
# File 'lib/lldb/breakpoint.rb', line 76 def one_shot=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_one_shot(@ptr, value ? 1 : 0) end |
#one_shot? ⇒ Boolean
68 69 70 71 72 |
# File 'lib/lldb/breakpoint.rb', line 68 def one_shot? return false unless valid? FFIBindings.lldb_breakpoint_is_one_shot(@ptr) != 0 end |
#thread_id ⇒ Object
189 190 191 192 193 |
# File 'lib/lldb/breakpoint.rb', line 189 def thread_id return 0 unless valid? FFIBindings.lldb_breakpoint_get_thread_id(@ptr) end |
#thread_id=(value) ⇒ Object
197 198 199 200 201 |
# File 'lib/lldb/breakpoint.rb', line 197 def thread_id=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_thread_id(@ptr, value) end |
#thread_index ⇒ Object
219 220 221 222 223 |
# File 'lib/lldb/breakpoint.rb', line 219 def thread_index return 0 unless valid? FFIBindings.lldb_breakpoint_get_thread_index(@ptr) end |
#thread_index=(value) ⇒ Object
227 228 229 230 231 |
# File 'lib/lldb/breakpoint.rb', line 227 def thread_index=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_thread_index(@ptr, value) end |
#thread_name ⇒ Object
204 205 206 207 208 |
# File 'lib/lldb/breakpoint.rb', line 204 def thread_name return nil unless valid? FFIBindings.lldb_breakpoint_get_thread_name(@ptr) end |
#thread_name=(value) ⇒ Object
212 213 214 215 216 |
# File 'lib/lldb/breakpoint.rb', line 212 def thread_name=(value) raise InvalidObjectError, 'Breakpoint is not valid' unless valid? FFIBindings.lldb_breakpoint_set_thread_name(@ptr, value) end |
#to_ptr ⇒ Object
234 235 236 |
# File 'lib/lldb/breakpoint.rb', line 234 def to_ptr @ptr end |
#to_s ⇒ Object
135 136 137 |
# File 'lib/lldb/breakpoint.rb', line 135 def to_s "Breakpoint #{id}: enabled=#{enabled?}, hit_count=#{hit_count}, locations=#{num_locations}" end |
#valid? ⇒ Boolean
31 32 33 |
# File 'lib/lldb/breakpoint.rb', line 31 def valid? !@ptr.null? && FFIBindings.lldb_breakpoint_is_valid(@ptr) != 0 end |