When debugging an application, exceptions are raised when issuing some commands like frame or backtrace.
Evaluating expressions, viewing variables or moving up and down work normally.
The environment:
Ruby v3.0.5
Sinatra v3.0.6
Byebug v11.1.3
Expected behavior
The frame/backtrace information is displayed.
Actual behavior
An exception is raised
(byebug) frame
*** undefined method `GET /' for class `Sinatra::Application'
Did you mean? get
gets
(byebug)
Steps to reproduce the problem
I have created a demo repository with a minimal setup that demonstrates the problem.
# app.rb
#!/bin/env ruby
require 'sinatra'
require 'byebug'
get '/' do
debugger
[200, {'content-type' => 'text/plain'}, 'Hello world!']
end
# Install the gems
bundle install
# Start the server
ruby app.rb -o 0.0.0.0
#Perform a request
curl localhost:4567
After hitting the debugger call frame or backtrace
# This is an old output, but the problem remains with the most up-to-date versions
== Sinatra (v2.2.0) has taken the stage on 4567 for development with backup from Puma
Puma starting in single mode...
* Puma version: 5.6.2 (ruby 2.7.5-p203) ("Birdie's Version")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 30836
* Listening on http://0.0.0.0:4567
Use Ctrl-C to stop
[1, 9] in /Users/fer/wokspace/sinatra-byebug/app.rb
1: #!/bin/env ruby
2:
3: require 'sinatra'
4: require 'byebug'
5:
6: get '/' do
7: debugger
=> 8: [200, {'content-type' => 'text/plain'}, 'Hello world!']
9: end
(byebug) frame
*** undefined method `GET /' for class `Sinatra::Application'
Did you mean? get
gets
(byebug)
Problem description
When debugging an application, exceptions are raised when issuing some commands like
frame
orbacktrace
.Evaluating expressions, viewing variables or moving
up
anddown
work normally.The environment:
Expected behavior
The frame/backtrace information is displayed.
Actual behavior
An exception is raised
Steps to reproduce the problem
I have created a demo repository with a minimal setup that demonstrates the problem.After hitting the
debugger
callframe
orbacktrace
Thanks in advance!