pry-byebug icon indicating copy to clipboard operation
pry-byebug copied to clipboard

Rescue unhandled exceptions functionality

Open wsny opened this issue 10 years ago • 7 comments

PR #55 seems to have broken compatibility with pry-rescue and its use of pry-stack_explorer (see ConradIrwin/pry-rescue#85). #55 overrides the up and down commands that pry-stack_explorer has, and pry-rescue is trying to go around pry-byebug it would seem, but can only access pry-byebug up and down commands now.

wsny avatar Apr 29 '15 18:04 wsny

Yes, pry-byebug is incompatible with pry-stack_explorer or any plugins making use of it. byebug already provides the functionality pry-rescue offer so the solution I'd like for this issue is to bring that functionality through byebug.

I'll leave this open as a remainder.

deivid-rodriguez avatar Apr 29 '15 20:04 deivid-rodriguez

Hi. Does byebug already have "Rescue unhandled exceptions functionality"? How can I make it work? Also, byebug's frame output format is pretty different from that of pry-rescue's show-stack. show-stack lists all frames up to the top, so it's more informative. Is is possible to implement it in byebug?

[5] pry(main)> show-stack

Showing all accessible frames in stack (6 in total):
--
=> #0  ccc <Object#ccc()>
   #1 [block]   block in ccc <Object#ccc()>
   #2 [method]  ccc <Object#ccc()>
   #3 [method]  bbb <Object#bbb()>
   #4 [method]  aaa <Object#aaa()>
   #5 [main]    <main>
[6] pry(main)> frame
#0  ccc <Object#ccc()>
      in main @ hoge.rb:23

aoyama-val avatar Jan 16 '16 10:01 aoyama-val

Hi @aoyama-val, thanks for your comments.

byebug does have the "rescue unhandled exceptions" functionality. You have to enable the post_mortem option through set post_mortem. But, there are some issues with it in rubies >= 2.2.4, see https://github.com/deivid-rodriguez/byebug/issues/165. I'm not sure whether it's totally broken or not, you can try.

Regard the way of showing the stack, you're mistaking the frame command with the bt (or backtrace or where command). That's the correct way of showing the full stack.

deivid-rodriguez avatar Jan 16 '16 12:01 deivid-rodriguez

Hi @deivid-rodriguez, thanks for the information.

I gavepost_mortem a quick try with Ruby 2.3.0, and I didn't notice any failure. So it seems not broken totally.

byebug has bt/backtrace/where commands, but pry-byebug does NOT. So we cannot use them in a pry session. Am I missing something?

aoyama-val avatar Jan 16 '16 14:01 aoyama-val

You're welcome! I'm glad the good old post-mortem mode is still usable :)

Regarding your second comment, yes, you're right. pry-byebug needs a command to show the full stack. I thought you were aware of it since you mentioned byebug's frame command in your first message (which exists too). Now I see you meant pry-byebug's frame command.

In any case, feel free to work on adding this new show-stack command!

deivid-rodriguez avatar Jan 17 '16 09:01 deivid-rodriguez

Any progress on bringing post-mortem functionality through to pry-byebug from byebug?

vincentwoo avatar Apr 09 '18 23:04 vincentwoo

Not really, sorry.

deivid-rodriguez avatar Apr 09 '18 23:04 deivid-rodriguez