diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs index d804421e78ab51..418215343d5fe7 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs @@ -2280,10 +2280,16 @@ public async Task GetValuesFromDebuggerProxyAttribute(SessionId sessionI var assemblyNameArg = await GetFullAssemblyName(sessionId, assemblyIdArg, token); var classNameArg = await GetTypeNameOriginal(sessionId, genericTypeArgs[k], token); typeToSearch += classNameArg +", " + assemblyNameArg; + if (k + 1 < genericTypeArgs.Count) + typeToSearch += "], ["; + else + typeToSearch += "]"; } - typeToSearch += "]]"; + typeToSearch += "]"; typeToSearch += ", " + assemblyName; var genericTypeId = await GetTypeByName(sessionId, typeToSearch, token); + if (genericTypeId < 0) + return null; methodId = await GetMethodIdByName(sessionId, genericTypeId, ".ctor", token); } else diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs index 09bee325d72c43..fa188b109d7069 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs @@ -17,7 +17,7 @@ public class CustomViewTests : DebuggerTestBase [Fact] public async Task UsingDebuggerDisplay() { - var bp = await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.DebuggerCustomViewTest", "run", 6); + var bp = await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.DebuggerCustomViewTest", "run", 12); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.DebuggerCustomViewTest:run'); }, 1);", "dotnet://debugger-test.dll/debugger-custom-view-test.cs", @@ -34,7 +34,7 @@ public async Task UsingDebuggerDisplay() [Fact] public async Task UsingDebuggerTypeProxy() { - var bp = await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.DebuggerCustomViewTest", "run", 6); + var bp = await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.DebuggerCustomViewTest", "run", 12); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.DebuggerCustomViewTest:run'); }, 1);", "dotnet://debugger-test.dll/debugger-custom-view-test.cs", @@ -54,8 +54,13 @@ public async Task UsingDebuggerTypeProxy() props = await GetObjectOnFrame(frame, "b"); CheckString(props, "Val2", "one"); + CheckObject(locals, "openWith", "System.Collections.Generic.Dictionary", description: "Count = 3"); + props = await GetObjectOnFrame(frame, "openWith"); + Assert.Equal(1, props.Count()); + await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value(), ("listToTestToList.ToList()", TObject("System.Collections.Generic.List", description: "Count = 11"))); + } } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-custom-view-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-custom-view-test.cs index ecdccf0251f9ff..bd25c49bd2bc08 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-custom-view-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-custom-view-test.cs @@ -67,6 +67,14 @@ public static void run() var c = new DebuggerDisplayMethodTest(); List myList = new List{ 1, 2, 3, 4 }; var listToTestToList = System.Linq.Enumerable.Range(1, 11); + + Dictionary openWith = new Dictionary(); + + openWith.Add("txt", "notepad"); + openWith.Add("bmp", "paint"); + openWith.Add("dib", "paint"); + Console.WriteLine("break here"); + Console.WriteLine("break here"); } }