Class: ASMREPL::Linux::Tracer
- Inherits:
-
Object
- Object
- ASMREPL::Linux::Tracer
- Defined in:
- lib/asmrepl/linux.rb
Instance Method Summary collapse
- #continue ⇒ Object
-
#initialize(pid) ⇒ Tracer
constructor
A new instance of Tracer.
- #state ⇒ Object
- #state=(state) ⇒ Object
- #wait ⇒ Object
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
#continue ⇒ Object
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 |
#state ⇒ Object
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 |
#wait ⇒ Object
102 103 104 |
# File 'lib/asmrepl/linux.rb', line 102 def wait Process.waitpid @pid end |