Class: ASMREPL::Linux::Tracer

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

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ Tracer

Returns a new instance of Tracer.



164
165
166
# File 'lib/asmrepl/linux.rb', line 164

def initialize pid
  @pid = pid
end

Instance Method Details

#continueObject



179
180
181
182
183
# File 'lib/asmrepl/linux.rb', line 179

def continue
  unless Linux.ptrace(Linux::PTRACE_CONT, @pid, 1, 0).zero?
    raise
  end
end

#stateObject



172
173
174
175
176
177
# File 'lib/asmrepl/linux.rb', line 172

def state
  state = ThreadState.malloc
  raise unless Linux.ptrace(PTRACE_GETREGS, @pid, 0, state).zero?

  state
end

#waitObject



168
169
170
# File 'lib/asmrepl/linux.rb', line 168

def wait
  Process.waitpid @pid
end