ileitch / hijack

Provides an irb session to a running ruby process.
Other
750 stars 22 forks source link

Perhaps the worst bug for a ruby debugger is that it cannot recognize ruby program. #17

Open igenyar opened 8 years ago

igenyar commented 8 years ago

~/hijack/test$ ruby test.rb 33890 ...

~/hijack/test$ ps aux | grep test.rb 1000 33890 97.0 4.1 531808 506212 pts/3 Rl+ 14:45 0:11 ruby test.rb

~/hijack/test$ ../bin/hijack 33890 => Hijacking... => 33890 doesn't appear to be a Ruby process!

Joker ?

igenyar commented 8 years ago

just know that it needs "sudo"

igenyar commented 8 years ago

still using "test.rb"

=> Hijacking...=> WARNING: Did not detect a safe frame on which to set a breakpoint, hijack may fail. => Hijacked 2770 (./test.rb) (ruby 1.8.7 [x86_64-linux]) irb(main):001:0> hijack_debug_mode DRb::DRbConnError: drbunix://tmp/hijack.2770.sock - #<Errno::ENOENT: No such file or directory - //tmp/hijack.2770.sock>

too many craps

ileitch commented 8 years ago

Hijack is has not worked reliably since Ruby 1.8. 1.8 contained a function for debugging purposes that Hijack used to inject code at a safe point. 1.9 removed this function, and it became much, much harder for Hijack to find a safe point at which to halt the program.

I haven't even looked into supporting current Ruby versions. It's probably even harder due to all the GC changes.