ruby-debug

Discussion in 'Ruby' started by RubyNewbie, Dec 2, 2009.

  1. RubyNewbie

    RubyNewbie Guest

    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.
    RubyNewbie, Dec 2, 2009
    #1
    1. Advertising

  2. RubyNewbie wrote:
    > 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

    --
    Posted via http://www.ruby-forum.com/.
    Marnen Laibow-Koser, Dec 2, 2009
    #2
    1. Advertising

  3. RubyNewbie

    Roger Pack Guest


    > 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


    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Dec 2, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RonL
    Replies:
    0
    Views:
    718
  2. ringos75
    Replies:
    0
    Views:
    930
    ringos75
    Apr 14, 2005
  3. Mike C. Fletcher
    Replies:
    3
    Views:
    966
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 12, 2003
  4. André
    Replies:
    3
    Views:
    1,554
  5. Kent Sibilev
    Replies:
    0
    Views:
    92
    Kent Sibilev
    Feb 2, 2007
Loading...

Share This Page