objrefs = g_hash_table_new_full (NULL, NULL, NULL, mono_debugger_free_objref);
mini_get_dbg_callbacks ()->handle_exception = handle_exception;
+ mini_get_dbg_callbacks ()->user_break = mono_wasm_user_break;
}
MONO_API void
// mono_wasm_fire_bp ();
}
+void
+mono_wasm_user_break (void)
+{
+ mono_wasm_fire_bp ();
+}
+
EMSCRIPTEN_KEEPALIVE int
mono_wasm_current_bp_id (void)
{
void mono_wasm_single_step_hit (void);
void mono_wasm_breakpoint_hit (void);
+void mono_wasm_user_break (void);
int mono_wasm_assembly_already_added (const char *assembly_name);
Assert.True(load_assemblies_res.IsOk);
}
+ [Fact]
+ public async Task BreakOnDebuggerBreak()
+ {
+ var insp = new Inspector();
+ //Collect events
+ var scripts = SubscribeToScripts(insp);
+
+ await Ready();
+ await insp.Ready(async (cli, token) =>
+ {
+ ctx = new DebugTestContext(cli, insp, token, scripts);
+ await EvaluateAndCheck(
+ "window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);",
+ "dotnet://debugger-test.dll/debugger-test2.cs", 56, 4,
+ "BreakOnDebuggerBreakCommand");
+ });
+ }
//TODO add tests covering basic stepping behavior as step in/out/over
}
}
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-
+using System.Diagnostics;
public class Misc
{ //Only append content to this class as the test suite depends on line info
public static int CreateObject(int foo, int bar)
var d = usMin + usMax;
}
}
+
+public class UserBreak {
+ public static void BreakOnDebuggerBreakCommand()
+ {
+ Debugger.Break();
+ }
+}