Class: LLDB::AttachInfo

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

Instance Method Summary collapse

Methods included from NativeLifecycle

#close, #closed?, #context, #context!, #ensure_open!, #initialize_native_object

Constructor Details

#initialize(pid = nil, context: nil) ⇒ AttachInfo

Returns a new instance of AttachInfo.

RBS:

  • pid: Integer?

  • context: Context?

  • return: void



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

def initialize(pid = nil, context: nil)
  ptr = FFIBindings.lldb_attach_info_create(pid || 0)
  initialize_native_object(
    ptr,
    release: ->(released) { FFIBindings.lldb_attach_info_destroy(released) },
    context: context
  )
end

Instance Method Details

#executable=(path) ⇒ Object

RBS:

  • path: String

  • return: void



43
44
45
46
# File 'lib/lldb/attach_info.rb', line 43

def executable=(path)
  NativeStringArray.validate!(path)
  FFIBindings.lldb_attach_info_set_executable(@ptr, path)
end

#executable_file=(file) ⇒ Object

RBS:

  • file: FileSpec

  • return: void

Raises:

  • (ArgumentError)


50
51
52
53
54
# File 'lib/lldb/attach_info.rb', line 50

def executable_file=(file)
  raise ArgumentError, 'file must be a FileSpec' unless file.is_a?(FileSpec)

  FFIBindings.lldb_attach_info_set_executable_file(@ptr, file.to_ptr)
end

#ignore_existing=(value) ⇒ Object

RBS:

  • value: bool

  • return: void



74
75
76
# File 'lib/lldb/attach_info.rb', line 74

def ignore_existing=(value)
  FFIBindings.lldb_attach_info_set_ignore_existing(@ptr, value ? 1 : 0)
end

#ignore_existing?Boolean

RBS:

  • return: bool

Returns:

  • (Boolean)


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

def ignore_existing?
  FFIBindings.lldb_attach_info_get_ignore_existing(@ptr) != 0
end

#listenerObject

RBS:

  • return: Listener?



102
103
104
105
106
107
# File 'lib/lldb/attach_info.rb', line 102

def listener
  listener_ptr = FFIBindings.lldb_attach_info_get_listener(@ptr)
  return nil if listener_ptr.nil? || listener_ptr.null?

  Listener.from_ptr(listener_ptr, context: context)
end

#listener=(value) ⇒ Object

RBS:

  • value: Listener

  • return: void

Raises:

  • (ArgumentError)


111
112
113
114
115
# File 'lib/lldb/attach_info.rb', line 111

def listener=(value)
  raise ArgumentError, 'listener must be a Listener' unless value.is_a?(Listener)

  FFIBindings.lldb_attach_info_set_listener(@ptr, value.to_ptr)
end

#process_idObject Also known as: pid

RBS:

  • return: Integer



27
28
29
# File 'lib/lldb/attach_info.rb', line 27

def process_id
  FFIBindings.lldb_attach_info_get_process_id(@ptr)
end

#process_id=(value) ⇒ Object Also known as: pid=

RBS:

  • value: Integer

  • return: void



35
36
37
# File 'lib/lldb/attach_info.rb', line 35

def process_id=(value)
  FFIBindings.lldb_attach_info_set_process_id(@ptr, value)
end

#process_plugin_nameObject

RBS:

  • return: String?



90
91
92
# File 'lib/lldb/attach_info.rb', line 90

def process_plugin_name
  FFIBindings.lldb_attach_info_get_process_plugin_name(@ptr)
end

#process_plugin_name=(value) ⇒ Object

RBS:

  • value: String

  • return: void



96
97
98
99
# File 'lib/lldb/attach_info.rb', line 96

def process_plugin_name=(value)
  NativeStringArray.validate!(value)
  FFIBindings.lldb_attach_info_set_process_plugin_name(@ptr, value)
end

#resume_countObject

RBS:

  • return: Integer



79
80
81
# File 'lib/lldb/attach_info.rb', line 79

def resume_count
  FFIBindings.lldb_attach_info_get_resume_count(@ptr)
end

#resume_count=(value) ⇒ Object

RBS:

  • value: Integer

  • return: void



85
86
87
# File 'lib/lldb/attach_info.rb', line 85

def resume_count=(value)
  FFIBindings.lldb_attach_info_set_resume_count(@ptr, value)
end

#to_ptrObject

RBS:

  • return: FFI::Pointer



118
119
120
# File 'lib/lldb/attach_info.rb', line 118

def to_ptr
  @ptr
end

#valid?Boolean

RBS:

  • return: bool

Returns:

  • (Boolean)


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

def valid?
  !@ptr.null?
end

#wait_for_launch=(value) ⇒ Object

RBS:

  • value: bool

  • return: void



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

def wait_for_launch=(value)
  FFIBindings.lldb_attach_info_set_wait_for_launch(@ptr, value ? 1 : 0)
end

#wait_for_launch?Boolean

RBS:

  • return: bool

Returns:

  • (Boolean)


57
58
59
# File 'lib/lldb/attach_info.rb', line 57

def wait_for_launch?
  FFIBindings.lldb_attach_info_get_wait_for_launch(@ptr) != 0
end