aboutsummaryrefslogtreecommitdiff
path: root/GSL.natvis
blob: a467a17de80b5144b9023c72edd0f707ec77e088 (plain)
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
<?xml version="1.0" encoding="utf-8"?>
<!-- 
    This will make GitHub and some editors recognize this code as XML: 
    vim: syntax=xml
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
    <!-- These types are from the gsl_assert header. -->
    <Type Name="gsl::fail_fast">
        <!-- na hides the address, otherwise it would appear as 0x.... "Message" -->
        <DisplayString>{_Data._What,nasb}</DisplayString>
    </Type>

    <!-- These types are from the gsl_util header. -->
    <Type Name="gsl::final_action&lt;*&gt;">
        <DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString>
        <Expand>
            <Item Name="[invoke]">invoke_</Item>
            <Item Name="[callback]">f_</Item>
        </Expand>
    </Type>

    <!-- These types are from the span header. -->
    <!-- This is for dynamic_extent spans. -->
    <Type Name="gsl::span&lt;*, -1&gt;">
        <DisplayString>{{ extent = {storage_.size_} }}</DisplayString>
        <Expand>
            <ArrayItems>
                <Size>storage_.size_</Size>
                <ValuePointer>storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>

    <!-- This works for constexpr size spans. -->
    <Type Name="gsl::span&lt;*, *&gt;">
        <DisplayString>{{ extent = {extent} }}</DisplayString>
        <Expand>
            <ArrayItems>
                <Size>extent</Size>
                <ValuePointer>storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>

    <!-- This is for dynamic_extent string_spans. -->
    <Type Name="gsl::basic_string_span&lt;*, -1&gt;">
        <DisplayString>{span_.storage_.data_,[span_.storage_.size_]na}</DisplayString>
        <Expand>
            <Item Name="[size]">span_.storage_.size_</Item>
            <ArrayItems>
                <Size>span_.storage_.size_</Size>
                <ValuePointer>span_.storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>

    <!-- This works for constexpr size string_spans. -->
    <Type Name="gsl::basic_string_span&lt;*, *&gt;">
        <DisplayString>{span_.storage_.data_,[span_.extent]na}</DisplayString>
        <Expand>
            <Item Name="[size]">span_.extent</Item>
            <ArrayItems>
                <Size>span_.extent</Size>
                <ValuePointer>span_.storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>

    <!-- This is for dynamic_extent zstring_spans. -->
    <Type Name="gsl::basic_zstring_span&lt;*, -1&gt;">
        <DisplayString>{span_.storage_.data_,[span_.storage_.size_]na}</DisplayString>
        <Expand>
            <Item Name="[size]">span_.storage_.size_</Item>
            <ArrayItems>
                <Size>span_.storage_.size_</Size>
                <ValuePointer>span_.storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>
    
    <!-- This works for constexpr size string_spans. -->
    <Type Name="gsl::basic_zstring_span&lt;*, *&gt;">
        <DisplayString>{span_.storage_.data_,[span_.extent]na}</DisplayString>
        <Expand>
            <Item Name="[size]">span_.extent</Item>
            <ArrayItems>
                <Size>span_.extent</Size>
                <ValuePointer>span_.storage_.data_</ValuePointer>
            </ArrayItems>
        </Expand>
    </Type>
    
    <!-- These types are from the gsl header. -->
    <Type Name="gsl::not_null&lt;*&gt;">
        <!-- We can always dereference this since it's an invariant. -->
        <DisplayString>value = {*ptr_}</DisplayString>
    </Type>
</AutoVisualizer>