Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Type>


<Type Name="std::error_category">
<DisplayString Condition="_Addr == 1">[future]</DisplayString>
<DisplayString Condition="_Addr == 3">[generic]</DisplayString>
<DisplayString Condition="_Addr == 5">[iostream]</DisplayString>
<DisplayString Condition="_Addr == 7">[system]</DisplayString>
<DisplayString>@{((uintptr_t)this),x}</DisplayString>
Comment on lines +26 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should:

Suggested change
<DisplayString Condition="_Addr == 1">[future]</DisplayString>
<DisplayString Condition="_Addr == 3">[generic]</DisplayString>
<DisplayString Condition="_Addr == 5">[iostream]</DisplayString>
<DisplayString Condition="_Addr == 7">[system]</DisplayString>
<DisplayString>@{((uintptr_t)this),x}</DisplayString>
<DisplayString>[{name(),sb}]</DisplayString>
<Expand>
<Synthetic Name="hint">
<DisplayString>Enable "Allow Function Calls In Value Formatting" if you see "???" here</DisplayString>
</Synthetic>
</Expand>

here. It requires "Allow Function Calls In Value Formatting" to be enabled in the debugger, but produces an identical experience for library-defined and user-defined error_categorys.

</Type>


<Type Name="std::error_code">
<DisplayString>{_Myval} {*_Mycat}</DisplayString>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we accept the above suggestion, we should also:

Suggested change
<DisplayString>{_Myval} {*_Mycat}</DisplayString>
<DisplayString>{_Myval} {*_Mycat}</DisplayString>
<Expand>
<Synthetic Name="hint">
<DisplayString>Enable "Allow Function Calls In Value Formatting" if you see "???" for the category</DisplayString>
</Synthetic>
</Expand>

for discoverability.

</Type>


<Type Name="std::exception_ptr">
<CustomVisualizer Condition="_Data1 != 0" VisualizerId="CEB58A03-E78D-4D19-9AE7-4738E200649E" />
<DisplayString Condition="_Data1 == 0">null</DisplayString>
Expand Down