Class: LLDB::InstructionList
- Inherits:
-
Object
- Object
- LLDB::InstructionList
show all
- Includes:
- Enumerable, NativeLifecycle
- Defined in:
- lib/lldb/instruction_list.rb
Instance Method Summary
collapse
#close, #closed?, #context, #context!, #ensure_open!, #initialize_native_object
Constructor Details
#initialize(ptr, target: nil, context: nil) ⇒ InstructionList
Returns a new instance of InstructionList.
13
14
15
16
17
18
19
20
|
# File 'lib/lldb/instruction_list.rb', line 13
def initialize(ptr, target: nil, context: nil)
@target = target
initialize_native_object(
ptr,
release: ->(released) { FFIBindings.lldb_instruction_list_destroy(released) },
context: context || target&.context
)
end
|
Instance Method Details
#each(&block) ⇒ Object
49
50
51
52
53
54
55
56
|
# File 'lib/lldb/instruction_list.rb', line 49
def each(&block)
return enum_for(:each) unless block_given?
(0...size).each do |index|
instruction = self[index]
block.call(instruction) if instruction
end
end
|
#size ⇒ Object
Also known as:
length
#to_a ⇒ Object
59
60
61
|
# File 'lib/lldb/instruction_list.rb', line 59
def to_a
(0...size).map { |index| self[index] }.compact
end
|
#to_ptr ⇒ Object
64
65
66
|
# File 'lib/lldb/instruction_list.rb', line 64
def to_ptr
@ptr
end
|