Skip to content

When set "valueFormatting":"prettyPrinters", looking value of uninited vectors results in longlongtime circling #462

Open

Description

@yjdyamv

Hello, as title says, when it happend, I had to stop debuging and in the next time only looking those containers that had being inited. At least not let my debug breaking in halfway. And I use Microsoft C/C++ extension, their solution is only showing at most 1000 items in vectors in the debug panel for not only uninited items but also inited items.

Image_1766482675236_557.png

Activity

  1. GitMensch commented on Dec 23, 2025

    @GitMensch
    Collaborator

    GDB doesn't know if the data is initialized or not, it just shows them with info locals (this extension uses the mi variant of this command).
    If you enable pretty-printers then GDB is asked to use the pretty-printers installed to show the value... and as long as those don't recognize and handle negative lengths, something like you've described will be the result - this extension cannot do anything about that.

    How to solve this? The best way would be to check for pretty-printers that at least handle the negative length as "not initialized" and does not print the vector's elements then. If they don't exist then you can create them and load them with the gdb options in the launch config.
    The only other alternative would be to disable pretty-printing.

    So: what are you going to do - and what should we do with this issue (possibly documenting it in README)?

  2. yjdyamv commented on Dec 23, 2025

    @yjdyamv
    Author

    Got it, thanks for clarifying! I'll just disable pretty-printing for now. And yes, adding a note about this to the README sounds like a great idea. It will definitely save others some headache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions