We even have an option in the VS Tools: 
https://doc.qt.io/qtvstools/qtvstools-how-to-embed-natvis-files.html

On 24. Feb 2025, at 09:20, Marcus Tillmanns <marcus.tillma...@qt.io> wrote:

So we should include the natvis with our Qt Installations, and then link them 
into the .pdb of the user application via some cmake magic I guess?

Cheers,
Marcus

On 24. Feb 2025, at 09:05, Kai Köhne via Development 
<development@qt-project.org> wrote:

Hi,

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

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
 (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://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


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

Reply via email to