Class: LLDB::BreakpointLocation
- Inherits:
-
Object
- Object
- LLDB::BreakpointLocation
- Includes:
- NativeLifecycle
- Defined in:
- lib/lldb/breakpoint_location.rb
Instance Attribute Summary collapse
- #breakpoint ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
- #address ⇒ Object
- #condition ⇒ Object
- #condition=(expr) ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
- #enabled=(value) ⇒ Object
- #enabled? ⇒ Boolean
- #hit_count ⇒ Object
- #id ⇒ Object
- #ignore_count ⇒ Object
- #ignore_count=(count) ⇒ Object
-
#initialize(ptr, breakpoint:, context: breakpoint.context) ⇒ BreakpointLocation
constructor
A new instance of BreakpointLocation.
- #load_address ⇒ 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, breakpoint:, context: breakpoint.context) ⇒ BreakpointLocation
Returns a new instance of BreakpointLocation.
15 16 17 18 19 20 21 22 |
# File 'lib/lldb/breakpoint_location.rb', line 15 def initialize(ptr, breakpoint:, context: breakpoint.context) @breakpoint = breakpoint initialize_native_object( ptr, release: ->(released) { FFIBindings.lldb_breakpoint_location_destroy(released) }, context: context ) end |
Instance Attribute Details
#breakpoint ⇒ Object (readonly)
10 11 12 |
# File 'lib/lldb/breakpoint_location.rb', line 10 def breakpoint @breakpoint end |
Class Method Details
.release(ptr) ⇒ Object
26 27 28 |
# File 'lib/lldb/breakpoint_location.rb', line 26 def self.release(ptr) ->(_id) { FFIBindings.lldb_breakpoint_location_destroy(ptr) unless ptr.null? } end |
Instance Method Details
#address ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/lldb/breakpoint_location.rb', line 50 def address return nil unless valid? address_ptr = FFIBindings.lldb_breakpoint_location_get_address(@ptr) return nil if address_ptr.nil? || address_ptr.null? Address.from_ptr(address_ptr, target: @breakpoint.target, context: context) end |
#condition ⇒ Object
107 108 109 110 111 112 |
# File 'lib/lldb/breakpoint_location.rb', line 107 def condition return nil unless valid? cond = FFIBindings.lldb_breakpoint_location_get_condition(@ptr) cond.nil? || cond.empty? ? nil : cond end |
#condition=(expr) ⇒ Object
116 117 118 119 120 |
# File 'lib/lldb/breakpoint_location.rb', line 116 def condition=(expr) raise InvalidObjectError, 'BreakpointLocation is not valid' unless valid? FFIBindings.lldb_breakpoint_location_set_condition(@ptr, expr) end |
#disable ⇒ Object
80 81 82 |
# File 'lib/lldb/breakpoint_location.rb', line 80 def disable self.enabled = false end |
#enable ⇒ Object
75 76 77 |
# File 'lib/lldb/breakpoint_location.rb', line 75 def enable self.enabled = true end |
#enabled=(value) ⇒ Object
68 69 70 71 72 |
# File 'lib/lldb/breakpoint_location.rb', line 68 def enabled=(value) raise InvalidObjectError, 'BreakpointLocation is not valid' unless valid? FFIBindings.lldb_breakpoint_location_set_enabled(@ptr, value ? 1 : 0) end |
#enabled? ⇒ Boolean
60 61 62 63 64 |
# File 'lib/lldb/breakpoint_location.rb', line 60 def enabled? return false unless valid? FFIBindings.lldb_breakpoint_location_is_enabled(@ptr) != 0 end |
#hit_count ⇒ Object
85 86 87 88 89 |
# File 'lib/lldb/breakpoint_location.rb', line 85 def hit_count return 0 unless valid? FFIBindings.lldb_breakpoint_location_get_hit_count(@ptr) end |
#id ⇒ Object
36 37 38 39 40 |
# File 'lib/lldb/breakpoint_location.rb', line 36 def id return INVALID_BREAK_ID unless valid? FFIBindings.lldb_breakpoint_location_get_id(@ptr) end |
#ignore_count ⇒ Object
92 93 94 95 96 |
# File 'lib/lldb/breakpoint_location.rb', line 92 def ignore_count return 0 unless valid? FFIBindings.lldb_breakpoint_location_get_ignore_count(@ptr) end |
#ignore_count=(count) ⇒ Object
100 101 102 103 104 |
# File 'lib/lldb/breakpoint_location.rb', line 100 def ignore_count=(count) raise InvalidObjectError, 'BreakpointLocation is not valid' unless valid? FFIBindings.lldb_breakpoint_location_set_ignore_count(@ptr, count) end |
#load_address ⇒ Object
43 44 45 46 47 |
# File 'lib/lldb/breakpoint_location.rb', line 43 def load_address return INVALID_ADDRESS unless valid? FFIBindings.lldb_breakpoint_location_get_load_address(@ptr) end |
#to_ptr ⇒ Object
128 129 130 |
# File 'lib/lldb/breakpoint_location.rb', line 128 def to_ptr @ptr end |
#to_s ⇒ Object
123 124 125 |
# File 'lib/lldb/breakpoint_location.rb', line 123 def to_s "BreakpointLocation #{id}: address=0x#{load_address.to_s(16)}, enabled=#{enabled?}" end |
#valid? ⇒ Boolean
31 32 33 |
# File 'lib/lldb/breakpoint_location.rb', line 31 def valid? !@ptr.null? && FFIBindings.lldb_breakpoint_location_is_valid(@ptr) != 0 end |