Class: Ptrace::Options
- Inherits:
-
Object
- Object
- Ptrace::Options
- Defined in:
- lib/Ptrace.rb
Overview
all ptrace options
Instance Method Summary collapse
-
#initialize(pid) ⇒ Options
constructor
A new instance of Options.
- #write ⇒ Object
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
#write ⇒ Object
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. when 'PTRACE: Operation not permitted' raise OperationNotPermittedError.new(e.) when 'PTRACE: No such process' raise InvalidProcessError.new(e.) else raise end end end |