Skip to content

Commit

Permalink
cleanup natvis (microsoft#1077)
Browse files Browse the repository at this point in the history
- `fail_fast`,`basic_string_span` and `basic_zstring_span` are not declared in the headers any more.
- Name the exporting header file for all types in `GSL.natvis`.
  • Loading branch information
beinhaerter authored Dec 29, 2022
1 parent c016bdc commit ac26d7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
35 changes: 4 additions & 31 deletions GSL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
vim: syntax=xml
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<!-- These types are from the gsl_assert header. -->
<Type Name="gsl::fail_fast">
<!-- na hides the address, otherwise it would appear as 0x.... "Message" -->
<DisplayString>{_Data._What,nasb}</DisplayString>
</Type>

<!-- These types are from the gsl_util header. -->
<!-- These types are from the util header. -->
<Type Name="gsl::final_action&lt;*&gt;">
<DisplayString>{{ invoke = {invoke_}, action = {f_} }}</DisplayString>
<Expand>
Expand All @@ -19,7 +13,8 @@
</Expand>
</Type>

<Type Name="gsl::span&lt;*, *&gt;">
<!-- These types are from the span header. -->
<Type Name="gsl::span&lt;*, *&gt;">
<DisplayString>{{ extent = {storage_.size_} }}</DisplayString>
<Expand>
<ArrayItems>
Expand All @@ -29,29 +24,7 @@
</Expand>
</Type>

<Type Name="gsl::basic_string_span&lt;*, *&gt;">
<DisplayString>{span_.storage_.data_,[span_.storage_.size_]na}</DisplayString>
<Expand>
<Item Name="[size]">span_.storage_.size_</Item>
<ArrayItems>
<Size>span_.storage_.size_</Size>
<ValuePointer>span_.storage_.data_</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="gsl::basic_zstring_span&lt;*, *&gt;">
<DisplayString>{span_.storage_.data_,[span_.storage_.size_]na}</DisplayString>
<Expand>
<Item Name="[size]">span_.storage_.size_</Item>
<ArrayItems>
<Size>span_.storage_.size_</Size>
<ValuePointer>span_.storage_.data_</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<!-- These types are from the gsl header. -->
<!-- These types are from the pointers header. -->
<Type Name="gsl::not_null&lt;*&gt;">
<!-- We can always dereference this since it's an invariant. -->
<DisplayString>value = {*ptr_}</DisplayString>
Expand Down
2 changes: 1 addition & 1 deletion tests/assertion_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
///////////////////////////////////////////////////////////////////////////////

#include "deathTestCommon.h"
#include <gsl/assert> // for fail_fast (ptr only), Ensures, Expects
#include <gsl/assert> // for Ensures, Expects
#include <gtest/gtest.h>

using namespace gsl;
Expand Down

0 comments on commit ac26d7b

Please sign in to comment.