Skip to content

Natvis intrinsic support#1558

Open
lugerard wants to merge 2 commits intomicrosoft:mainfrom
lugerard:natvis-intrinsic-support
Open

Natvis intrinsic support#1558
lugerard wants to merge 2 commits intomicrosoft:mainfrom
lugerard:natvis-intrinsic-support

Conversation

@lugerard
Copy link
Copy Markdown

@lugerard lugerard commented May 7, 2026

This PR adds two improvements to the NatVis engine for GDB/LLDB.

Strip dll!-qualified module prefixes

NatVis files targeting Windows often qualify type names with a module prefix (e.g. Qt6Cored.dll!) to disambiguate types. These prefixes are meaningless to GDB and LLDB and cause expression evaluation to fail on Linux/macOS. ReplaceNamesInExpression now strips them before any expression is sent to the debugger.

Intrinsic support

elements define named inline expressions within a block that can be called by name (with optional parameters) in any DisplayString or Expand expression in the same block. MIEngine previously ignored them silently, causing visualizers that rely on intrinsics to fall back to raw view. This change collects intrinsics from the block and resolves calls before expression evaluation. The schema (natvis.xsd) and generated types (NatvisXsdTypes.cs) are updated accordingly.

Added tests.

lugerard added 2 commits May 7, 2026 14:46
Expressions in NatVis files often reference Windows-specific module
prefixes such as Qt6Cored.dll! to disambiguate types. These prefixes
are meaningless to GDB and LLDB and cause evaluation failure on
Linux/macOS. ReplaceNamesInExpression now strips them before any
expression is sent to the debugger.
NatVis <Intrinsic> elements define named inline expressions that can be
called by name in any subsequent expression within the same <Type> block.
MIEngine previously ignored them silently; this change makes them work.
@lugerard
Copy link
Copy Markdown
Author

lugerard commented May 8, 2026 via email

@lugerard
Copy link
Copy Markdown
Author

lugerard commented May 8, 2026 via email

@lugerard
Copy link
Copy Markdown
Author

lugerard commented May 8, 2026

@Waan @greggm would appreciate a review when you have a moment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant