125 questions
-1
votes
1
answer
145
views
How can I show a wide string simply as a string?
This is the situation as I'm seeing it in my watch-window:
I'd like to see only the string "AutoOutput", not the pointer value (in case I need it, I might always disable the corresponding ...
0
votes
1
answer
89
views
How to get the contents of a SAFEARRAY on one line in the watch-window
Since recently, I'm working in C++ with COM technology, which means using SAFEARRAY objects. One of the first challenges is seeing the contents of such an object: in the watch-window, such an object ...
3
votes
1
answer
133
views
How to manually load a native visualiser during debugging in Visual Studio 2022?
I'm working with COM objects, which means I need to debug SAFEARRAY objects.
It looks as follows in the watch-window:
receivedData 0x007cc980 safearray of UI1, [rank]=1 _variant_t
safearray ...
2
votes
1
answer
118
views
Show `boost::uuids::uuid` value in visual studio debugger with natvis
In a CMake library project I've a class that's basically a wrapper to boost::uuids::uuid:
class UUID {
public:
static bool IsValidUUIDText(std::string_view text);
static UUID CreateNull();
...
3
votes
0
answers
62
views
How to use the mongodb.natvis with the mongocxx c++ lib
Using vcpkg I have compiled the mongo c++ lib "mongo-cxx-driver" https://github.com/mongodb/mongo-cxx-driver
while debugging i can see that it have added a "v_noabi" namespace ...
1
vote
0
answers
124
views
Is there a way to access static constexpr arrays in natvis?
I am writing a wrapper class template around a byte storage and I use a constexpr std::array to store the offsets of the members (some can be missing based on the template). The code runs as expected ...
0
votes
0
answers
389
views
vscode gdb debugger not showing qt variables c++
I want to use VSCode to write Qt projects, since the Qt Creator is really hard to use.
But the debugger in VSCode just can't show the real value of Qt variables which is really upset.
I have this ...
1
vote
0
answers
96
views
Accelerate natvis for type-erased "any"-style class
Our large code base has a class AnyRef that contains a type-erased reference to some object:
struct AnyRef {
int type = 0;
void* ptr = nullptr;
};
For example, if type==1, then ptr is ...
0
votes
0
answers
38
views
schemas.microsoft.com/vstudio/debugger/natvis/2010 returns 404
All scripts Natvis for debuggers use the address http://schemas.microsoft.com/vstudio/debugger/natvis/2010, but by going to this address we get error 4xx error. does anyone know what's going on here ...
1
vote
1
answer
331
views
Do .natvis intrinsic functions support recursive evaluation?
I need to implement (integer) exponentiation (valexp) in a Natvis visualizer. My initial instinct to employ recursion
<?xml version="1.0" encoding="utf-8"?>
<...
2
votes
0
answers
162
views
Visual Studio Code doesn't display visualized Qt5 objects on Linux
Using VSCode 1.85.2.
I have qt5.natvis on my Linux CentOS 7, and my launch.json file includes the following properties:
{
...
"visualizerFile": "/path/to/qt5.natvis",
...
1
vote
1
answer
270
views
How to pull .natvis data out of a PDB?
The /NATVIS linker option can be used to embed debug visualizers into a PDB.
Given a PDB, is there a way to recover all embedded debug visualizers? I'm looking for a first-party tool (like DUMPBIN), ...
2
votes
1
answer
782
views
How to create a specific view using natvis debug visualizer?
I'm using the Microsoft extension Image Watch to preview OpenCV images.
I'm trying to visualize images that are inside a container by adding their container key, but the Visual Studio debugger watch ...
3
votes
1
answer
532
views
Build custom string in natvis file out of separate chars
I have a type which represents "Battleship" coordinates:
struct BattleshipCoordinates
{
int row; // zero-based row offset
int col; // zero-based column offset
}
Note that the ...
1
vote
1
answer
253
views
MSVC 2022 / natvis definition only shows in datatip but not in local/watch window
I defined a natvis file like this:
and I can see the effect in the Datatips when hovering over a variable name:
But the definition not use in the Local or Watch window in the debugger:
Only the ...
2
votes
1
answer
298
views
Natvis type alias feature similar to typedef
I have some complex Item expressions where the type casts of nested template types are getting quite long and difficult to read. Is it possible to 'store' a type in the Natvis definition for reuse in ...
3
votes
1
answer
2k
views
'Debugging' visual studio code .natvis based custom view objects
I would like to provide some .natvis file based C++ custom view objects for Visual Studio Code. It is not working as expected out of the box and the definitions used in the .natvis file are not used ...
0
votes
1
answer
108
views
Natvis problem after reinstalling VS2017 on different folder
After reinstalling VS2017 on different folder, when I compile an old project I get an error about a missing natvis file (which now is on a different path).
I searched inside the VC++ project files and ...
2
votes
1
answer
133
views
Can CustomListItems explore a tree?
I would like to use a .natvis file to display all of the elements in a tree structure as a flat list.
I'm aware of the TreeItems expansion described in the .natvis documentation, and have tried to use ...
2
votes
0
answers
144
views
Reuse Natvis STL visualization fields in custom visualization
Question
When writing custom Natvis visualizations for Visual Studio, (how) can I access fields of a lambda wrapped in a std::function?
Concrete example
I have a class looks somewhat like this (very ...
0
votes
0
answers
463
views
How to clarify namespaces in .natvis visualiser?
I am trying to write a custom visualizer for a kind of loader/smart pointer that internally stores the data as a void* and casts it to the correct (templated) type. But the visualizer is getting ...
1
vote
0
answers
258
views
Display more than one variable of same type using Natvis
I am trying to demonstrate here the approach which I have followed to display two uint32_t * type variable using Natvis.
sample.cpp
#include<iostream>
int main()
{
uint32_t foo_array[5] = {...
2
votes
0
answers
522
views
Display range of value using Natvis
I have an array (limit_array) which is pointed by a pointer (limit_ptr). For simplicity, here I have given an array of length 10. Using IndexListItems of natvis I can iterate through the value which ...
0
votes
1
answer
195
views
Can I use .natvis file to always display uintptr_t as hex?
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 ...
0
votes
2
answers
249
views
Ambiguity between class-name and enumerator-values in C++ natvis
I want to create a natvis for QObject. There are dynamic properties concepts, which stored in form
QList<QByteArray> propertyNames;
QVector<QVariant> propertyValues;
and I want to ...
0
votes
1
answer
687
views
VSCode Debugging Eigen::VectorXd
When I'm debuging in vsCode (on Linux) I want to see what my Eigen::VectorXd actually has in Store. So I tried it with this Eigen.natvis https://github.com/cdcseacave/Visual-Studio-Visualizers/blob/...
3
votes
1
answer
2k
views
natvis in vscode with gdb gives "Explicit refresh required for visualized expressions"
vscode is meant to be able to pretty print custom objects if given a natvis file. I'm running linux and debugging with gdb.
The docs say:
For gdb/lldb debugging ("type": "cppdbg"),...
0
votes
1
answer
659
views
natvis display of linked list that ends in raw view
I have this
struct llist {
char code[CODE_SIZE];
...
llist *next;
}
And my natvis file contains this
<Type Name="llist">
<DisplayString>Code ={code,na}</DisplayString&...
1
vote
0
answers
349
views
vscode natvis using launch configuration
I am trying to debug a ROS2 node which uses Eigen matrices. I followed https://gist.github.com/JADC362/a4425c2d05cdaadaaa71b697b674425f.
However, to visualize Eigen matrices, I encountered natvis ...
2
votes
0
answers
1k
views
inspect heap allocated array or matrix while debugging c++
I'm using vscode to debug some c++ code, however I cannot inspect any (heap allocated) objects. Like in this example:
float arrayStack[10];
for (size_t i = 0; i < 10; i++)
{
arrayStack[i] = -...
1
vote
3
answers
1k
views
Extend display range of ArrayItems/IndexListItems using natvis
I am trying to visualize a memory content using natvis which is pointed by a pointer. I have also tried to declare the memory as a vector. But every time the problem I am facing is that, during ...
1
vote
1
answer
815
views
Use of Natvis framework to observe value pointed by pointer
My goal is to observe a container of value which is pointed by a pointer. I am recommended to use natvis for this purpose. I am using VSCode to develop my project in Linux system. Unfortunately, I am ...
0
votes
1
answer
192
views
What's the easiest way to create a managed visualiser in C#?
I have a background in C++ and recently I started working in C#.
I have written following pieces of code (in Visual Studio):
var list_Loads = database.GetData<Load>().ToList();
var test_list = ...
1
vote
1
answer
848
views
Using a runtime string to specify object type in natvis
Say I have a struct
struct Foo
{
void* bar;
const char* barTypeName;
}
bar is some type erased thing and barTypeName is a proper C++ type identifier that identifies the actual type of bar.
I ...
5
votes
0
answers
847
views
How do I visualize custom classes in the debugger in a visual studio cross-platform CMake project?
I'm currently getting into cross-platform development using visual studio and CMake. Before, I would only create native Visual Studio applications and I could easily create debug visualizations of ...
0
votes
0
answers
130
views
Is it possible to input VSCode a map [IDs, Strings] inside a .nativs file and output associated string while debugging?
I have lot of register IDs in the application, in order to debug the application I need to know the names of the registers not just the IDs.
Is it possible to maintain a map in .natvis file and use ...
0
votes
0
answers
731
views
Natvis C++ formatting for a custom type
I have been trying to create a natvis file for VS2019 C++ for a derived variable. I have built libraries from the NDK although I don't think that should matter.
Here is a screen snip:
Can you give ...
0
votes
1
answer
641
views
VSCode natvis working on some variables but not others of the same template type
Working with the above std::vectors on Android's NDK. If I define the natvis for std::__ndk1::vector_base as follows
<Type Name="std::__ndk1::__vector_base<*>">
...
1
vote
0
answers
589
views
How to prettily show objects with remote gdb in Visual Studio debugger (maybe by appropriate natvis file)?
I have a natvis file for showing complex structures and objects (e.g. nlohmann json or STL) which works well when debugging for x64-compiled code. But as soon as I switch the platform to ARM64 (yocto-...
2
votes
0
answers
716
views
How to propagate the view type in natvis from standard containers to their items?
It is possible to define different views for types specified in natvis files, however i don't know a way to propagate these views through standard containers without modifying or rewriting the ...
0
votes
0
answers
602
views
Natvis doesn't match complex type name
I have the following .natvis file for visualizing the elements of a hash table.
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft....
2
votes
1
answer
261
views
How to limit natvis of a single char to only the character in VisualStudio
When creating a
<DisplayString>{a_char,c}</DisplayString>
in a .natvis file, the char is being displayed as f.e.
82 'R'
I'm looking for a way to display it as
'R'
e.g. without the ...
1
vote
0
answers
326
views
Qt4.natvis not working in VSCode on Centos 7
I am using VSCode to develop with Qt4 on Centos 7 over SSH. My launch.json reads:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing ...
0
votes
1
answer
1k
views
Using CustomListItems in VSCode/Natvis
I am developing some debug visualizations for my custom classes in VSCode using Natvis.
Using CustomListItems with a simple example and I can't get it to work.
Basically, I think the following code ...
1
vote
0
answers
39
views
VSCode Accessing Local Created Variable in Natvis [duplicate]
I have the following natvis code for visualizing my q23_t class (part of a larger natvis file) in the debugger.I cannot get natvis to show the value of ibit23 which is a locally defined variable. I ...
2
votes
1
answer
1k
views
How to make multiple list expansions for a single type using natvis Visual Studio C++ debugger visualizer
I'm trying to make debugger visualizer for container that stores values in chunks. I want to make list expansion both for values and for chunks, but as far as I can see single type can have only one ...
2
votes
1
answer
474
views
C++/WinRT natvis doesn't work in fresh install
How can I trouble-shoot this?
I combined the natvis example in this question with the C++/WinRT console template and succeeded in getting the natvis for the Matrix2d to work but not for the Uri.
#...
0
votes
2
answers
447
views
How can I get the DisplayString field from Debugger.GetExpression?
Background
I'm writing a Visual Studio Extension in C# that executes code in the Immediate Window while debugging another application. The expression returns a value that can be a int, a string ...
1
vote
1
answer
704
views
How to visualize a column order matrix with natvis like a 2d array
I have a struct
struct Matrix2d
{
// Column first ordered elements
vector<int> m_elements;
int m_numRows;
int m_numCols;
};
m_elements stores {0, 1, 2, 3, 4, 5, 6, 7, 8} to ...
2
votes
0
answers
176
views
Is it possible for a visual studio debug visualizer (natvis) to perform a map lookup?
So I have a type, which is used as a key into a map. The key itself isn't particularly human readable (e.g. a 128 bit guid), but the value in the map that this key references, is.
Is it possible, ...