Scripting ruby-debug

T

thefed

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
 
R

r

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. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,271
Messages
2,571,361
Members
48,043
Latest member
BartEaster

Latest Threads

Top