Class: Ptrace::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/Ptrace.rb

Overview

all ptrace options

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ Options

Returns a new instance of Options.



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

def initialize(pid)
  @pid = pid
end

Instance Method Details

#writeObject



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/Ptrace.rb', line 61

def write
  opts = []

  begin
    Debugger.send_data( Debugger.commands[:set_options], @pid, nil, opts )
  rescue RuntimeError => e
    case e.message
      when 'PTRACE: Operation not permitted'
        raise OperationNotPermittedError.new(e.message)
      when 'PTRACE: No such process'
        raise InvalidProcessError.new(e.message)
      else
        raise
      end
  end
end