Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2280,10 +2280,16 @@ public async Task<JArray> 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this fail to find the correct .ctor, if there is more than one on the type?

Also, DebuggerTypeProxy accepts a string arg with the type name. That doesn't have to be in this PR though.

}
else
Expand Down
9 changes: 7 additions & 2 deletions src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -54,8 +54,13 @@ public async Task UsingDebuggerTypeProxy()
props = await GetObjectOnFrame(frame, "b");
CheckString(props, "Val2", "one");

CheckObject(locals, "openWith", "System.Collections.Generic.Dictionary<string, string>", description: "Count = 3");
props = await GetObjectOnFrame(frame, "openWith");
Assert.Equal(1, props.Count());

await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value<string>(),
("listToTestToList.ToList()", TObject("System.Collections.Generic.List<int>", description: "Count = 11")));

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public static void run()
var c = new DebuggerDisplayMethodTest();
List<int> myList = new List<int>{ 1, 2, 3, 4 };
var listToTestToList = System.Linq.Enumerable.Range(1, 11);

Dictionary<string, string> openWith = new Dictionary<string, string>();

openWith.Add("txt", "notepad");
openWith.Add("bmp", "paint");
openWith.Add("dib", "paint");
Console.WriteLine("break here");

Console.WriteLine("break here");
}
}
Expand Down