Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 802
steven_noble Avatar asked Jul 05 '11 12:07

steven_noble


People also ask

How do you debug a break point?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

How do I run a Ruby script in debug mode?

In order to start the Ruby debugger, load the debug library using the command-line option -r debug. The debugger stops before the first line of executable code and asks for the input of user commands.

How do I step through Ruby code?

Force step over Steps over the current line of code and takes you to the next line even if the highlighted line has method calls in it. If there are breakpoints in the called methods, they are ignored. From the main menu, select Run | Force Step Over or press Alt+Shift+F8 .


1 Answers

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.

like image 54
Frost Avatar answered Oct 23 '22 01:10

Frost