190 lines
7.8 KiB
XML
190 lines
7.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
|
<Type Name="alloc::vec::Vec<*>">
|
|
<DisplayString>{{ len={len} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[len]" ExcludeView="simple">len</Item>
|
|
<Item Name="[capacity]" ExcludeView="simple">buf.inner.cap.__0</Item>
|
|
<ArrayItems>
|
|
<Size>len</Size>
|
|
<ValuePointer>($T1*)buf.inner.ptr.pointer.pointer</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
<Type Name="alloc::collections::vec_deque::VecDeque<*>">
|
|
<DisplayString>{{ len={len} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[len]" ExcludeView="simple">len</Item>
|
|
<Item Name="[capacity]" ExcludeView="simple">buf.inner.cap.__0</Item>
|
|
<CustomListItems>
|
|
<Variable Name="i" InitialValue="0" />
|
|
<Size>len</Size>
|
|
<Loop>
|
|
<If Condition="i == len">
|
|
<Break/>
|
|
</If>
|
|
<Item>(($T1*)buf.inner.ptr.pointer.pointer)[(i + head) % buf.inner.cap.__0]</Item>
|
|
<Exec>i = i + 1</Exec>
|
|
</Loop>
|
|
</CustomListItems>
|
|
</Expand>
|
|
</Type>
|
|
<Type Name="alloc::collections::linked_list::LinkedList<*>">
|
|
<DisplayString>{{ len={len} }}</DisplayString>
|
|
<Expand>
|
|
<LinkedListItems>
|
|
<Size>len</Size>
|
|
<HeadPointer>*(alloc::collections::linked_list::Node<$T1> **)&head</HeadPointer>
|
|
<NextPointer>*(alloc::collections::linked_list::Node<$T1> **)&next</NextPointer>
|
|
<ValueNode>element</ValueNode>
|
|
</LinkedListItems>
|
|
</Expand>
|
|
</Type>
|
|
<Type Name="alloc::string::String">
|
|
<DisplayString>{(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
|
|
<StringView>(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8</StringView>
|
|
<Expand>
|
|
<Item Name="[len]" ExcludeView="simple">vec.len</Item>
|
|
<Item Name="[capacity]" ExcludeView="simple">vec.buf.inner.cap.__0</Item>
|
|
<Synthetic Name="[chars]">
|
|
<DisplayString>{(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
|
|
<Expand>
|
|
<ArrayItems>
|
|
<Size>vec.len</Size>
|
|
<ValuePointer>(char*)vec.buf.inner.ptr.pointer.pointer</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Synthetic>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!--
|
|
The display string for Rc, Arc, etc is optional because the expression cannot be evaluated
|
|
if the pointee is unsized (i.e. if `ptr.pointer` is a fat pointer).
|
|
|
|
There are also two versions for the reference count fields, one for sized and one for
|
|
dyn pointees.
|
|
|
|
Rc<[T]> and Arc<[T]> are handled separately altogether so we can actually show
|
|
the slice values. These visualizers have a second wildcard `foo<slice2$<*>, *>`
|
|
which accounts for the allocator parameter. This isn't needed for the other visualizers since
|
|
their inner `*` eats the type parameter but since the slice ones match part of the type params
|
|
it is necessary for them.
|
|
-->
|
|
<!-- alloc::rc::Rc<T> -->
|
|
<Type Name="alloc::rc::Rc<*>">
|
|
<DisplayString Optional="true">{ptr.pointer->value}</DisplayString>
|
|
<Expand>
|
|
<!-- thin -->
|
|
<ExpandedItem Optional="true">ptr.pointer->value</ExpandedItem>
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
|
|
|
<!-- dyn -->
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::rc::Rc<[T]> -->
|
|
<Type Name="alloc::rc::Rc<slice2$<*>,*>">
|
|
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
|
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
|
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
|
<ArrayItems>
|
|
<Size>ptr.pointer.length</Size>
|
|
<!-- We add +2 to the data_ptr in order to skip the ref count fields in the RcInner -->
|
|
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::rc::Weak<T> -->
|
|
<Type Name="alloc::rc::Weak<*>">
|
|
<DisplayString Optional="true">{ptr.pointer->value}</DisplayString>
|
|
<Expand>
|
|
<!-- thin -->
|
|
<ExpandedItem Optional="true">ptr.pointer->value</ExpandedItem>
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
|
|
|
<!-- dyn -->
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::rc::Weak<[T]> -->
|
|
<Type Name="alloc::rc::Weak<slice2$<*>,*>">
|
|
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
|
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
|
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
|
<ArrayItems>
|
|
<Size>ptr.pointer.length</Size>
|
|
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::sync::Arc<T> -->
|
|
<Type Name="alloc::sync::Arc<*>">
|
|
<DisplayString Optional="true">{ptr.pointer->data}</DisplayString>
|
|
<Expand>
|
|
<!-- thin -->
|
|
<ExpandedItem Optional="true">ptr.pointer->data</ExpandedItem>
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
|
|
|
<!-- dyn -->
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::sync::Arc<[T]> -->
|
|
<Type Name="alloc::sync::Arc<slice2$<*>,*>">
|
|
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
|
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
|
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
|
<ArrayItems>
|
|
<Size>ptr.pointer.length</Size>
|
|
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::sync::Weak<T> -->
|
|
<Type Name="alloc::sync::Weak<*>">
|
|
<DisplayString Optional="true">{ptr.pointer->data}</DisplayString>
|
|
<Expand>
|
|
<!-- thin -->
|
|
<ExpandedItem Optional="true">ptr.pointer->data</ExpandedItem>
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
|
|
|
<!-- dyn -->
|
|
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
|
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- alloc::sync::Weak<[T]> -->
|
|
<Type Name="alloc::sync::Weak<slice2$<*>,*>">
|
|
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
|
<Expand>
|
|
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
|
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
|
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
|
<ArrayItems>
|
|
<Size>ptr.pointer.length</Size>
|
|
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
</AutoVisualizer>
|