From c5e17919b232bbce520f571b6c5e6f3bd8733d90 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Fri, 12 Nov 2021 15:35:11 +0100 Subject: [PATCH 1/4] Fixed 9 tests from EvaluateOnCallFrame. --- .../EvaluateOnCallFrameTests.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs index 71f280ad13cc3c..bb1406c60ac9f6 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs @@ -252,7 +252,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -431,7 +431,7 @@ await EvaluateOnCallFrameFail(id, [Fact] public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -494,7 +494,7 @@ async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expressi [Fact] public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -518,7 +518,7 @@ public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAt [Fact] public async Task EvaluateSimpleMethodCallsWithoutParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -535,7 +535,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithConstParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -554,7 +554,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithVariableParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -664,7 +664,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsCheckChangedValue() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -684,7 +684,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateStaticClass() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -802,7 +802,7 @@ await EvaluateOnCallFrameAndCheck(id_second, [Fact] public async Task EvaluateStaticClassInvalidField() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { From 4b8ac74d3a1cb47df1a4ee1f2250da514077aad3 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Fri, 12 Nov 2021 15:35:11 +0100 Subject: [PATCH 2/4] Fixed 9 tests from EvaluateOnCallFrame. --- .../EvaluateOnCallFrameTests.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs index 0a414282b408d4..bcce8c58929a1e 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs @@ -253,7 +253,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -432,7 +432,7 @@ await EvaluateOnCallFrameFail(id, [Fact] public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -495,7 +495,7 @@ async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expressi [Fact] public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -519,7 +519,7 @@ public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAt [Fact] public async Task EvaluateSimpleMethodCallsWithoutParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -536,7 +536,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithConstParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -560,7 +560,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithVariableParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -670,7 +670,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsCheckChangedValue() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -690,7 +690,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateStaticClass() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -806,7 +806,7 @@ await EvaluateOnCallFrameAndCheck(id_second, [Fact] public async Task EvaluateStaticClassInvalidField() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { From f736557ec74c397ef8eae800eaf59b6c829ac77d Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Thu, 18 Nov 2021 13:54:39 +0100 Subject: [PATCH 3/4] Fixed 18 test types. --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 8b1265d866d4d6..298c87646f05b1 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -500,8 +500,8 @@ protected override async Task AcceptCommand(MessageId id, string method, J { // Maybe this is an async method, in which case the debug info is attached // to the async method implementation, in class named: - // `{type_name}/::MoveNext` - methodInfo = assembly.TypesByName.Values.SingleOrDefault(t => t.FullName.StartsWith($"{typeName}/<{methodName}>"))? + // `{type_name}.::MoveNext` + methodInfo = assembly.TypesByName.Values.SingleOrDefault(t => t.FullName.StartsWith($"{typeName}.<{methodName}>"))? .Methods.FirstOrDefault(mi => mi.Name == "MoveNext"); } From 67efb178076830a102c5c135f081e616827e9f8c Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Thu, 18 Nov 2021 15:46:03 +0100 Subject: [PATCH 4/4] Fix test cases with spaces in the names, e.g. " this" evaluation. --- .../debugger/BrowserDebugProxy/MemberReferenceResolver.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs index db730b1ee2d73a..6c18b874fcb27f 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs @@ -205,6 +205,7 @@ public async Task Resolve(string varName, CancellationToken token) async Task ResolveAsLocalOrThisMember(string name) { + var nameTrimmed = name.Trim(); if (scopeCache.Locals.Count == 0 && !localsFetched) { Result scope_res = await proxy.GetScopeProperties(sessionId, scopeId, token); @@ -213,7 +214,7 @@ async Task ResolveAsLocalOrThisMember(string name) localsFetched = true; } - if (scopeCache.Locals.TryGetValue(name, out JObject obj)) + if (scopeCache.Locals.TryGetValue(nameTrimmed, out JObject obj)) return obj["value"]?.Value(); if (!scopeCache.Locals.TryGetValue("this", out JObject objThis)) @@ -223,7 +224,7 @@ async Task ResolveAsLocalOrThisMember(string name) return null; var rootResObj = await proxy.RuntimeGetPropertiesInternal(sessionId, objectId, null, token); - var objRet = rootResObj.FirstOrDefault(objPropAttr => objPropAttr["name"].Value() == name); + var objRet = rootResObj.FirstOrDefault(objPropAttr => objPropAttr["name"].Value() == nameTrimmed); if (objRet != null) return await GetValueFromObject(objRet, token);