microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.54k stars 1.56k forks source link

Please consider shipping debugger visualizers for libstdc++/libc++ #3423

Open zhihaoy opened 5 years ago

zhihaoy commented 5 years ago

Type: Debugger

Visual Studio does it already, it ships linux.natvis which supports libstd++ and libc++ at the same time. But cpptools doesn't, so hovering mouse cursor on STL containers doesn't get visualized out-of-the-box on Linux and Mac OS X. I think this part should work out of the box (with cppdbg).

juancarlossanchez commented 5 years ago

This seems to be a general bug, if a variable has children (Function: pretty_printer.children on visualizer), the string representation (Function: pretty_printer.to_string) does not shown, if pretty_printer.children does not exist (no children) it works as expected.

xscavx commented 5 years ago

Did you know any workaround? Maybe some gdb setting?

zhihaoy commented 5 years ago

My workaround is to combine my custom .nativs with stl.natvis shipped with Visual Studio 2017; worked pretty well.

Trass3r commented 4 years ago

Indeed, VS's stl.natvis should be shipped with this extension. This would also allow contributions.

jessicah commented 2 years ago

E.g. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\Packages\Debugger\Visualizers\stl.natvis"? Did you just dump stl.natvis into your file? Or is there another file that is used for gcc's libstdc++, for example?

zhihaoy commented 2 years ago

Search for a file named linux.natvis

jessicah commented 2 years ago

Hmm, no linux.natvis here, do you know which workload/component installs it?

zhihaoy commented 2 years ago

Then this one C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\Linux\Linux\stl.natvis

rgeorgiev583 commented 2 years ago

@zhihaoy could you please share the stl.natvis file that you're using?