Can I use .natvis file to always display uintptr_t as hex?

78 Views Asked by At

I'm probably just not searching well enough, but its unclear to me how (or if its possible) to specify that the variable should be displayed in a particular way. All the examples are structs or classes with member variables, but uintptr_t has none.

Is it?

1

There are 1 best solutions below

0
Werner Henze On

As the MSDN docs say

Note
Natvis customizations work with classes and structs, but not typedefs.

uintptr_t is a typedef unsigned __int64 uintptr_t;.

So no, this is not possible in Visual Studio.

You can of course wrap the uintptr_t in your own struct/class and then write a natvis visualizer for your struct/class, displaying the contained uintptr_t as hex.