Skip to content

Commit

Permalink
Undo nested static changes that will be sumbitted in another PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilonatommy committed Nov 24, 2021
1 parent 6c20935 commit 6a1b7ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 42 deletions.
13 changes: 8 additions & 5 deletions src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,16 @@ public TypeInfo(AssemblyInfo assembly, TypeDefinitionHandle typeHandle, TypeDefi
this.type = type;
methods = new List<MethodInfo>();
Name = metadataReader.GetString(type.Name);
var declaringType = type;
while (declaringType.IsNested)
if (type.IsNested)
{
declaringType = metadataReader.GetTypeDefinition(declaringType.GetDeclaringType());
Name = metadataReader.GetString(declaringType.Name) + "." + Name;
var declaringType = metadataReader.GetTypeDefinition(type.GetDeclaringType());
Name = metadataReader.GetString(declaringType.Name) + "/" + Name;
Namespace = metadataReader.GetString(declaringType.Namespace);
}
else
{
Namespace = metadataReader.GetString(type.Namespace);
}
Namespace = metadataReader.GetString(declaringType.Namespace);
if (Namespace.Length > 0)
FullName = Namespace + "." + Name;
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public async Task<JObject> GetValueFromObject(JToken objRet, CancellationToken t
if (memberObject != null && i < parts.Length - 1)
remaining = string.Join('.', parts[(i + 1)..]);

if (memberObject != null || remaining != null)
return (memberObject, remaining);
return (memberObject, remaining);
}

if (!string.IsNullOrEmpty(methodInfo.TypeInfo.Namespace))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,41 +747,6 @@ await EvaluateOnCallFrameAndCheck(id,
("EvaluateNonStaticClassWithStaticFields.StaticPropertyWithError", TString("System.Exception: not implemented")));
});

[Fact]
public async Task EvaluateStaticClassesNested() => await CheckInspectLocalsAtBreakpointSite(
"DebuggerTests.EvaluateMethodTestsClass", "EvaluateMethods", 3, "EvaluateMethods",
"window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })",
wait_for_event_fn: async (pause_location) =>
{
var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
var frame = pause_location["callFrames"][0];
await EvaluateOnCallFrameAndCheck(id,
("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(3)),
("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty3")),
("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 3")),
("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(3)),
("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty3")),
("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 3")));
});

[Fact]
public async Task EvaluateStaticClassesNestedWithNoNamespace() => await CheckInspectLocalsAtBreakpointSite(
"NoNamespaceClass", "EvaluateMethods", 1, "EvaluateMethods",
"window.setTimeout(function() { invoke_static_method ('[debugger-test] NoNamespaceClass:EvaluateMethods'); })",
wait_for_event_fn: async (pause_location) =>
{
var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
var frame = pause_location["callFrames"][0];
await EvaluateOnCallFrameAndCheck(id,
("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(30)),
("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty30")),
("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 30")));
});

[Fact]
public async Task EvaluateStaticClassesFromDifferentNamespaceInDifferentFrames() => await CheckInspectLocalsAtBreakpointSite(
"DebuggerTestsV2.EvaluateStaticClass", "Run", 1, "Run",
Expand Down

0 comments on commit 6a1b7ad

Please sign in to comment.