-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvariant_natvis.awk
More file actions
43 lines (31 loc) · 908 Bytes
/
Copy pathvariant_natvis.awk
File metadata and controls
43 lines (31 loc) · 908 Bytes
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
function repeat( str, n, rep, i )
{
for( ; i<n; i++ )
rep = rep str
return rep
}
function viewer(i)
{
return "*($T"i+1" *)&(m)"
}
BEGIN {
print("<?xml version='1.0' encoding='utf-8'?>")
print("<AutoVisualizer xmlns=\"http://schemas.microsoft.com/vstudio/debugger/natvis/2010\">")
print "<Type Name=\"variant17::Variant<*>\">"
print " <Intrinsic Name=\"which\" Expression=\"(int)whichValue\"/>"
for (i = 0; i < 64; i++) {
printf " <DisplayString Condition=\"which() == "(i)"\" Optional=\"true\">"
printf "{" viewer(i) "}"
print " </DisplayString>"
}
print " <Expand>"
print " <Item Name=\"which\">which()</Item>"
for (i = 0; i < 64; i++) {
printf " <Item Name=\"[value]\" Condition=\"which() == " i "\" Optional=\"true\">"
printf viewer(i)
print " </Item>"
}
print "</Expand>"
print "</Type>"
print "</AutoVisualizer>"
}