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

Issue with caller output in byebug >= 7.0.0 #188

Closed
Aqualon opened this issue Nov 11, 2015 · 4 comments
Closed

Issue with caller output in byebug >= 7.0.0 #188

Aqualon opened this issue Nov 11, 2015 · 4 comments

Comments

@Aqualon
Copy link

Aqualon commented Nov 11, 2015

Hi, I found an issue with the output of caller in byebug >= 7.0.0.

I added byebug in a model and then executed a spec testing this model. On the breakpoint I called caller and got the complete stack with byebug 6.0.2 (I removed my home path from the output).

To me that's helpful to follow the codepath that led to a certain place.

(byebug) puts caller
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:52:in `eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:52:in `safe_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:46:in `warning_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:22:in `single_thread_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:13:in `block in thread_safe_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:84:in `allowing_other_threads'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/helpers/eval.rb:13:in `thread_safe_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/processors/command_processor.rb:158:in `run_cmd'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/processors/command_processor.rb:144:in `repl'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/processors/command_processor.rb:95:in `process_commands'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/processors/command_processor.rb:75:in `at_line'
.rvm/gems/ruby-2.2.3/gems/byebug-6.0.2/lib/byebug/context.rb:109:in `at_line'
my_project/app/models/like.rb:14:in `likers_for_story'
my_project/spec/models/like_spec.rb:87:in `block (5 levels) in <top (required)>'
.rvm/gems/ruby-2.2.3/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/raise_error.rb:49:in `call'
.rvm/gems/ruby-2.2.3/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/raise_error.rb:49:in `matches?'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb:50:in `block in handle_matcher'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb:27:in `with_matcher'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb:48:in `handle_matcher'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/expectation_target.rb:54:in `to'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/expectation_target.rb:87:in `to'
my_project/spec/models/like_spec.rb:86:in `block (4 levels) in <top (required)>'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `instance_exec'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `block in run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `block in with_around_and_singleton_context_hooks'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `block in with_around_example_hooks'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `block in run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:618:in `block in run_around_example_hooks_for'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:273:in `call'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:273:in `call'
.rvm/gems/ruby-2.2.3/gems/rspec-rails-3.3.3/lib/rspec/rails/adapters.rb:127:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:378:in `instance_exec'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:378:in `instance_exec'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:389:in `execute_with'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:620:in `block (2 levels) in run_around_example_hooks_for'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:273:in `call'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:273:in `call'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:621:in `run_around_example_hooks_for'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `with_around_example_hooks'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `with_around_and_singleton_context_hooks'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:203:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:559:in `block in run_examples'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `map'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `run_examples'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:521:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `block in run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `map'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `block in run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `map'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:522:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (3 levels) in run_specs'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `map'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (2 levels) in run_specs'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1627:in `with_suite_hooks'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:114:in `block in run_specs'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:77:in `report'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
.rvm/gems/ruby-2.2.3/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
.rvm/gems/ruby-2.2.3/bin/rspec:23:in `load'
.rvm/gems/ruby-2.2.3/bin/rspec:23:in `<main>'
.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

In byebug >= 7.0.0 I only get output of byebug's own eval.rb which for me is not really useful.

(byebug) puts caller
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:52:in `eval'
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:52:in `safe_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:46:in `warning_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:22:in `single_thread_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:13:in `block in thread_safe_eval'
.rvm/gems/ruby-2.2.3/gems/byebug-8.1.0/lib/byebug/helpers/eval.rb:86:in `block in allowing_other_threads'
nil

Is this a bug or do I have to do something differently in byebug 7.0.0 and above to get the complete callstack? Also tried latest 8.1.0 and this version shows the same.

@deivid-rodriguez
Copy link
Owner

Yep, this can be considered a bug. It was introduced together with #184.

Notice thought that you can get the stack with the bt command. Does that work as an alternative for now?

deivid-rodriguez pushed a commit that referenced this issue Nov 11, 2015
Don't eval things in a different thread unless using a new `debug` command.
@deivid-rodriguez
Copy link
Owner

@Aqualon Try last master and check if this is fixed, please.

@Aqualon
Copy link
Author

Aqualon commented Nov 12, 2015

@deivid-rodriguez I checked it and the caller output looks again like it used to. Thanks for the fast fix!

@deivid-rodriguez
Copy link
Owner

@Aqualon You're welcome, thanks for checking!

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

2 participants