Debugging?
-
Is it possible to hook up a debugger to SU scripts?
I'd like to use breakpoints and stepping etc.
-
No?
-
I've seen a ruby gem called ruby_debug, but I don't know anything about gems, or if such a thing is compatible with SU. It seems to imply it's like a command-line debugger.
-
@avariant said:
I've seen a ruby gem called ruby_debug, but I don't know anything about gems, or if such a thing is compatible with SU. It seems to imply it's like a command-line debugger.
Debug is built into the base Ruby system. And you can attempt to load it from an installed Ruby version 1.8 directory.
# Add debug library load path $;.push "c;/User/Programs/ruby/lib/ruby/1.8" # invoke the debugger require "debug.rb" puts "Ready to run"
Result:
load "/temp2/dbug.rb" Error; #<Errno;;EBADF; Bad file descriptor> c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;74;in `flush' c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;74;in `readline' c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;275;in `debug_command' c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;705;in `excn_handle' c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;755;in `trace_func' c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;945 c;/User/Programs/ruby/lib/ruby/1.8/debug.rb;944
Debug Line 74: is
STDOUT.flushBut... it was built to run under a shell, such as MS DOS and writes to STDOUT and reads from STDIN console files.
Since SU imbeds Ruby in a GUI window, there is no STDIN or STDOUT.
I suspect with experimentation and work, STDIN and STDOUT could be redirected to the SU Ruby window, or a shell could be started to run along side SU to accept debugger IO.
It would take replacing the Ruby 1.8 debug.rb script with another compatible with SU.
An interesting project. It should be done. Anyone?
-
That would be very interesting.
I don't think I have the experience to do it though. -
See plugin SCrud:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=16791
Advertisement