In the following Ruby code:
#! /usr/bin/env ruby
require 'debugger'
def hello
  puts "hello"
  if block_given?
    yield
  end 
end 
def main
  debugger
  puts "test begin..."
  hello do   # <=  if you are here
    puts "here!" #<= how to get here without setting bp here or step into hello?
  end 
end 
main
It's very common during debugging, I don't care about the implementation of the function that yields to the block, I just want to step into the block directly, without manually setting a break-point there.
Does any support for this kind of "step into block" exist in ruby-debug19 or debugger?
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.
Byebug is a Ruby debugger. It's implemented using the TracePoint C API for execution control and the Debug Inspector C API for call stack navigation. The core component provides support that front-ends can build on.
Pry is like IRB on steroids Both IRB and Pry use REPL commands: Read, Evaluate, Print, and Loop. But Pry allows you to go further when debugging. For example, Pry gives you color-coded syntax, which helps when you're trying to figure out what will happen when code is executed.
Have you tried using the "c" command, for "continue"? It optionally takes a line number, so, based on your code sample try:
c 16
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With