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

Can't set catchpoint in .byebugrc #92

Closed
torbiak opened this issue Nov 3, 2014 · 4 comments
Closed

Can't set catchpoint in .byebugrc #92

torbiak opened this issue Nov 3, 2014 · 4 comments
Labels

Comments

@torbiak
Copy link

torbiak commented Nov 3, 2014

I want to set a catchpoint for Exception in .byebugrc, but when I add catch Exception to the init file I get the following exception:

Exception `NoMethodError' at /home/jtorbiak/.gem/ruby/2.1.0/gems/byebug-3.5.1/lib/byebug/command.rb:47 - undefined method `frame_pos' for #<Byebug::ControlCommandProcessor::State:0x8ab6258>

I want to set the default catchpoint because in post-mortem mode I can't navigate the stack: where prints out multiple frames, but up/down always say "Can't navigate beyond the newest/oldest frame".

I'm running ruby 2.1.4p265 and byebug 3.5.1.

@deivid-rodriguez
Copy link
Owner

Hi @torbiak ! Thanks for the report, not only you spotted a bug but two of them. I'll open a separate issue for the other problem you're experiencing.

Hope to have a look into this soon.

deivid-rodriguez pushed a commit that referenced this issue Nov 27, 2014
Related to #92. Catch command is not allow anymore in control mode. It
was broken and I don't think it's worth fixing it. When loading the init
script, there's not an available context with associated
file/line/binding so we can not check whether the class to be catched is
defined or not. I can think of some workarounds but this is exactly how
"set post_mortem" is meant to be used so I'm just banning it.
@deivid-rodriguez
Copy link
Owner

@torbiak I've decided to just not allow the catch command in the .byebugrc file. The catch command requires a class name, but during .byebugrc loading I have no associated context (file, line, binding) so I can't check whether the class passed to the command is a valid defined class. I can think of some workarounds to this but we have the set post_mortem setting which does just the same thing, so I decided to just ban this command in .byebugrc.

I'm closing this, but feel free to continue the discussion or reopen this if you don't agree.

@torbiak
Copy link
Author

torbiak commented Dec 2, 2014

Cool. I totally agree. As I mentioned I only wanted to do this as a temporary workaround for the up/down issue in post-mortem. I should have emphasized that as being the main issue.

Thanks.

@deivid-rodriguez
Copy link
Owner

👍

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

No branches or pull requests

2 participants