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

Termdebug: add frames window and :Frames, similar to :Asm #9235

Open
GitMensch opened this issue Nov 28, 2021 · 10 comments
Open

Termdebug: add frames window and :Frames, similar to :Asm #9235

GitMensch opened this issue Nov 28, 2021 · 10 comments

Comments

@GitMensch
Copy link
Contributor

GitMensch commented Nov 28, 2021

A new window for showing the current frames and highlight (similar to the assembler window) the current place would be nice :-) Likely more often used than the assembly window (which is definitely cool to have, too).

I assume that this would share much of the dissasembly code but using backtrace command instead of dissasembly.

@GitMensch GitMensch changed the title Termdebug: add a new window for showing the current frames and highlight (similar to the assembler window) the current place Termdebug: add frames window and :Frames, similar to :Asm Nov 28, 2021
@lacygoill
Copy link

This is just a suggestion as I'm not familiar enough neither with debugging, nor with this new window, but if you think you end up with too many windows, you might be interested in a popup window, because the latter can be displayed over the others, and can be toggled on and off (see :help popup_hide() and :help popup_show()). Although that would only be OK if you don't intend to focus it; i.e. you just want to be able to read some info.

You might also try to set every frame as an entry in the quickfix list (or the location list); this way, you could leverage all the builtin commands around the quickfix window like :cnext, :cfirst ... and friends.

@lacygoill
Copy link

You might also try to set every frame as an entry in the quickfix list (or the location list); this way, you could leverage all the builtin commands around the quickfix window like :cnext, :cfirst ... and friends.

On that front, you might be interested in :help getqflist-examples, :help setqflist-examples, and :help quickfix-window-function (a concrete example is given at the end of the page).

@GitMensch
Copy link
Contributor Author

Popups would be space-wise interesting, but in one of my personal use cases not usable - #3208. (Or did I misinterpret that and a popup is totally different from balloons?)

I'm not very familiar with the quickfix support - but that is very likely the best way to handle :Frames with the builtin commands. Thanks for pointing this out and for adding the help pointers.

@lacygoill
Copy link

lacygoill commented Nov 28, 2021

(Or did I misinterpret that and a popup is totally different from balloons?)

A popup is different than a balloon. See this Popup window gallery page on the wiki for a few screenshots and get an idea of what you could achieve.

@GitMensch
Copy link
Contributor Author

@brammool: Are you ok with a Frames Window? You know, just asking before I work more on that...

@ all: With the quickfix list being "likely doable": would we still want an extra command for switching the frames #9234 or should this be dropped because the quickfix list will be usable for the navigation and "enough"?

@GitMensch
Copy link
Contributor Author

@lacygoill after a bit of hacking the quickfix list I see that the commands are nice - but the list isn't usable (or I've missed something).
Reason: We don't want to ask vim go to the file on the given line (which is possible to parse from the response of -stack-list-frames), but we want to ask gdb to go to the frame (and from the resulting gdb mi information lead vim to go there. Otherwise we'd be in a frame and all :Evaluate will still go to the original frame.

Also, as the stack frame may be always open a :Frame 5 command would be useful in any case - no need to switch the window.

Any opinions and/or thoughts?

BTW: is there a reasonable syntax for a stacktrace or even the default GDB backtrace format for the Frames window?

@brammool
Copy link
Contributor

brammool commented May 5, 2022 via email

@GitMensch
Copy link
Contributor Author

Yes, the output of where, updated on each "stop" (so step, brreakpoint reached, ...).
I have navigation through frames implemented as :Up, :Down (both using cli commands as the extension currently doesn't keep track of the active frame) and :Frame N.

I would like to "somehow" use the frames-window for navigation, but I don't know how to achieve this (it is just a buffer with text), and my try with quickfix list ended in "gdb must select the frame, not vim the file".

@brammool
Copy link
Contributor

brammool commented May 5, 2022 via email

@GitMensch
Copy link
Contributor Author

"possible in general" != possible for me, yet;
but I try to polish the current "Frames" window (view only, but always up to date) and frame related commands, then do a PR.

I hope you can then add the buffer-local mappings (the features will be in as functions already) and, if I haven't done that already marking of the current frame.

GitMensch added a commit to GitMensch/vim that referenced this issue May 9, 2022
GitMensch added a commit to GitMensch/vim that referenced this issue Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants