ruby-debug

R

RubyNewbie

Question:
I was wondering if there was a way to instruct the ruby debug
framework to stop/break/freeze on any error so I can investigate the
call stack to diagnose the problem?

Background:
I am using 'ruby-debug' and know that I can insert breakpoints with
the debugger() method call in my code. I have run into errors within
unexpected callbacks and often have no idea why the code traversed
that path. Because I don't understand the code path it's hard to know
where to put the breakpoint to troubleshoot the problem.

- Thanks in advance.
 
M

Marnen Laibow-Koser

RubyNewbie said:
Question:
I was wondering if there was a way to instruct the ruby debug
framework to stop/break/freeze on any error so I can investigate the
call stack to diagnose the problem?

Background:
I am using 'ruby-debug' and know that I can insert breakpoints with
the debugger() method call in my code. I have run into errors within
unexpected callbacks and often have no idea why the code traversed
that path. Because I don't understand the code path it's hard to know
where to put the breakpoint to troubleshoot the problem.

Then what you need is not a debugger; you need to understand the code
better (more tests?). Or put the breakpoint before the branch and watch
what happens to *make* the program choose it's path.
- Thanks in advance.

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
(e-mail address removed)
 
R

Roger Pack

Background:
I am using 'ruby-debug' and know that I can insert breakpoints with
the debugger() method call in my code. I have run into errors within
unexpected callbacks and often have no idea why the code traversed
that path. Because I don't understand the code path it's hard to know
where to put the breakpoint to troubleshoot the problem.

You could try

(rdb:) catch Exception

or running it like
rdebug --trace # run it with a tracer.
-r
 

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

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top