Skip to content

Natvis Parity: Missing ,na[⋯] Specifiers #1533

Description

The following simple example serves as a minimal test case. It should work in VS and fail in VSCode.

The type:

template< class T, int n >
struct NatvisTestType final
{
	T arr[n];
};

The Natvis:

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
	<Type Name="NatvisTestType&lt;*,*&gt;">
		<DisplayString>{($T1*)arr,na$T2}</DisplayString>
		<Expand HideRawView="true">
			<ExpandedItem>arr</ExpandedItem>
		</Expand>
	</Type>
</AutoVisualizer>

On VSCode "cppdbg", the debugger will say "-var-create: unable to create variable object". Adding "logging": { "engineLogging": true } to the configuration in "launch.json", will show in the debug console that it attempted to do the following:

1: (814) ->(gdb)
1: (814) 1125: elapsed time 3
1: (814) <-1126-var-create  - * "(float*)((test).arr),na$T2"
1: (818) ->1126^error,msg="-var-create: unable to create variable object"

This obviously can't work. The syntax is not right, and $T2 didn't even get substituted in properly!

See also related issue (#1369) for the length itself. One also observes in this example that HideRawView is disrespected (#1458).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions