common: Add NATVIS to BitField class for better VS debugging (#1731)
Some checks failed
citra-build / source (push) Has been cancelled
citra-build / linux (appimage) (push) Has been cancelled
citra-build / linux (appimage-wayland) (push) Has been cancelled
citra-build / linux (fresh) (push) Has been cancelled
citra-build / macos (arm64) (push) Has been cancelled
citra-build / macos (x86_64) (push) Has been cancelled
citra-build / windows (msvc) (push) Has been cancelled
citra-build / windows (msys2) (push) Has been cancelled
citra-build / android (googleplay) (push) Has been cancelled
citra-build / android (vanilla) (push) Has been cancelled
citra-build / docker (push) Has been cancelled
citra-format / clang-format (push) Has been cancelled
citra-transifex / transifex (push) Has been cancelled
citra-build / macos-universal (push) Has been cancelled
azahar-stale / stale-issues (push) Has been cancelled

This commit is contained in:
PabloMK7 2026-02-13 14:30:04 +01:00 committed by GitHub
parent 3e27010c7b
commit 91abe7f7d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -68,6 +68,7 @@ add_library(citra_common STATIC
detached_tasks.cpp
detached_tasks.h
bit_field.h
bit_field.natvis
bit_set.h
bounded_threadsafe_queue.h
cityhash.cpp

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright Citra Emulator Project / Azahar Emulator Project -->
<!-- Licensed under GPLv2 or any later version -->
<!-- Refer to the license.txt file included. -->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="BitField&lt;*,*,*,*&gt;">
<DisplayString>
{((unsigned long long)storage &gt;&gt; $T1) &amp; (((unsigned long long)1 &lt;&lt; $T2) - 1)}
</DisplayString>
<Expand>
<Item Name="UnsignedValue">
((unsigned long long)storage &gt;&gt; $T1) &amp; (((unsigned long long)1 &lt;&lt; $T2) - 1)
</Item>
<Item Name="SignedValue">
(long long)((((unsigned long long)storage &gt;&gt; $T1) &amp; ((1ULL &lt;&lt; $T2)-1)) &amp; (1ULL &lt;&lt; ($T2-1))
? -((1ULL &lt;&lt; $T2) - (((unsigned long long)storage &gt;&gt; $T1) &amp; ((1ULL &lt;&lt; $T2)-1)))
: (((unsigned long long)storage &gt;&gt; $T1) &amp; ((1ULL &lt;&lt; $T2)-1)))
</Item>
<Item Name="Position">
$T1
</Item>
<Item Name="Bits">
$T2
</Item>
<Item Name="RawStorage">storage</Item>
</Expand>
</Type>
</AutoVisualizer>