From afc93f39ce1a0a1c88789dfb3aedc5b8e3696e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucie=20G=C3=A9rard?= Date: Tue, 26 May 2026 16:15:24 +0200 Subject: [PATCH] Natvis: trim leading/trailing whitespace from DisplayString XML text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Visual Studio trims whitespace from DisplayString inner XML text before processing. MIEngine did not, causing multi-line DisplayStrings to render as blank on GDB/LLDB — the leading newline and indentation made the display appear empty in the variables panel. Fix: call format.Trim() at the top of FormatValue() before processing. --- src/MIDebugEngine/Natvis.Impl/Natvis.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MIDebugEngine/Natvis.Impl/Natvis.cs b/src/MIDebugEngine/Natvis.Impl/Natvis.cs index edf7f702a..fdd8a8001 100755 --- a/src/MIDebugEngine/Natvis.Impl/Natvis.cs +++ b/src/MIDebugEngine/Natvis.Impl/Natvis.cs @@ -1264,6 +1264,7 @@ private string FormatValue(string format, IVariableInformation variable, IDictio { return String.Empty; } + format = format.Trim(); StringBuilder value = new StringBuilder(); for (int i = 0; i < format.Length; ++i) {