-
Notifications
You must be signed in to change notification settings - Fork 13
/
bonsai.natvis
48 lines (36 loc) · 1.75 KB
/
bonsai.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
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="counted_string">
<DisplayString>{Start,[Count]s8}</DisplayString>
</Type>
<Type Name="c_token">
<DisplayString>{Type}, {Value}, {Erased}</DisplayString>
</Type>
<Type Name="c_token_cursor">
<DisplayString>{Start->Value.Start,[(End-1)->Value.Start+(End-1)->Value.Count - Start->Value.Start]s8}</DisplayString>
<Expand>
<CustomListItems>
<If Condition="(At->Value.Count != 0)">
<Item Name="Start To At"> Start->Value.Start,[(At)->Value.Count + (At)->Value.Start - Start->Value.Start]s8 </Item>
</If>
<!-- If you're wondering WTF I was thinking when I wrote the following .. -->
<!-- me too. Apparently Microsoft had a compiler available -->
<!-- that you could have just asked to compile some arbitrary code that -->
<!-- spits out the display string, but that wasn't on the table -->
<!-- for some reason.. Fuck me. -->
<If Condition="(At->Value.Count == 0)">
<If Condition="At != Start">
<If Condition="((At-1)->Value.Count != 0)">
<Item Name="Start to (At-1)"> Start->Value.Start,[(At-1)->Value.Count + (At-1)->Value.Start - Start->Value.Start]s8 </Item>
</If>
</If>
</If>
<Item Name="At"> At->Value </Item>
<Item Name="End"> At->Value.Start+At->Value.Count,[(End-1)->Value.Count + (End-1)->Value.Start - At->Value.Start - At->Value.Count]s8 </Item>
<Item Name="Total"> End - Start </Item>
<Item Name="Used"> At - Start </Item>
<Item Name="Remaining"> End - At </Item>
</CustomListItems>
</Expand>
</Type>
</AutoVisualizer>