-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestd.natvis
134 lines (119 loc) · 5.77 KB
/
estd.natvis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="utf-8"?>
<!--
.natvis for Visual Studio debugger.
XML file must escape these characters
{ [<]< [>]> [&]& ["]" [']' [\n]
 }
in both the item body and the condition statements, you can get more details here:
https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019
BasicType:
https://learn.microsoft.com/en-us/visualstudio/debugger/format-specifiers-in-cpp?view=vs-2019
d | int
u | uint
s | string
x/X | Up-HEX
s8 | UTF-8 string
su | Unicode string
hr | HRESULT S_OK
wm | WindowsMessage WM_CLOSE
wc | WindowClass like WC_DEFAULTCHAR
To enable:
* include file in your VS project (most recommended: not intrusive and always kept up to date!)
* or copy in %USERPROFILE%\Documents\Visual Studio XXXX\Visualizers (current user)
* or copy in %VsInstallDirectory%\Common7\Packages\Debugger\Visualizers (all users)
<DisplayString>unless</DisplayString> ...ok (no expression)
<DisplayString>{{ [{p,s8}]:{l,u} }}</DisplayString> ...ok (legal nice)
<DisplayString>{{ [{p,s8}]:{l,u} }</DisplayString> ...ok (auto append missing end '}')
<DisplayString>{ [{p,s8}]:{l,u} }}</DisplayString> ...failed
<DisplayString>[{p,s8}]:{l,u}</DisplayString> ...ok
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="estr">
<Intrinsic Name="ws" Expression="esize==0"/>
<Intrinsic Name="size" Expression="esize"/>
<Intrinsic Name="data" Expression="esdata"/>
<Intrinsic Name="ptr" Expression="(intptr_t)data()"/>
<Intrinsic Name="capacity" Expression="esize+esize%4+4"/>
<Intrinsic Name="wdata" Expression="((wchar_t*)esdata)"/>
<Intrinsic Name="wsize" Expression="wcslen(wdata())"/>
<Intrinsic Name="wcapacity" Expression="(wsize()+1)*2"/>
<DisplayString Condition="(unsigned)size()==0xCCCCCCCC">!! [invalid]</DisplayString>
<DisplayString Condition="size()==0 && *data() != '\0'">[{data(),su} : {wsize(),u} ]</DisplayString>
<DisplayString Condition="size()==0 && *data() == '\0'">["" empty]</DisplayString>
<DisplayString >[{data(),s8} : {size(),u}]</DisplayString>
<Expand>
<Item Name="[*]">ptr()</Item>
<Item Condition="!ws()" Name="[capacity]">capacity()</Item>
<Item Condition="!ws()" Name="[size]">size()</Item>
<Item Condition="!ws()" Name="[str]">data()</Item>
<ArrayItems Condition="!ws()">
<Size>size()</Size>
<ValuePointer>(unsigned char*)data()</ValuePointer>
</ArrayItems>
<Item Condition="ws()" Name="[capacity]">wcapacity()</Item>
<Item Condition="ws()" Name="[size]">wsize()</Item>
<Item Condition="ws()" Name="[wstr]">wdata()</Item>
<ArrayItems Condition="ws()">
<Size>wsize()</Size>
<ValuePointer>wdata()</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="estrs">
<Intrinsic Name="data" Expression="esarg"/>
<Intrinsic Name="size" Expression="esargc"/>
<DisplayString Condition="(unsigned)size()==0xCCCCCCCC">!! [invalid]</DisplayString>
<DisplayString >[{size(),u}]</DisplayString>
<Expand>
<Item Name="[size]" Condition="size()!=0">size()</Item>
<ArrayItems>
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="ejson">
<Intrinsic Name="name" Expression="ename"/>
<Intrinsic Name="data" Expression="(char*)emap"/>
<Intrinsic Name="origin" Expression="(char*)esori"/>
<Intrinsic Name="orilen" Expression="strlen(esori)"/>
<Intrinsic Name="value" Expression="(long long)emap"/>
<Intrinsic Name="size" Expression="esttr&0x00FFFFFF"/>
<Intrinsic Name="attr" Expression="esttr&0xFF000000"/>
<Intrinsic Name="isv" Expression="(esttr&0x0F000000)==0"/>
<Intrinsic Name="isf" Expression="(esttr&0x01000000)!=0"/>
<Intrinsic Name="isbr" Expression="(esttr&0x02000000)!=0"/>
<Intrinsic Name="istr" Expression="(esttr&0x04000000)!=0"/>
<Intrinsic Name="isjs" Expression="(esttr&0x08000000)!=0"/>
<Intrinsic Name="isnew" Expression="(esttr&0x10000000)!=0"/>
<Intrinsic Name="isary" Expression="(esttr&0x20000000)!=0"/>
<Intrinsic Name="isnull" Expression="(esttr&0x80000000)!=0"/>
<DisplayString Condition="size()==0x00CCCCCC">!! [invalid]</DisplayString>
<DisplayString Condition="isnull()">[{name(),s8} | Null]</DisplayString>
<DisplayString Condition="isary()">[{name(),s8} {size(),u} | Array]</DisplayString>
<DisplayString Condition="isv()">[{name(),s8} {value()} | Value]</DisplayString>
<DisplayString Condition="isbr()">[{name(),s8} {value()==1} | Status]</DisplayString>
<DisplayString Condition="istr()">[{name(),s8} {data(),s8} | String]</DisplayString>
<DisplayString Condition="isf()">[{name(),s8} {data(),e} | Double]]</DisplayString>
<DisplayString Condition="!name()">[{origin(),s8} {size(),u} | Param]</DisplayString>
<DisplayString >[{name(),s8} {size(),u} | Object]</DisplayString>
<Expand>
<Item Name="[name]">name()</Item>
<Item Name="[size]">size()</Item>
<Item Name="[origin]" Condition="isv()&&!isary()">origin()</Item>
<Item Name="[value]" Condition="isv()&&!isary()">value()</Item>
<ArrayItems Condition="isv()&&!isary()">
<Size>orilen()</Size>
<ValuePointer>origin()</ValuePointer>
</ArrayItems>
<Item Name="[data]" Condition="istr()&&!isary()">data()</Item>
<ArrayItems Condition="istr()&&!isary()">
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
<ArrayItems Condition="isjs()||isary()">
<Size>size()</Size>
<ValuePointer>(ejson*)data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>
</AutoVisualizer>