Natvis Parity: Missing `,na[⋯]` Specifiers

Open
#1,533 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, vscode
Domain
devtools

Research direction

Reproduce the NatvisTestType example with the VSCode cppdbg configuration and engineLogging enabled in launch.json; inspect the generated -var-create expression. Compare the expected ,na length/specifier behavior and template substitution with the VS behavior, then verify that the Natvis display expression is accepted and works.

Written by the indexing model from the issue text.

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 (https://github.com/microsoft/MIEngine/issues/1369) for the length itself. One also observes in this example that HideRawView is disrespected (https://github.com/microsoft/MIEngine/issues/1458).

Dominant language
C#
Stars
859
Forks
233
Avg merge
1d 6h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/MIEngine

All issues in microsoft/MIEngine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.