ryml.natvis (10168B)
1 <?xml version="1.0" encoding="utf-8"?> 2 3 <!-- 4 Very good intro: 5 @see https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2017 6 @see https://code.msdn.microsoft.com/windowsdesktop/Writing-type-visualizers-2eae77a2 7 See also: 8 @see http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx?PageIndex=2 9 @see http://blogs.msdn.com/b/vcblog/archive/2015/09/28/debug-visualizers-in-visual-c-2015.aspx 10 @see http://stackoverflow.com/questions/36883414/limit-display-of-char-in-natvis-file-to-specific-length 11 --> 12 13 <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> 14 15 <Type Name="c4::yml::NodeScalar"> 16 <DisplayString Condition="(tag.len == 0) && (anchor.len == 0)">{scalar.str,[scalar.len]}</DisplayString> 17 <DisplayString Condition="(tag.len > 0) && (anchor.len == 0)">{scalar.str,[scalar.len]} [T]</DisplayString> 18 <DisplayString Condition="(tag.len == 0) && (anchor.len > 0)">{scalar.str,[scalar.len]} [A]</DisplayString> 19 <DisplayString Condition="(tag.len > 0) && (anchor.len > 0)">{scalar.str,[scalar.len]} [T][A]</DisplayString> 20 <Expand> 21 <Item Name="scalar">scalar</Item> 22 <Item Name="tag">tag</Item> 23 <Item Name="anchor">anchor</Item> 24 </Expand> 25 </Type> 26 27 <Type Name="c4::yml::NodeType"> 28 <DisplayString>{type}</DisplayString> 29 <Expand> 30 <Synthetic Name="[enabled bits]"> 31 <Expand> 32 <Item Name="[0]" Condition="(type & c4::yml::VAL) != 0">c4::yml::VAL</Item> 33 <Item Name="[1]" Condition="(type & c4::yml::KEY) != 0">c4::yml::KEY</Item> 34 <Item Name="[2]" Condition="(type & c4::yml::MAP) != 0">c4::yml::MAP</Item> 35 <Item Name="[3]" Condition="(type & c4::yml::SEQ) != 0">c4::yml::SEQ</Item> 36 <Item Name="[4]" Condition="(type & c4::yml::DOC) != 0">c4::yml::DOC</Item> 37 <Item Name="[5]" Condition="(type & c4::yml::STREAM) != 0">c4::yml::STREAM</Item> 38 <Item Name="[6]" Condition="(type & c4::yml::KEYREF) != 0">c4::yml::KEYREF</Item> 39 <Item Name="[7]" Condition="(type & c4::yml::VALREF) != 0">c4::yml::VALREF</Item> 40 <Item Name="[8]" Condition="(type & c4::yml::KEYANCH) != 0">c4::yml::KEYANCH</Item> 41 <Item Name="[9]" Condition="(type & c4::yml::VALANCH) != 0">c4::yml::VALANCH</Item> 42 <Item Name="[10]" Condition="(type & c4::yml::KEYTAG) != 0">c4::yml::KEYTAG</Item> 43 <Item Name="[11]" Condition="(type & c4::yml::VALTAG) != 0">c4::yml::VALTAG</Item> 44 <Item Name="[12]" Condition="(type & c4::yml::VALQUO) != 0">c4::yml::VALQUO</Item> 45 <Item Name="[13]" Condition="(type & c4::yml::KEYQUO) != 0">c4::yml::KEYQUO</Item> 46 </Expand> 47 </Synthetic> 48 </Expand> 49 </Type> 50 51 <Type Name="c4::yml::NodeData"> 52 <DisplayString Condition="((m_type.type & c4::yml::KEY ) == c4::yml::KEY) && ((m_type.type & c4::yml::VAL) == c4::yml::VAL)">[KEYVAL] {m_key.scalar.str,[m_key.scalar.len]}: {m_val.scalar.str,[m_val.scalar.len]}</DisplayString> 53 <DisplayString Condition="((m_type.type & c4::yml::KEY ) == c4::yml::KEY) && ((m_type.type & c4::yml::SEQ) == c4::yml::SEQ)">[KEYSEQ] {m_key.scalar.str,[m_key.scalar.len]}</DisplayString> 54 <DisplayString Condition="((m_type.type & c4::yml::KEY ) == c4::yml::KEY) && ((m_type.type & c4::yml::MAP) == c4::yml::MAP)">[KEYMAP] {m_key.scalar.str,[m_key.scalar.len]}</DisplayString> 55 <DisplayString Condition="((m_type.type & c4::yml::DOC ) == c4::yml::DOC) && ((m_type.type & c4::yml::SEQ) == c4::yml::SEQ)">[DOCSEQ]</DisplayString> 56 <DisplayString Condition="((m_type.type & c4::yml::DOC ) == c4::yml::DOC) && ((m_type.type & c4::yml::MAP) == c4::yml::MAP)">[DOCMAP]</DisplayString> 57 <DisplayString Condition="(m_type.type & c4::yml::VAL ) == c4::yml::VAL" >[VAL] {m_val.scalar.str,[m_val.scalar.len]}</DisplayString> 58 <DisplayString Condition="(m_type.type & c4::yml::KEY ) == c4::yml::KEY" >[KEY] {m_key.scalar.str,[m_key.scalar.len]}</DisplayString> 59 <DisplayString Condition="(m_type.type & c4::yml::SEQ ) == c4::yml::SEQ" >[SEQ]</DisplayString> 60 <DisplayString Condition="(m_type.type & c4::yml::MAP ) == c4::yml::MAP" >[MAP]</DisplayString> 61 <DisplayString Condition="(m_type.type & c4::yml::DOC ) == c4::yml::DOC" >[DOC]</DisplayString> 62 <DisplayString Condition="(m_type.type & c4::yml::STREAM) == c4::yml::STREAM">[STREAM]</DisplayString> 63 <DisplayString Condition="(m_type.type & c4::yml::NOTYPE) == c4::yml::NOTYPE">[NOTYPE]</DisplayString> 64 <Expand> 65 <Item Name="type">m_type</Item> 66 <Item Name="key" Condition="(m_type.type & c4::yml::KEY) != 0">m_key</Item> 67 <Item Name="val" Condition="(m_type.type & c4::yml::VAL) != 0">m_val</Item> 68 <Item Name="key quoted" Condition="((m_type.type & c4::yml::KEY) != 0) && ((m_type.type & c4::yml::KEYQUO) != 0)">c4::yml::KEYQUO</Item> 69 <Item Name="val quoted" Condition="((m_type.type & c4::yml::VAL) != 0) && ((m_type.type & c4::yml::VALQUO) != 0)">c4::yml::VALQUO</Item> 70 <Item Name="key ref" Condition="(m_type.type & c4::yml::KEYREF) != 0">m_key.anchor</Item> 71 <Item Name="val ref" Condition="(m_type.type & c4::yml::VALREF) != 0">m_val.anchor</Item> 72 <Item Name="key anchor" Condition="(m_type.type & c4::yml::KEYANCH) != 0">m_key.anchor</Item> 73 <Item Name="val anchor" Condition="(m_type.type & c4::yml::VALANCH) != 0">m_val.anchor</Item> 74 <Item Name="parent">m_parent</Item> 75 <Item Name="first child" Condition="m_first_child != c4::yml::NONE">m_first_child</Item> 76 <Item Name="last child" Condition="m_last_child != c4::yml::NONE">m_last_child</Item> 77 <Item Name="prev sibling" Condition="m_prev_sibling != c4::yml::NONE">m_prev_sibling</Item> 78 <Item Name="next sibling" Condition="m_next_sibling != c4::yml::NONE">m_next_sibling</Item> 79 </Expand> 80 </Type> 81 82 <Type Name="c4::yml::Tree"> 83 <DisplayString>sz={m_size}, cap={m_cap}</DisplayString> 84 <Expand> 85 <Item Name="[size]">m_size</Item> 86 <Item Name="[capacity]">m_cap</Item> 87 <Synthetic Name="[buffer]"> 88 <Expand> 89 <ArrayItems> 90 <Size>m_cap</Size> 91 <ValuePointer>m_buf</ValuePointer> 92 </ArrayItems> 93 </Expand> 94 </Synthetic> 95 <Item Name="free head">m_free_head</Item> 96 <Item Name="arena">m_arena</Item> 97 </Expand> 98 </Type> 99 100 <Type Name="c4::yml::Tree::_lookup_path_token"> 101 <DisplayString>{value} ({type})</DisplayString> 102 <Expand> 103 <Item Name="value">value</Item> 104 <Item Name="type">type</Item> 105 </Expand> 106 </Type> 107 108 <Type Name="c4::yml::Tree::lookup_result"> 109 <DisplayString>{path} -- target={target} closest={closest}</DisplayString> 110 <Expand> 111 <Item Name="target">target</Item> 112 <Item Name="closest">closest</Item> 113 <Item Name="path_pos">path_pos</Item> 114 <Item Name="path">path</Item> 115 <Synthetic Name="[resolved]"> 116 <DisplayString>{path.str,[path_pos]}</DisplayString> 117 </Synthetic> 118 <Synthetic Name="[unresolved]"> 119 <DisplayString>{path.str+path_pos,[path.len-path_pos]}</DisplayString> 120 </Synthetic> 121 </Expand> 122 </Type> 123 124 <Type Name="c4::yml::NodeRef"> 125 <DisplayString Condition="(m_id == c4::yml::NONE)">(void)</DisplayString> 126 <DisplayString Condition="(m_seed.len != c4::yml::NONE) && (m_seed.str == nullptr)">[INDEX SEED for] {*(m_tree->m_buf + m_id)}</DisplayString> 127 <DisplayString Condition="(m_seed.len != c4::yml::NONE) && (m_seed.str != nullptr)">[NAMED SEED for] {*(m_tree->m_buf + m_id)}</DisplayString> 128 <DisplayString>{*(m_tree->m_buf + m_id)}</DisplayString> 129 <Expand> 130 <Item Name="id">m_id</Item> 131 <Item Name="elm">*(m_tree->m_buf + m_id)</Item> 132 <Item Name="tree">m_tree</Item> 133 <Synthetic Name="[children]" Condition="(m_id != c4::yml::NONE) && ((m_tree->m_buf + m_id)->m_type.type & (c4::yml::MAP|c4::yml::SEQ) != 0)"> 134 <Expand> 135 <CustomListItems> 136 <Variable Name="tree" InitialValue="m_tree"/> 137 <Variable Name="buf" InitialValue="m_tree->m_buf"/> 138 <Variable Name="curr" InitialValue="(m_tree->m_buf + m_id)->m_first_child"/> 139 <Loop> 140 <Item>buf + curr</Item> 141 <Exec>curr = (buf + curr)->m_next_sibling</Exec> 142 <Break Condition="curr == c4::yml::NONE"/> 143 </Loop> 144 </CustomListItems> 145 </Expand> 146 </Synthetic> 147 </Expand> 148 </Type> 149 150 <Type Name="c4::yml::detail::ReferenceResolver"> 151 <DisplayString>#refs={refs.m_size} #nodes={t->m_size}</DisplayString> 152 <Expand> 153 <Synthetic Name="[ref_nodes]"> 154 <Expand> 155 <CustomListItems> 156 <Variable Name="curr" InitialValue="0"/> 157 <Loop> 158 <Item>t->m_buf + (refs.m_stack + curr)->node</Item> 159 <Exec>curr = curr+1</Exec> 160 <Break Condition="curr >= refs.m_size"/> 161 </Loop> 162 </CustomListItems> 163 </Expand> 164 </Synthetic> 165 <Synthetic Name="[refs]"> 166 <Expand> 167 <ArrayItems> 168 <Size>refs.m_size</Size> 169 <ValuePointer>refs.m_stack</ValuePointer> 170 </ArrayItems> 171 </Expand> 172 </Synthetic> 173 <Item Name="[tree]">t</Item> 174 </Expand> 175 </Type> 176 177 <Type Name="c4::yml::detail::stack<*,*>"> 178 <DisplayString>sz={m_size} cap={m_capacity}</DisplayString> 179 <Expand> 180 <Item Name="[size]">m_size</Item> 181 <Item Name="[capacity]">m_capacity</Item> 182 <Item Name="[is small]">m_buf == m_stack</Item> 183 <Synthetic Name="[items]"> 184 <Expand> 185 <ArrayItems> 186 <Size>m_size</Size> 187 <ValuePointer>m_stack</ValuePointer> 188 </ArrayItems> 189 </Expand> 190 </Synthetic> 191 </Expand> 192 </Type> 193 194 </AutoVisualizer>