[Development] [Windows] State of the Qt6 natvis file

Nicolas Arnaud-Cormos nicolas.arnaud-cormos at kdab.com
Mon Feb 24 10:03:06 CET 2025


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-bounces at qt-project.org> on behalf of 
> Giuseppe D'Angelo via Development <development at qt-project.org>
> *Sent:* Friday, February 21, 2025 21:56
> *To:* development at qt-project.org <development at 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.dangelo at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250224/19e7b5ff/attachment.htm>


More information about the Development mailing list