Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/mono/mono/component/hot_reload.c
Original file line number Diff line number Diff line change
Expand Up @@ -3471,7 +3471,7 @@ hot_reload_get_method_params (MonoImage *base_image, uint32_t methoddef_token, u
static const char *
hot_reload_get_capabilities (void)
{
return "Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod";
return "Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod UpdateParameters";
}

static GENERATE_GET_CLASS_WITH_CACHE_DECL (hot_reload_instance_field_table);
Expand Down
38 changes: 38 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,5 +599,43 @@ await SendCommandAndCheck (JObject.FromObject(new { }), "Debugger.resume", scrip
}, "c", num_fields: 2);
});
}

// Enable this test when https://github.com/dotnet/hotreload-utils/pull/264 flows into dotnet/runtime repo
// [ConditionalFact(nameof(RunningOnChrome))]
// public async Task DebugHotReloadMethod_ChangeParameterName()
// {
// string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll");
// string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb");
// string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll");

// var bp_notchanged = await SetBreakpoint(".*/MethodBody1.cs$", 89, 12, use_regex: true);
// // var bp_invalid = await SetBreakpoint(".*/MethodBody1.cs$", 59, 12, use_regex: true);

// var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges(
// asm_file, pdb_file, "MethodBody9", "test", expectBpResolvedEvent: true, sourcesToWait: new string [] { "MethodBody0.cs", "MethodBody1.cs" });

// CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 89, 12, scripts, pause_location["callFrames"]?[0]["location"]);
// await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 90, 12, "ApplyUpdateReferencedAssembly.MethodBody9.M1",
// locals_fn: async (locals) =>
// {
// CheckNumber(locals, "a", 1);
// await Task.CompletedTask;
// }
// );
// //apply first update
// pause_location = await LoadAssemblyAndTestHotReloadUsingSDB(
// asm_file_hot_reload, "MethodBody9", "test", 1);

// JToken top_frame = pause_location["callFrames"]?[0];
// AssertEqual("ApplyUpdateReferencedAssembly.MethodBody9.M1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString());
// CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 89, 12, scripts, top_frame["location"]);
// await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 90, 12, "ApplyUpdateReferencedAssembly.MethodBody9.M1",
// locals_fn: async (locals) =>
// {
// CheckNumber(locals, "x", 1);
// await Task.CompletedTask;
// }
// );
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,41 @@ public static void StaticMethod1 () {
Console.WriteLine("original");
}
}




























// public class MethodBody9 {
// public static int M1(int a, int b) {
// return a + b;
// }

// public static int test() {
// return M1(1, 2);
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ public void InstanceMethod () {
Console.WriteLine($"add a breakpoint the instance method of the new class");
}
}

// public class MethodBody9 {
// public static int M1(int x, int y) {
// return x + y;
// }

// public static int test() {
// return M1(1, 2);
// }
// }
}