Class: LLDB::Block

Inherits:
Object
  • Object
show all
Includes:
NativeLifecycle
Defined in:
lib/lldb/block.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) ⇒ Block

Returns a new instance of Block.

RBS:

  • target: Target?

  • context: Context?

  • return: void



12
13
14
15
16
17
18
19
# File 'lib/lldb/block.rb', line 12

def initialize(ptr, target: nil, context: nil)
  @target = target
  initialize_native_object(
    ptr,
    release: ->(released) { FFIBindings.lldb_block_destroy(released) },
    context: context || target&.context
  )
end

Instance Method Details

#first_childObject

RBS:

  • return: Block?



68
69
70
# File 'lib/lldb/block.rb', line 68

def first_child
  child_block(:lldb_block_get_first_child)
end

#inlined_call_site_columnObject

RBS:

  • return: Integer



51
52
53
54
55
# File 'lib/lldb/block.rb', line 51

def inlined_call_site_column
  return 0 unless valid?

  FFIBindings.lldb_block_get_inlined_call_site_column(@ptr)
end

#inlined_call_site_fileObject

RBS:

  • return: FileSpec?



34
35
36
37
38
39
40
41
# File 'lib/lldb/block.rb', line 34

def inlined_call_site_file
  return nil unless valid?

  ptr = FFIBindings.lldb_block_get_inlined_call_site_file(@ptr)
  return nil if ptr.nil? || ptr.null?

  FileSpec.from_ptr(ptr, context: context)
end

#inlined_call_site_lineObject

RBS:

  • return: Integer



44
45
46
47
48
# File 'lib/lldb/block.rb', line 44

def inlined_call_site_line
  return INVALID_LINE_NUMBER unless valid?

  FFIBindings.lldb_block_get_inlined_call_site_line(@ptr)
end

#inlined_nameObject

RBS:

  • return: String?



27
28
29
30
31
# File 'lib/lldb/block.rb', line 27

def inlined_name
  return nil unless valid?

  FFIBindings.lldb_block_get_inlined_name(@ptr)
end

#num_rangesObject

RBS:

  • return: Integer



73
74
75
76
77
# File 'lib/lldb/block.rb', line 73

def num_ranges
  return 0 unless valid?

  FFIBindings.lldb_block_get_num_ranges(@ptr)
end

#parentObject

RBS:

  • return: Block?



58
59
60
# File 'lib/lldb/block.rb', line 58

def parent
  child_block(:lldb_block_get_parent)
end

#range_end_address(index) ⇒ Object

RBS:

  • index: Integer

  • return: Address?



87
88
89
# File 'lib/lldb/block.rb', line 87

def range_end_address(index)
  range_address(:lldb_block_get_range_end_address, index)
end

#range_start_address(index) ⇒ Object

RBS:

  • index: Integer

  • return: Address?



81
82
83
# File 'lib/lldb/block.rb', line 81

def range_start_address(index)
  range_address(:lldb_block_get_range_start_address, index)
end

#siblingObject

RBS:

  • return: Block?



63
64
65
# File 'lib/lldb/block.rb', line 63

def sibling
  child_block(:lldb_block_get_sibling)
end

#to_ptrObject

RBS:

  • return: FFI::Pointer



92
93
94
# File 'lib/lldb/block.rb', line 92

def to_ptr
  @ptr
end

#valid?Boolean

RBS:

  • return: bool

Returns:

  • (Boolean)


22
23
24
# File 'lib/lldb/block.rb', line 22

def valid?
  !@ptr.null? && FFIBindings.lldb_block_is_valid(@ptr) != 0
end