Report abuse

intro


			
OK, so, with all this talk about GDB and Ruby working together, what about a way
to directly insert a call to GDB directly INTO a running Ruby script? Well, with my
little Inspector script, that is!

inspector.rb in your system-wide lib directory (or in the path somewhere) (ruby)


			
trap("INT") do
  system "gdb ruby #{Process.pid}"
end

just use this when you want to enable the functionality! (ruby)


			
require 'inspector' if $DEBUG

finally


			
Just call this by pressing C+c anytime when the script is running to jump right
into GDB. But, make sure -d is turned on (or you set $DEBUG to true, or just take
off that requirement) in your script to actually include the inspector!