Open swarren opened 1 year ago
Pretty print comes from GDB, if we were to support this feature, this would be 2 additional engine settings calls and n calls to all variables again.
e.g disable pretty printing, gather all the variables again, then re-enable pretty printing.
Out of curiosity, did you implement the children
, display_hint
, num_children
, and child
API for your pretty printer? https://sourceware.org/gdb/current/onlinedocs/gdb.html/Pretty-Printing-API.html#Pretty-Printing-API Or have you considered doing so?
The pretty printer implementation in question is taken from a 3rd-party project. It looks like it implements children
, but not the other APIs you mentioned. Here's a link to the relevant .gdbinit file containing the implementation: https://github.com/p4lang/p4c/blob/main/.gdbinit (I'm using an older commit from that repo, but it looks like at least the first pp implementation in the file hasn't changed vs. the copy we have.)
Do you think implementing those APIs would resolve this issue, or were you just curious?
@nvswarren I was just curious... and now I'm really curious :D but I don't want to do the work to find out the answer :D
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
In my .gdbinit, I have a gdb pretty-printer function defined. In launch.json, pretty printing is enabled:
This is fine because I see pretty prints if I dump variables via the gdb console within vscode. However, pretty printing also affects the Variables/Locals display, and this prevents me from expanding the relevant class/struct values to show the individual internal fields.
Request: vscode always disable pretty printing while it is retrieving the values to display in the Variables/Locals display, so that I can always expand values to see the actual member fields. Essentially, leave pretty printing for console commands only.
That request may make pretty printing less useful; some people may like seeing the pretty printed values in the Variables/Locals display. So perhaps:
Alternative request: vscode display the pretty printed values by default, just like it does today if pretty printing is enabled, but when the arrow that allows expanding/collapsing member fields is clicked, then temporarily disable pretty printing just while retrieving the member fields.
Debugger Configurations
Debugger Logs
Other Extensions
No response
Additional Information
No response