Class: LLDB::LineEntry
- Inherits:
-
Object
- Object
- LLDB::LineEntry
- Includes:
- NativeLifecycle
- Defined in:
- lib/lldb/line_entry.rb
Instance Method Summary collapse
- #column ⇒ Object
- #end_address ⇒ Object
- #file_spec ⇒ Object
-
#initialize(ptr, target: nil, context: nil) ⇒ LineEntry
constructor
A new instance of LineEntry.
- #line ⇒ Object
- #start_address ⇒ Object
- #to_ptr ⇒ Object
- #valid? ⇒ Boolean
Methods included from NativeLifecycle
#close, #closed?, #context, #context!, #ensure_open!, #initialize_native_object
Constructor Details
#initialize(ptr, target: nil, context: nil) ⇒ LineEntry
Returns a new instance of LineEntry.
12 13 14 15 16 17 18 19 |
# File 'lib/lldb/line_entry.rb', line 12 def initialize(ptr, target: nil, context: nil) @target = target initialize_native_object( ptr, release: ->(released) { FFIBindings.lldb_line_entry_destroy(released) }, context: context || target&.context ) end |
Instance Method Details
#column ⇒ Object
64 65 66 67 68 |
# File 'lib/lldb/line_entry.rb', line 64 def column return 0 unless valid? FFIBindings.lldb_line_entry_get_column(@ptr) end |
#end_address ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/lldb/line_entry.rb', line 37 def end_address return nil unless valid? ptr = FFIBindings.lldb_line_entry_get_end_address(@ptr) return nil if ptr.nil? || ptr.null? Address.from_ptr(ptr, target: @target, context: context) end |
#file_spec ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/lldb/line_entry.rb', line 47 def file_spec return nil unless valid? ptr = FFIBindings.lldb_line_entry_get_file_spec(@ptr) return nil if ptr.nil? || ptr.null? FileSpec.from_ptr(ptr, context: context) end |
#line ⇒ Object
57 58 59 60 61 |
# File 'lib/lldb/line_entry.rb', line 57 def line return INVALID_LINE_NUMBER unless valid? FFIBindings.lldb_line_entry_get_line(@ptr) end |
#start_address ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/lldb/line_entry.rb', line 27 def start_address return nil unless valid? ptr = FFIBindings.lldb_line_entry_get_start_address(@ptr) return nil if ptr.nil? || ptr.null? Address.from_ptr(ptr, target: @target, context: context) end |
#to_ptr ⇒ Object
71 72 73 |
# File 'lib/lldb/line_entry.rb', line 71 def to_ptr @ptr end |
#valid? ⇒ Boolean
22 23 24 |
# File 'lib/lldb/line_entry.rb', line 22 def valid? !@ptr.null? && FFIBindings.lldb_line_entry_is_valid(@ptr) != 0 end |