-
Notifications
You must be signed in to change notification settings - Fork 9
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
Comments
Hey! Although I currently have no use for it myself, I see how that
could be useful. I think I would lean towards a command/script that can
be passed as an option, is then executed at startup and just prints a
newline separated list of possible completions. In a very simple case
that command could just be `cat file_with_completions.txt`. In a more
complicated scenario one could select the completions based on the
selected debugger (e.g., we could execute the script with a
`UGDB_GDB_EXECUTABLE` environment variable or something like that) or
generate them procedurally (maybe even parse the file that defines your
custom functions?).
Another idea possibly also suitable for your use case: We could parse
`.gdbinit` and look for function definitions in there (and/or somewhere
else? where?). However, I'm not sure how difficult that would be and if
that would include your custom functions. How do you include/define them
in gdb?
In a perfect world we would just ask gdb via gdbmi what functions are
available, but I haven't found a way to do that. I'm not too happy with
the hard coded list of gdb commands myself. :(
…On 15.07.2020 19:56, Érico Nogueira Rolim wrote:
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!
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#15
|
I like these three ideas:
That said, I do define my stuff in
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). |
If you want are willing to poke upstream about this, that would be
awesome and definitely the best solution for the problem.
In case that doesn't work out I would suggest:
1. Implement the `execute <file` option since it is the most flexible.
2. Then see if we can use the same infrastructure to dynamically read
`gdb help` with a script and if it's fast enough.
|
I've implemented dynamic completions in
f59e621. Does that cover your use case?
In my testing a function defined in .gdbinit can also be completed,
since it appears in the "help all" output of gdb.
|
This is great! Thanks :D |
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:
ugdb
option. This file could be located in something like~/.config/udgb/arm-none-eabi-gdb
, for each debugger used; orI 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!
The text was updated successfully, but these errors were encountered: