Skip to content

Commit

Permalink
Add types debug helper
Browse files Browse the repository at this point in the history
Thanks @Giperionn
  • Loading branch information
Xottab-DUTY committed Apr 17, 2018
1 parent 013fbe4 commit 614a4ba
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
<xrBuildCxA>Rx86</xrBuildCxA>
</PropertyGroup>

<ItemGroup>
<!-- I don't want to touch every vcxproj file and $(SolutionDir) is not working here. This is a workaround. -->
<Natvis Include="TypeHelper.natvis" Condition="exists('TypeHelper.natvis')"/>
<Natvis Include="..\TypeHelper.natvis" Condition="exists('..\TypeHelper.natvis')"/>
<Natvis Include="..\..\TypeHelper.natvis" Condition="exists('..\..\TypeHelper.natvis')"/>
</ItemGroup>

<PropertyGroup Label="UserMacros">
<xrBinRootDir>$(SolutionDir)..\bin\</xrBinRootDir>
<xrLibRootDir>$(SolutionDir)..\lib\</xrLibRootDir>
Expand Down
38 changes: 38 additions & 0 deletions src/TypeHelper.natvis
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

<Type Name="shared_str">
<DisplayString Condition="p_ == 0">""</DisplayString>
<DisplayString>{p_->value, s}</DisplayString>
<StringView>p_->value, s</StringView>
</Type>

<Type Name="CInifile::Item">
<DisplayString>Key: {first, s} Value: {second, sb}</DisplayString>
</Type>

<Type Name="CInifile::Sect">
<DisplayString>{Name}</DisplayString>
<Expand>
<ExpandedItem>Data</ExpandedItem>
</Expand>
</Type>

<Type Name="CInifile">
<DisplayString>Ini: flags: SaveAtEnd: {!!(m_flags.flags &amp; eSaveAtEnd)} ReadOnly: {!!(m_flags.flags &amp; eReadOnly)} OverrideNames: {!!(m_flags.flags &amp; eOverrideNames)}</DisplayString>
<Expand>
<ExpandedItem>DATA</ExpandedItem>
</Expand>
</Type>

<Type Name="resptr_base&lt;*&gt;">
<DisplayString Condition="p_ == 0">""</DisplayString>
<DisplayString>{p_->name}</DisplayString>
</Type>

<Type Name="resptr_base&lt;CTexture&gt;">
<DisplayString Condition="p_ == 0">""</DisplayString>
<DisplayString>{p_->name}</DisplayString>
</Type>

</AutoVisualizer>

0 comments on commit 614a4ba

Please sign in to comment.