When I'm debugging with Byebug sometimes I evaluate some variables in the terminal which causes the displayed line context to 'go up'. Then I would like to print it again to screen. How can I do that?
I thought maybe 'display' will do that but apparently it does something else.
To exit byebug , use the quit command (abbreviated to q ). Normally, if you are in an interactive session, this command will prompt to ask if you really want to quit. If you want to quit without being prompted, enter quit unconditionally (abbreviated to q! ).
Starting Byebug If you're running Byebug on a Rails application in development mode, you no longer need to start the server with --debugger – the debugger is on by default. To get going, simply type byebug (or debugger ) into your source file at the line you're interested in and run the program.
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.
I think you're looking for list =
which basically shows you where you are in the same manner as when you first drop into the debugger (by default - you can turn autolist off).
There are a few different options for the list command. list =
centres the display around the current line. Without the =
it will show the next 10 lines.
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