Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fab24e5
Using current namespace as the default place to serach for the resolv…
ilonatommy Nov 5, 2021
66b56a7
Add tests for static class, static fields and pausing in async method.
ilonatommy Nov 5, 2021
782a107
Added tests for class evaluation.
ilonatommy Nov 8, 2021
4119de3
Fixing support to the current namespace and adding tests for it
thaystg Nov 8, 2021
e275144
Merge branch 'add-static-attribute-support' of https://github.com/ilo…
ilonatommy Nov 9, 2021
ee19014
Assuing that we search within the current assembly first. Removed tes…
ilonatommy Nov 9, 2021
89bdc49
Remove a test-duplicate that was not testing static class or static f…
ilonatommy Nov 9, 2021
5ce0f57
Fixing indentation.
ilonatommy Nov 9, 2021
62d18b6
Refixing indentation.
ilonatommy Nov 9, 2021
ce177fd
Refix indentations again.
ilonatommy Nov 9, 2021
cb32402
Applied the advice about adding new blank lines.
ilonatommy Nov 10, 2021
ed2577e
Changed the current assembly check.
ilonatommy Nov 10, 2021
01f46d5
Extracting the check from the loop. One time check is enough.
ilonatommy Nov 10, 2021
d14367d
Simplifying multiple test cases into one call.
ilonatommy Nov 10, 2021
8a82380
Using local function as per review suggestion.
ilonatommy Nov 11, 2021
7f24d47
Added test that was skipped by mistake.
ilonatommy Nov 11, 2021
367c431
Added looking for the namespace in all assemblies because there is a …
ilonatommy Nov 11, 2021
55479c8
Extracting value based on the current frame, not the top of stack loc…
ilonatommy Nov 11, 2021
5f5cdf6
Test for classes evaluated from different frames.
ilonatommy Nov 11, 2021
d020d36
[wasm] MemberReferenceResolver: rework a bit to fix some cases
radical Nov 13, 2021
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
Prev Previous commit
Next Next commit
Assuing that we search within the current assembly first. Removed tes…
…ts that fail in Consol App.
  • Loading branch information
ilonatommy committed Nov 9, 2021
commit ee19014c8aec41521c2e69769fd4fc271a4dae33
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ public async Task<JObject> TryToRunOnLoadedClasses(string varName, CancellationT
}
}
var store = await proxy.LoadStore(sessionId, token);
var info = ctx.CallStack.FirstOrDefault().Method.Info;
var currentAssembly = info.Assembly;
var namespaceName = info.TypeInfo.Namespace;
var classNameToFindWithNamespace = namespaceName + "." + classNameToFind;
var type = currentAssembly.GetTypeByName(classNameToFindWithNamespace);
if (type != null)
{
typeId = await sdbHelper.GetTypeIdFromToken(sessionId, currentAssembly.DebugId, type.Token, token);
continue;
}
foreach (var asm in store.assemblies)
{
var type = asm.GetTypeByName(classNameToFind);
if (type == null) //search in the current namespace
{
var namespaceName = ctx.CallStack.FirstOrDefault().Method.Info.TypeInfo.Namespace;
var classNameToFindWithNamespace = namespaceName + "." + classNameToFind;
type = asm.GetTypeByName(classNameToFindWithNamespace);
}
type = asm.GetTypeByName(classNameToFind);
if (type != null)
{
typeId = await sdbHelper.GetTypeIdFromToken(sessionId, asm.DebugId, type.Token, token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ public async Task EvaluateStaticClass() => await CheckInspectLocalsAtBreakpointS

var frame = pause_location["callFrames"][0];

await EvaluateOnCallFrame(id, "DebuggerTests.EvaluateStaticClass", expect_ok: true);
await EvaluateOnCallFrameAndCheck(id,
("DebuggerTests.EvaluateStaticClass.StaticField1", TNumber(10)));
await EvaluateOnCallFrameAndCheck(id,
Expand All @@ -711,7 +710,6 @@ public async Task EvaluateStaticClassFromStaticMethod() => await CheckInspectLoc

var frame = pause_location["callFrames"][0];

await EvaluateOnCallFrame(id, "DebuggerTests.EvaluateStaticClass", expect_ok: true);
await EvaluateOnCallFrameAndCheck(id,
("EvaluateStaticClass.StaticField1", TNumber(10)));
await EvaluateOnCallFrameAndCheck(id,
Expand All @@ -738,7 +736,6 @@ public async Task EvaluateStaticClassFromAsyncMethod(string type, string method,

var frame = pause_location["callFrames"][0];

await EvaluateOnCallFrame(id, "DebuggerTests.EvaluateStaticClass", expect_ok: true);
await EvaluateOnCallFrameAndCheck(id,
("EvaluateStaticClass.StaticField1", TNumber(10)));
await EvaluateOnCallFrameAndCheck(id,
Expand All @@ -755,15 +752,17 @@ await EvaluateOnCallFrameAndCheck(id,

[Fact]
public async Task EvaluateNonStaticClassWithStaticFields() => await CheckInspectLocalsAtBreakpointSite(
"DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run",
"window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })",
"DebuggerTests.EvaluateMethodTestsClass", "EvaluateAsyncMethods", 3, "EvaluateAsyncMethods",
"window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateAsyncMethods'); })",
wait_for_event_fn: async (pause_location) =>
{
var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();

var frame = pause_location["callFrames"][0];

await EvaluateOnCallFrame(id, "DebuggerTests.EvaluateNonStaticClassWithStaticFields", expect_ok: true);
await EvaluateOnCallFrame(id, "staticClass", expect_ok: true);
await EvaluateOnCallFrameAndCheck(id,
("staticClass", TObject("DebuggerTests.EvaluateNonStaticClassWithStaticFields", is_null: false)));
await EvaluateOnCallFrameAndCheck(id,
("DebuggerTests.EvaluateNonStaticClassWithStaticFields.StaticField1", TNumber(10)));
await EvaluateOnCallFrameAndCheck(id,
Expand Down