Thank you Kai,

I didn't know about this natvis limitation (which makes me wonder what is the exact use case for embedding a natvis file).

Anyway, I think the rest of my concerns are still valid:
- How to make the natvis file available to anyone or at least more visible?
- How to ease external contributions?

One possible option would be to have it installed by default when installing Qt. The natvis file itself could be into a separate repository.
This way, one could easily add it from VS Code using something like:
"visualizerFile": "${QTDIR}/natvis/qt6.natvis"
This will also tie the natvis file to a specific Qt version, and allow having different ones.

Regards,
Nicolas

On 24/02/2025 09:05, Kai Köhne via Development wrote:
Hi,

this idea of 'embedding' was discussed a while ago, but seems to have major limitations:

https://bugreports.qt.io/browse/QTBUG-83396 <https://bugreports.qt.io/browse/QTBUG-83396>

Citing Olli:

    "I had a look at embedding the natvis files into Qt's pdb files and ran into https://developercommunity.visualstudio.com/content/problem/234531/natvis-in-pdb-is-only-applied-to-associated-dll-vs.html <https://developercommunity.visualstudio.com/content/problem/234531/natvis-in-pdb-is-only-applied-to-associated-dll-vs.html> (there is a "Show comments" button on that page). Visualizers that are embedded into modules can only be used inside these modules. So Qt's visualizers can only be used if debugging Qt itself if they are embedded like that."

Unless this is fixed in the meantime, embedding natvis files into Qt dll's seems therefore to be of very limited use.

Kai

------------------------------------------------------------------------
*From:* Development <development-boun...@qt-project.org> on behalf of Giuseppe D'Angelo via Development <development@qt-project.org>
*Sent:* Friday, February 21, 2025 21:56
*To:* development@qt-project.org <development@qt-project.org>
*Subject:* Re: [Development] [Windows] State of the Qt6 natvis file
Il 21/02/25 19:00, Philippe ha scritto:
> /You can't just copy and use the file because of the "##NAMESPACE##::
> everywhere/
> You can find/replace this token all over the file. Easy and it works
> (using Visual Studio).

Considering PDB has support for embedding natvis files, they should be
patched and embedded when building Qt itself. Alas, it seems that this
isn't possible using CMake APIs, but maybe just passing the right
options to the linker works...?

https://gitlab.kitware.com/cmake/cmake/-/issues/16874 <https://gitlab.kitware.com/cmake/cmake/-/issues/16874>

https://learn.microsoft.com/en-us/cpp/build/reference/natvis-add-natvis-to-pdb?view=msvc-170 <https://learn.microsoft.com/en-us/cpp/build/reference/natvis-add-natvis-to-pdb?view=msvc-170>


I'd file a suggestion on the task tracker.


Thanks,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com <http://www.kdab.com>
KDAB - Trusted Software Excellence


-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to