mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
227ef619af
These types aren't handled very helpfully by Visual Studio's default visualizer. Fortunately it's not difficult to write custom visualizers for them. This does not handle most flavors of `ResultImplementation` -- only the one that the present author found most immediately useful. Handling them is not difficult, but merely tedious; they are left to future authors to deal with as needed. Differential Revision: https://phabricator.services.mozilla.com/D149320
152 lines
6.1 KiB
XML
152 lines
6.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
|
|
|
<!-- Mozilla Gecko Visualizers -->
|
|
|
|
<Type Name="mozilla::Maybe<*>">
|
|
<DisplayString Condition="mIsSome == false">Nothing</DisplayString>
|
|
<DisplayString Condition="mIsSome == true">Some({*($T1 *)&mStorage.val})</DisplayString>
|
|
<Expand>
|
|
<ExpandedItem Condition="mIsSome == true">*($T1 *)&mStorage.val</ExpandedItem>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::Result<*,*>">
|
|
<DisplayString>{mImpl}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::detail::ResultImplementation<*,*,mozilla::detail::PackingStrategy::Variant>">
|
|
<DisplayString Condition="mStorage.tag == false">ok: {*($T1 *)(mStorage.rawData)}</DisplayString>
|
|
<DisplayString Condition="mStorage.tag == true">err: {*($T2 *)(mStorage.rawData)}</DisplayString>
|
|
<DisplayString>%% invalid storage tag in variant %%</DisplayString>
|
|
<Expand>
|
|
<ExpandedItem Condition="mStorage.tag == false">*($T1 *)(mStorage.rawData)</ExpandedItem>
|
|
<ExpandedItem Condition="mStorage.tag == true">*($T2 *)(mStorage.rawData)</ExpandedItem>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- nsTArray -->
|
|
<Type Name="nsTArray<*>">
|
|
<DisplayString Condition="mHdr->mLength == 0 && mHdr->mCapacity == 0">empty</DisplayString>
|
|
<DisplayString Condition="mHdr->mLength == mHdr->mCapacity">size = {mHdr->mLength}</DisplayString>
|
|
<DisplayString>size = {mHdr->mLength}, capacity = {mHdr->mCapacity}</DisplayString>
|
|
<Expand>
|
|
<ArrayItems Condition="mHdr->mLength > 0">
|
|
<Size>mHdr->mLength</Size>
|
|
<ValuePointer>($T1*)(mHdr + 1)</ValuePointer>
|
|
</ArrayItems>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- refcounts -->
|
|
<Type Name="nsAutoRefCnt">
|
|
<DisplayString>{mValue}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="nsCycleCollectingAutoRefCnt">
|
|
<!-- this value needs to be updated if NS_NUMBER_OF_FLAGS_IN_REFCNT in xpcom/glue/nsISupportsImpl.h changes -->
|
|
<DisplayString>{mValue >> 2}</DisplayString>
|
|
<Expand>
|
|
<Synthetic Name="In Purple Buffer"><DisplayString>{mValue & 1 != 0}</DisplayString></Synthetic>
|
|
<Synthetic Name="Is Purple"><DisplayString>{mValue & 2 != 0}</DisplayString></Synthetic>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::ThreadSafeAutoRefCnt">
|
|
<DisplayString>{mValue.mValue._My_val}</DisplayString>
|
|
</Type>
|
|
|
|
<!-- smart pointer/refcount pointer things -->
|
|
<Type Name="nsRefPtr<*>">
|
|
<AlternativeType Name="nsCOMPtr<*>" />
|
|
<AlternativeType Name="nsAutoPtr<*>" />
|
|
<AlternativeType Name="mozilla::WebGLRefPtr<*>" />
|
|
|
|
<DisplayString Condition="mRawPtr == 0">NULL</DisplayString>
|
|
<DisplayString>{*($T1*)mRawPtr}</DisplayString>
|
|
<Expand>
|
|
<ExpandedItem>($T1*)mRawPtr</ExpandedItem>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- strings -->
|
|
<Type Name="nsTString<char>">
|
|
<AlternativeType Name="nsTLiteralString<char>" />
|
|
<AlternativeType Name="mozilla::detail::nsTStringRepr<char>" />
|
|
<AlternativeType Name="nsTSubstring<char>" />
|
|
|
|
<DisplayString>{mData,s}</DisplayString>
|
|
<StringView>mData,s</StringView>
|
|
<Expand>
|
|
<Item Name="Length">mLength</Item>
|
|
<Item Name="Flags">mDataFlags</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<Type Name="nsTSubstringTuple<char>">
|
|
<DisplayString Condition="mHead != nullptr">{mHead,na} {mFragB->mData,s}</DisplayString>
|
|
<DisplayString Condition="mHead == nullptr">{mFragA->mData,s} {mFragB->mData,s}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="nsTString<char16_t>">
|
|
<AlternativeType Name="nsTLiteralString<char16_t>" />
|
|
<AlternativeType Name="mozilla::detail::nsTStringRepr<char16_t>" />
|
|
<AlternativeType Name="nsTSubstring<char16_t>" />
|
|
|
|
<DisplayString>{mData,su}</DisplayString>
|
|
<StringView>mData,su</StringView>
|
|
<Expand>
|
|
<Item Name="Length">mLength</Item>
|
|
<Item Name="Flags">mDataFlags</Item>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<Type Name="nsTSubstringTuple<char16_t>">
|
|
<DisplayString Condition="mHead != nullptr">{mHead,na} {mFragB->mData,su}</DisplayString>
|
|
<DisplayString Condition="mHead == nullptr">{mFragA->mData,su} {mFragB->mData,su}</DisplayString>
|
|
</Type>
|
|
|
|
<!-- rects, points, etc. -->
|
|
<Type Name="mozilla::gfx::BaseRect<*,*,*,*,*>">
|
|
<AlternativeType Name="mozilla::gfx::Rect" />
|
|
<DisplayString>x={x}, y={y}, width={width}, height={height}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::gfx::BaseSize<*,*>">
|
|
<AlternativeType Name="mozilla::gfx::Size" />
|
|
<AlternativeType Name="nsIntSize" />
|
|
<DisplayString>width={width}, height={height}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::gfx::BasePoint<*,*>">
|
|
<AlternativeType Name="mozilla::gfx::Point" />
|
|
<DisplayString>x={x}, y={y}</DisplayString>
|
|
</Type>
|
|
|
|
<Type Name="mozilla::gfx::Matrix4x4">
|
|
<AlternativeType Name="gfx3DMatrix" />
|
|
<DisplayString Condition="(_11==_22==_33==_44==1) && (_12==_13==_14==_21==_23==_24==_31==_32==_34==_41==_42==_43==0)">[Identity]</DisplayString>
|
|
<DisplayString Condition="(_11==_22==_33==_44==1) && (_12==_13==_14==_21==_23==_24==_31==_32==_34==0)">[Translate: ({_41}, {_42}, {_43})]</DisplayString>
|
|
<DisplayString Condition="_44==1 && (_12==_13==_14==_21==_23==_24==_31==_32==_34==_41==_42==_43==0)">[Scale: ({_11}, {_22}, {_33})]</DisplayString>
|
|
<DisplayString>[4x4 Matrix]</DisplayString>
|
|
|
|
<Expand>
|
|
<Synthetic Name="R1"><DisplayString>[{_11}, {_12}, {_13}, {_14}]</DisplayString></Synthetic>
|
|
<Synthetic Name="R2"><DisplayString>[{_21}, {_22}, {_23}, {_24}]</DisplayString></Synthetic>
|
|
<Synthetic Name="R3"><DisplayString>[{_31}, {_32}, {_33}, {_34}]</DisplayString></Synthetic>
|
|
<Synthetic Name="R4"><DisplayString>[{_41}, {_42}, {_43}, {_44}]</DisplayString></Synthetic>
|
|
</Expand>
|
|
</Type>
|
|
|
|
<!-- JS types -->
|
|
<Type Name="JS::Handle<*>">
|
|
<DisplayString Condition="ptr == 0">NULL</DisplayString>
|
|
<DisplayString>{*($T1*)ptr}</DisplayString>
|
|
<Expand>
|
|
<ExpandedItem>($T1*)ptr</ExpandedItem>
|
|
</Expand>
|
|
</Type>
|
|
|
|
|
|
</AutoVisualizer>
|