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.



98
99
100
# File 'lib/asmrepl/linux.rb', line 98

def initialize pid
  @pid = pid
end

Instance Method Details

#continueObject



119
120
121
122
123
# File 'lib/asmrepl/linux.rb', line 119

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

#stateObject



106
107
108
109
110
111
# File 'lib/asmrepl/linux.rb', line 106

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

  state
end

#state=(state) ⇒ Object



113
114
115
116
117
# File 'lib/asmrepl/linux.rb', line 113

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

  state
end

#waitObject



102
103
104
# File 'lib/asmrepl/linux.rb', line 102

def wait
  Process.waitpid @pid
end