Module: LLDB::NativeLifecycle
- Included in:
- Address, AttachInfo, Block, Breakpoint, BreakpointLocation, Broadcaster, CommandInterpreter, CommandReturnObject, CompileUnit, Debugger, Event, ExpressionOptions, FileSpec, FileSpecList, Frame, Function, Instruction, InstructionList, LaunchInfo, LineEntry, Listener, MemoryRegionInfo, Module, Process, Symbol, SymbolContext, Target, Thread, Type, TypeMember, Value, ValueList, Watchpoint
- Defined in:
- lib/lldb/native_lifecycle.rb
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
- #context ⇒ Object
- #context! ⇒ Object
- #ensure_open! ⇒ Object
- #initialize_native_object(ptr, release:, context: nil) ⇒ Object
- #to_ptr ⇒ Object
- #valid? ⇒ Boolean
Instance Method Details
#close ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/lldb/native_lifecycle.rb', line 13 def close return false unless @native_handle return false if @native_handle.closed? send(:close_context) if respond_to?(:close_context, true) @native_handle.close @ptr = NativeHandle::NULL_POINTER true end |
#closed? ⇒ Boolean
8 9 10 |
# File 'lib/lldb/native_lifecycle.rb', line 8 def closed? @native_handle ? @native_handle.closed? : false end |
#context ⇒ Object
48 49 50 |
# File 'lib/lldb/native_lifecycle.rb', line 48 def context @context end |
#context! ⇒ Object
53 54 55 |
# File 'lib/lldb/native_lifecycle.rb', line 53 def context! context || raise(LifecycleError, 'LLDB object has no context') end |
#ensure_open! ⇒ Object
31 32 33 34 |
# File 'lib/lldb/native_lifecycle.rb', line 31 def ensure_open! raise ClosedObjectError, "#{self.class} is closed" if closed? @context&.ensure_open! end |
#initialize_native_object(ptr, release:, context: nil) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/lldb/native_lifecycle.rb', line 40 def initialize_native_object(ptr, release:, context: nil) @ptr = ptr @context = context @native_handle = NativeHandle.new(ptr, release: release) context&.register(@native_handle) end |
#to_ptr ⇒ Object
24 25 26 27 28 |
# File 'lib/lldb/native_lifecycle.rb', line 24 def to_ptr return NativeHandle::NULL_POINTER if closed? super end |
#valid? ⇒ Boolean
58 59 60 61 62 |
# File 'lib/lldb/native_lifecycle.rb', line 58 def valid? return false if closed? || @context&.closed? super end |