chore: add Natvis in MSVC CMake build.
- add Natvis in MSVC CMake build to let me can see the data encoded with YYCC::yycc_char8_t.
This commit is contained in:
parent
b912be082c
commit
81fe72c425
|
@ -14,6 +14,8 @@ PRIVATE
|
|||
IOHelper.cpp
|
||||
StringHelper.cpp
|
||||
WinFctHelper.cpp
|
||||
# Natvis (only for MSVC)
|
||||
$<$<CXX_COMPILER_ID:MSVC>:YYCC.natvis>
|
||||
)
|
||||
target_sources(YYCCommonplace
|
||||
PUBLIC
|
||||
|
|
73
src/YYCC.natvis
Normal file
73
src/YYCC.natvis
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) Microsoft Corporation, yyc12345.
|
||||
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
-->
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<!-- Following XML are copied from Visual Studio embedded Natvis files. -->
|
||||
<!-- <Microsoft Visual Studio Install Directory>\Common7\Packages\Debugger\Visualizers\stl.natvis -->
|
||||
|
||||
<!-- VC 2013 -->
|
||||
<Type Name="std::basic_string<YYCC::yycc_char8_t,*>" Priority="MediumLow">
|
||||
<AlternativeType Name="std::basic_string<char8_t,*>" />
|
||||
<AlternativeType Name="std::basic_string<unsigned char,*>" />
|
||||
<DisplayString Condition="_Myres < _BUF_SIZE">{_Bx._Buf,s8}</DisplayString>
|
||||
<DisplayString Condition="_Myres >= _BUF_SIZE">{_Bx._Ptr,s8}</DisplayString>
|
||||
<StringView Condition="_Myres < _BUF_SIZE">_Bx._Buf,s8</StringView>
|
||||
<StringView Condition="_Myres >= _BUF_SIZE">_Bx._Ptr,s8</StringView>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple">_Mysize</Item>
|
||||
<Item Name="[capacity]" ExcludeView="simple">_Myres</Item>
|
||||
<ArrayItems>
|
||||
<Size>_Mysize</Size>
|
||||
<ValuePointer Condition="_Myres < _BUF_SIZE">_Bx._Buf</ValuePointer>
|
||||
<ValuePointer Condition="_Myres >= _BUF_SIZE">_Bx._Ptr</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- VC 2015+ ABI basic_string -->
|
||||
<Type Name="std::basic_string<YYCC::yycc_char8_t,*>">
|
||||
<AlternativeType Name="std::basic_string<char8_t,*>" />
|
||||
<AlternativeType Name="std::basic_string<unsigned char,*>" />
|
||||
<Intrinsic Name="size" Expression="_Mypair._Myval2._Mysize" />
|
||||
<Intrinsic Name="capacity" Expression="_Mypair._Myval2._Myres" />
|
||||
<!-- _BUF_SIZE = 16 / sizeof(char) < 1 ? 1 : 16 / sizeof(char) == 16 -->
|
||||
<Intrinsic Name="bufSize" Expression="16" />
|
||||
<Intrinsic Name="isShortString" Expression="capacity() < bufSize()" />
|
||||
<Intrinsic Name="isLongString" Expression="capacity() >= bufSize()" />
|
||||
<DisplayString Condition="isShortString()">{_Mypair._Myval2._Bx._Buf,s8}</DisplayString>
|
||||
<DisplayString Condition="isLongString()">{_Mypair._Myval2._Bx._Ptr,s8}</DisplayString>
|
||||
<StringView Condition="isShortString()">_Mypair._Myval2._Bx._Buf,s8</StringView>
|
||||
<StringView Condition="isLongString()">_Mypair._Myval2._Bx._Ptr,s8</StringView>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple">size()</Item>
|
||||
<Item Name="[capacity]" ExcludeView="simple">capacity()</Item>
|
||||
<Item Name="[allocator]" ExcludeView="simple">_Mypair</Item>
|
||||
<ArrayItems>
|
||||
<Size>_Mypair._Myval2._Mysize</Size>
|
||||
<ValuePointer Condition="isShortString()">_Mypair._Myval2._Bx._Buf</ValuePointer>
|
||||
<ValuePointer Condition="isLongString()">_Mypair._Myval2._Bx._Ptr</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="std::basic_string_view<YYCC::yycc_char8_t,*>">
|
||||
<AlternativeType Name="std::basic_string_view<char8_t,*>" />
|
||||
<AlternativeType Name="std::basic_string_view<unsigned char,*>" />
|
||||
<Intrinsic Name="size" Expression="_Mysize" />
|
||||
<Intrinsic Name="data" Expression="_Mydata" />
|
||||
<DisplayString>{_Mydata,[_Mysize],s8}</DisplayString>
|
||||
<StringView>_Mydata,[_Mysize],s8</StringView>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple">size()</Item>
|
||||
<ArrayItems>
|
||||
<Size>size()</Size>
|
||||
<ValuePointer>data()</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
Loading…
Reference in New Issue
Block a user