You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your proposal
When I used pry, I often used the @ command to show the context around the debugger. Let's say you break somewhere and it prints the debugger call and surrounding code. Then I do ls @article to print a lot of info about some variable/object. Now the context around the debugger is far away, so I type @ to see it again. I tried with debug to use list and it works once, but the next time I use list it shows the successor lines instead. Then I have to type list - to go back up again which is a bit annoying...
So, it would be nice to have a command that always works as the first invocation of list.
Additional context
Maybe there already is a command that does this that I'm missing?
Reacted by Wassim Metallaoui and Mahendra Kulkarni
I'm not a pry user, so I don't know what @ shows. Do you need only list - or more information?
It shows what list does the first time. The code and context around the breakpoint. list does it but if you run list again it shows the chunk of code after instead and I have to run list - to page back up again.
list does it but if you run list again it shows the chunk of code after instead and I have to run list - to page back up again
I see.
$ ruby ~/src/rb/t.rb
From: /home/ko1/src/rb/t.rb:9 Object#bar:
8: def bar
=> 9: binding.pry
10: end
[1] pry(main)> @
From: /home/ko1/src/rb/t.rb:9 Object#bar:
8: def bar
=> 9: binding.pry
10: end
It seems print same information when it stops.
[4, 13] in ~/src/rb/t.rb
4| def foo
5| bar
6| end
7|
8| def bar
=> 9| binding.b
10| end
11|
12| foo
13|
=>#0 Object#bar at ~/src/rb/t.rb:9
#1 Object#foo at ~/src/rb/t.rb:5
# and 1 frames (use `bt' command for all frames)
maybe same on debug.gem, you asked.
I understand the request. pry's feature @ is alias of whereami.
The name whereami is acceptable?
Activity
ko1 commentedon Jun 25, 2022
I'm not a pry user, so I don't know what
@shows. Do you need onlylist -or more information?Linuus commentedon Jun 25, 2022
It shows what list does the first time. The code and context around the breakpoint. list does it but if you run list again it shows the chunk of code after instead and I have to run list - to page back up again.
ko1 commentedon Jul 5, 2022
I see.
It seems print same information when it stops.
maybe same on debug.gem, you asked.
I understand the request. pry's feature @ is alias of
whereami.The name
whereamiis acceptable?ko1 commentedon Jul 5, 2022
I want to introduce
aliasfeature in future and maybe users can setalias @ whereamiko1 commentedon Oct 24, 2022
I have another question.
When we choose another frame with
frame 10, which frame should be shown?ko1 commentedon Oct 24, 2022
gdb has
frameandwherecommand, andframeshows chosen frame (10th frame) with one sourcewhereshows backtrace from 0th (alias ofbacktrace)The proposal refers
listandlistaffects chosen frame (show 10th frame's code).`whereami` command
`whereami` command