rdebug usage

D

David Schulberg

Hi,

I have a couple of questions about using rdebug
1. When you are passing parameters to a ruby script how do you do that
when you call your ruby script with rdebug?
2. When control passes from one ruby script to another in an application
how can breakpoints be set within a nested structure of ruby scripts?

Regards,
David

P.S. Is this the best place to pose questions about rdebug?
 
R

Rick DeNatale

Hi,

I have a couple of questions about using rdebug
1. When you are passing parameters to a ruby script how do you do that
when you call your ruby script with rdebug?

From the example given by rdebug --help

Usage: rdebug [options] <script.rb> -- <script.rb parameters>

In other words after the name of the script use a double - then the
parameters for the script.
2. When control passes from one ruby script to another in an application
how can breakpoints be set within a nested structure of ruby scripts?

with the rdebug breakpoint command

b path/to/some_ruby_script.rb:42

The file does not need to have been previously loaded.

where 42 is the line number where you want the breakpoint set.

There are also extensions to various editors which allow breakpoints
to be set from the editor after initiating a session with the
debugger. For example the RubyAmp textmate bundle allows this.

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
 

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

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top