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

Feature Request: Make vim the owner of breakpoints and not the debugger #184

Open
lanza opened this issue Mar 10, 2023 · 3 comments
Open

Comments

@lanza
Copy link
Contributor

lanza commented Mar 10, 2023

When you use a debugger in an IDE the IDE itself is the entity that owns the breakpoints. So when you click in the gutter and add a little red triangle the IDE gets the breakpoint request and then forwards it to the debugger. When the debugger is stopped and closed the breakpoints persist. So when you start your debugging session again you maintain the same set of breakpoints.

e.g.

clion.mov

It would be nice to have some sort of global vim variable that persists breakpoints. Even a file ~/.config/nvim-gdb/breakpoints.json might make sense.

@WuerfelDev
Copy link

WuerfelDev commented Mar 14, 2023

I thought about a buffer object in the plugin that holds the breakpoints so I could set them before launching the debugger. Personally I don't need persistent storage but won't argue against it :)

@sakhnik
Copy link
Owner

sakhnik commented Apr 27, 2023

Considering this idea would mean a big change. The plugin nvim-gdb doesn't do anything currently before any debugger backend is launched. So there should be another state added similar to "debug view" in IDE. I can think of strong arguments for keeping the plugin minimalistic.
Moreover, I'm sure there is a debugger-specific way to just save the current breakpoints to a file, and then load them back another time.

@lanza
Copy link
Contributor Author

lanza commented Apr 27, 2023

Moreover, I'm sure there is a debugger-specific way to just save the current breakpoints to a file, and then load them back another time.

Yea, that's what I was thinking. I have a cmake plugin where I do similar. I just cache a few things like the last launched target, the args you passed to the target, the last build dir, the last source dir, etc.

When I go to run another command I just reparse the json file and then rewrite it at the end of the function if it was changed. It's obviously inefficient but the timeframe for reading and writing a small json file isn't perceptible by a human user, so it's actually a nice perk to have an on disk file as your source of truth for persistence.

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

3 participants