Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions when running frame or backtrace on a Sinatra application #833

Open
arbesulo opened this issue Mar 17, 2022 · 0 comments
Open

Comments

@arbesulo
Copy link

arbesulo commented Mar 17, 2022

Problem description

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.

#Gemfile
source 'https://rubygems.org'

gem 'sinatra'
gem 'byebug'
# 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) 

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant