Jump to next line of *my code* in ruby-debug
Asked Answered
O

1

13

In ruby-debug, the next command takes you to the next line of code to be executed, regardless of whether that line is in your own code, or in the rails framework, or in a gem.

Is there some way to force ruby-debug (1.9) to jump to the next line that it encounters in your code without stopping at all the other lines it must execute along the way?

Or answered 5/7, 2011 at 12:57 Comment(1)
Can you just manually set a breakpoint for the next line and continue on to the next breakpoint?M16
U
4

Yes, there is.

You can use break linenum to manually set a breakpoint on an arbitrary line number (for instance the next one), and then type c to continue to the next breakpoint.

The documentation for ruby-debug breakpoints would probably help you a bit as well.

Unemployable answered 5/7, 2011 at 15:33 Comment(4)
...but I don't think there is a way to do the equivalent of Eclipse's java debuggers "step over" functionality.Unemployable
Thanks. I'll see if I can somehow use break linenum programmatically to set a breakpoint for every line.Or
Hmmm... I was hoping that (1..100).each { |l| break l } would do the trick. Might just create a TextMate script to add a break before each line in the file and another to remove it.Or
Yeah, that's crazy! Perl debugger is so much awesomer. You can just press 'n' and it will step over the next line, even if it is a subroutine. Nearly every debugger let's you skip over the line without descending into the method.Cain

© 2022 - 2024 — McMap. All rights reserved.