124 questions
0
votes
1
answer
80
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 ...
2
votes
1
answer
117
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();
...
1
vote
0
answers
119
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 ...
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 ...
1
vote
1
answer
326
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"?>
<...
1
vote
1
answer
268
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), ...
3
votes
1
answer
525
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 ...
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 ...
0
votes
1
answer
101
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
0
answers
143
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 ...
1
vote
0
answers
257
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] = {...
0
votes
1
answer
193
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
1
answer
685
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/...
0
votes
1
answer
655
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&...
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
1
answer
810
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 ...
1
vote
1
answer
838
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 ...
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
1
answer
640
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<*>">
...
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 ...
2
votes
1
answer
260
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 ...
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 ...
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 ...
0
votes
2
answers
446
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 ...
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, ...