Class: LLDB::LineEntry

Inherits:
Object
  • Object
show all
Includes:
NativeLifecycle
Defined in:
lib/lldb/line_entry.rb

Instance Method Summary collapse

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.

RBS:

  • target: Target?

  • context: Context?

  • return: void



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

#columnObject

RBS:

  • return: Integer



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_addressObject

RBS:

  • return: Address?



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_specObject

RBS:

  • return: FileSpec?



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

#lineObject

RBS:

  • return: Integer



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_addressObject

RBS:

  • return: Address?



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_ptrObject

RBS:

  • return: FFI::Pointer



71
72
73
# File 'lib/lldb/line_entry.rb', line 71

def to_ptr
  @ptr
end

#valid?Boolean

RBS:

  • return: bool

Returns:

  • (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