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

Custom completions #15

Closed
ericonr opened this issue Jul 16, 2020 · 5 comments
Closed

Custom completions #15

ericonr opened this issue Jul 16, 2020 · 5 comments

Comments

@ericonr
Copy link
Contributor

ericonr commented Jul 16, 2020

Hi! I use GDB with a few custom functions, and it would be nice to be able to have auto completion for them, without requiring re-compiling the project. So I was thinking, ugdb could either:

  • take a configuration file generated by a script similar to the one that creates the current completion array or with a new ugdb option. This file could be located in something like ~/.config/udgb/arm-none-eabi-gdb, for each debugger used; or
  • the list could be generated at runtime, with an option to explicitly select this behavior

I think the project should still have a default version, but I would like to have the option. I do believe the implementation for this would be rather simpler than the other issues I have listed here, so I believe I can find the time to do it, but I'd like to know what solution you prefer!

Thanks!

@ftilde
Copy link
Owner

ftilde commented Jul 16, 2020 via email

@ericonr
Copy link
Contributor Author

ericonr commented Jul 16, 2020

I like these three ideas:

  • execute that outputs completions, with env var UGDB_GDB_EXECUTABLE set
  • read that contains the completions
  • automatically generate at runtime - your script for generating the completions seems to run at 50ms here, so running something similar inside Rust shouldn't add too much to the initialization time. I would make it an opt-in command line flag, though. The advantage with this one is that it will always have the options for any debugger that is being used.

That said, I do define my stuff in .gdbinit, but implementing a parser for that might be a bit complicated, since I believe the files can have include entries and a bunch of other stuff.

In a perfect world we would just ask gdb via gdbmi what functions are available

I haven't looked into gdbmi, I will see if I can find any clues about it there (or even ask upstream about adding it).

@ftilde
Copy link
Owner

ftilde commented Jul 21, 2020 via email

@ftilde
Copy link
Owner

ftilde commented Nov 8, 2020 via email

@ericonr
Copy link
Contributor Author

ericonr commented Nov 9, 2020

This is great! Thanks :D

@ericonr ericonr closed this as completed Nov 9, 2020
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

2 participants