Scripting ruby-debug

Hello everyone,

Really simple question -
  Is there a way to script ruby-debug?

What I mean is can, I do something like:

Debugger.commands do
  var local
  var global
  ...
end

?

Thanks,
Ari

Really simple answer - probably not yet.

However for the version of ruby-debug in SVN when I run this:

  require "rubygems" ; require "ruby-debug"
  require 'stringio'
  Debugger.start
  op = StringIO.new("", "w")
  open("debug.cmds", 'w') {|f| f.puts "help"}
  Debugger.run_script("debug.cmds", op)
  puts op.string

I get:

ruby-debug help v0.9.4
Type 'help <command-name>' for help on a specific command

Available commands:
break delete exit interrupt pp putl reload save show
thread
catch eval help p ps quit restart set source

And instead of "help" in the string that goes to the command file I
can put in sequences of any of the above commands. I'm not sure why I
don't see all of the debugger commands. However I've used this to
write some simple unit tests for ruby-debug.

And finally, since ruby-debug is largely just Ruby, there's always
monkey patching. :slight_smile:

···

On Nov 29, 6:44 pm, thefed <fed...@gmail.com> wrote:

Hello everyone,

Really simple question -
        Is there a way to scriptruby-debug?

What I mean is can, I do something like:

Debugger.commands do
        var local
        var global
        ...
end

?

Thanks,
Ari