From 67331e65390f238c187969746b5af11d7a737654 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 30 Aug 2022 13:04:50 -0300 Subject: [PATCH 01/46] First version of multithreaded debugging. --- src/mono/mono/component/debugger-agent.c | 49 +- src/mono/mono/component/mini-wasm-debugger.c | 5 +- .../BrowserDebugProxy/DevToolsHelper.cs | 11 +- .../Firefox/FirefoxMonoProxy.cs | 13 +- .../debugger/BrowserDebugProxy/MonoProxy.cs | 54 +- .../BrowserDebugProxy/MonoSDBHelper.cs | 8 + src/mono/wasm/runtime/debug.ts | 9 +- src/mono/wasm/runtime/es6/dotnet.es6.lib.js | 2 +- src/mono/wasm/runtime/exports-linker.ts | 4 +- src/mono/wasm/runtime/package-lock.json | 2148 +---------------- src/mono/wasm/runtime/rollup.config.js | 2 +- 11 files changed, 96 insertions(+), 2209 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 45404d5967b3f..e366ec7ba1561 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -414,7 +414,7 @@ static gint32 suspend_count; /* Whenever to buffer reply messages and send them together */ static gboolean buffer_replies; -#ifndef TARGET_WASM + #define GET_TLS_DATA_FROM_THREAD(thread) \ DebuggerTlsData *tls = NULL; \ mono_loader_lock(); \ @@ -424,15 +424,6 @@ static gboolean buffer_replies; #define GET_DEBUGGER_TLS() \ DebuggerTlsData *tls; \ tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); -#else -/* the thread argument is omitted on wasm, to avoid compiler warning */ -#define GET_TLS_DATA_FROM_THREAD(...) \ - DebuggerTlsData *tls; \ - tls = &debugger_wasm_thread; -#define GET_DEBUGGER_TLS() \ - DebuggerTlsData *tls; \ - tls = &debugger_wasm_thread; -#endif static void (*start_debugger_thread_func) (MonoError *error); static void (*suspend_vm_func) (void); @@ -1645,13 +1636,21 @@ mono_init_debugger_agent_for_wasm (int log_level_parm, MonoProfilerHandle *prof) vm_start_event_sent = TRUE; transport = &transports [0]; - memset(&debugger_wasm_thread, 0, sizeof(DebuggerTlsData)); - mono_native_tls_alloc (&debugger_tls_id, NULL); - mono_native_tls_set_value (debugger_tls_id, &debugger_wasm_thread); - agent_config.enabled = TRUE; + mono_native_tls_alloc (&debugger_tls_id, NULL); + + mono_profiler_set_thread_started_callback (*prof, thread_startup); + mono_profiler_set_thread_stopped_callback (*prof, thread_end); mono_profiler_set_jit_done_callback (*prof, jit_done); + + mono_gc_base_init (); + + thread_to_tls = mono_g_hash_table_new_type_internal ((GHashFunc)mono_object_hash_internal, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger TLS Table"); + + tid_to_thread = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Table"); + + tid_to_thread_obj = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Object Table"); } void @@ -2244,14 +2243,17 @@ save_thread_context (MonoContext *ctx) void mono_wasm_save_thread_context (void) { - debugger_wasm_thread.really_suspended = TRUE; - mono_thread_state_init_from_current (&debugger_wasm_thread.context); + DebuggerTlsData* tls = mono_wasm_get_tls (); + tls->really_suspended = TRUE; + mono_thread_state_init_from_current (&tls->context); } DebuggerTlsData* mono_wasm_get_tls (void) { - return &debugger_wasm_thread; + MonoThread *thread = mono_thread_current (); + GET_TLS_DATA_FROM_THREAD (thread); + return tls; } #endif @@ -3899,8 +3901,9 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) /* * suspend_vm () could have missed this thread, so wait for a resume. */ - +#ifndef HOST_WASM suspend_current_func (); +#endif } static void @@ -9114,7 +9117,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) // Wait for suspending if it already started // FIXME: Races with suspend_count -#ifndef HOST_WASI +#if !defined(HOST_WASI) && !defined(HOST_WASM) while (!is_suspended ()) { if (suspend_count) wait_for_suspend (); @@ -9299,9 +9302,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) int objid; ErrorCode err; MonoThread *thread_obj; -#ifndef TARGET_WASM MonoInternalThread *thread; -#endif int pos, i, len, frame_idx; StackFrame *frame; MonoDebugMethodJitInfo *jit; @@ -9315,16 +9316,10 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) if (err != ERR_NONE) return err; -#ifndef TARGET_WASM thread = THREAD_TO_INTERNAL (thread_obj); -#endif id = decode_id (p, &p, end); -#ifndef TARGET_WASM GET_TLS_DATA_FROM_THREAD (thread); -#else - GET_TLS_DATA_FROM_THREAD (); -#endif g_assert (tls); for (i = 0; i < tls->frame_count; ++i) { diff --git a/src/mono/mono/component/mini-wasm-debugger.c b/src/mono/mono/component/mini-wasm-debugger.c index 98da53aa693b4..3ebdce2886b1d 100644 --- a/src/mono/mono/component/mini-wasm-debugger.c +++ b/src/mono/mono/component/mini-wasm-debugger.c @@ -41,7 +41,7 @@ EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, Mdb //JS functions imported that we use -extern void mono_wasm_fire_debugger_agent_message (void); +extern void mono_wasm_fire_debugger_agent_message_with_data (const char *data, int len); extern void mono_wasm_asm_loaded (const char *asm_name, const char *assembly_data, guint32 assembly_len, const char *pdb_data, guint32 pdb_len); G_END_DECLS @@ -454,9 +454,8 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, static gboolean receive_debugger_agent_message (void *data, int len) { - mono_wasm_add_dbg_command_received(1, 0, data, len); mono_wasm_save_thread_context(); - mono_wasm_fire_debugger_agent_message (); + mono_wasm_fire_debugger_agent_message_with_data ((const char*)data, len); return FALSE; } diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index a7c75a428e97a..af33ea86cda4e 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -408,7 +408,14 @@ public ExecutionContext(MonoSDBHelper sdbAgent, int id, object auxData, PauseOnE SdbAgent = sdbAgent; PauseOnExceptions = pauseOnExceptions; } - + public ExecutionContext Clone(SessionId sessionId) + { + var ret = new ExecutionContext(SdbAgent.Clone(sessionId), Id, AuxData, PauseOnExceptions); + ret.ready = ready; + ret.store = store; + ret.Source = Source; + return ret; + } public string DebugId { get; set; } public Dictionary BreakpointRequests { get; } = new Dictionary(); public int breakpointId; @@ -433,7 +440,7 @@ public ExecutionContext(MonoSDBHelper sdbAgent, int id, object auxData, PauseOnE public string[] LoadedFiles { get; set; } internal DebugStore store; internal MonoSDBHelper SdbAgent { get; init; } - public TaskCompletionSource Source { get; } = new TaskCompletionSource(); + public TaskCompletionSource Source { get; set; } = new TaskCompletionSource(); private Dictionary perScopeCaches { get; } = new Dictionary(); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs index deb9761130b3c..24a547f76afb5 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs @@ -271,8 +271,8 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject arg var topFunc = args["frame"]["displayName"].Value(); switch (topFunc) { - case "mono_wasm_fire_debugger_agent_message": - case "_mono_wasm_fire_debugger_agent_message": + case "mono_wasm_fire_debugger_agent_message_with_data": + case "_mono_wasm_fire_debugger_agent_message_with_data": { ctx.PausedOnWasm = true; return await OnReceiveDebuggerAgentEvent(sessionId, args, token); @@ -826,7 +826,7 @@ internal override Task SendMonoCommand(SessionId id, MonoCommands cmd, C return SendCommand(id, "evaluateJSAsync", o, token); } - internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, CancellationToken token) + internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, bool ignoreBreakpoint, CancellationToken token) { //different behavior when debugging from VSCode and from Firefox var ctx = context as FirefoxExecutionContext; @@ -861,7 +861,8 @@ internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile s }); } await SendEvent(sessionId, "", sourcesJObj, token); - + if (ignoreBreakpoint) + return; foreach (var req in context.BreakpointRequests.Values) { if (req.TryResolve(source)) @@ -979,8 +980,8 @@ private async Task GetFrames(SessionId sessionId, ExecutionContext context string function_name = frame["displayName"]?.Value(); if (function_name != null && !(function_name.StartsWith("Module._mono_wasm", StringComparison.Ordinal) || function_name.StartsWith("Module.mono_wasm", StringComparison.Ordinal) || - function_name == "mono_wasm_fire_debugger_agent_message" || - function_name == "_mono_wasm_fire_debugger_agent_message" || + function_name == "mono_wasm_fire_debugger_agent_message_with_data" || + function_name == "_mono_wasm_fire_debugger_agent_message_with_data" || function_name == "(wasmcall)")) { callFrames.Add(frame); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 7d2245da67784..8b916e8536547 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -13,6 +13,8 @@ using Newtonsoft.Json.Linq; using System.Net.Http; using BrowserDebugProxy; +using static System.Formats.Asn1.AsnWriter; +using System.Reflection; namespace Microsoft.WebAssembly.Diagnostics { @@ -169,9 +171,16 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par case "Debugger.paused": { - // Don't process events from sessions we aren't tracking - if (!contexts.ContainsKey(sessionId)) - return false; + // Don't process events from sessions we aren't tracking unless they have asyncStackTraceId + if (!contexts.ContainsKey(sessionId) && args["asyncStackTraceId"] != null) + { + contexts[sessionId] = contexts.First().Value.Clone(sessionId); + var store = await LoadStore(sessionId, true, token); + foreach (var source in store.AllSources()) + { + await OnSourceFileAdded(sessionId, source, contexts[sessionId], true, token); + } + } //TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack string top_func = args?["callFrames"]?[0]?["functionName"]?.Value(); @@ -190,17 +199,16 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par await SendResume(sessionId, token); return true; } - case "mono_wasm_fire_debugger_agent_message": - case "_mono_wasm_fire_debugger_agent_message": + case "mono_wasm_fire_debugger_agent_message_with_data": + case "_mono_wasm_fire_debugger_agent_message_with_data": + try { - try { - return await OnReceiveDebuggerAgentEvent(sessionId, args, token); - } - catch (Exception) //if the page is refreshed maybe it stops here. - { - await SendResume(sessionId, token); - return true; - } + return await OnReceiveDebuggerAgentEvent(sessionId, args, token); + } + catch (Exception) //if the page is refreshed maybe it stops here. + { + await SendResume(sessionId, token); + return true; } } break; @@ -1034,6 +1042,8 @@ protected virtual async Task SendCallStack(SessionId sessionId, ExecutionC data, hitBreakpoints = bp_list, }); + if (args["asyncStackTraceId"] != null) + o["asyncStackTraceId"] = args["asyncStackTraceId"]; if (!await EvaluateCondition(sessionId, context, context.CallStack.First(), bp, token)) { context.ClearState(); @@ -1051,13 +1061,18 @@ internal virtual void SaveLastDebuggerAgentBufferReceivedToContext(SessionId ses internal async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, CancellationToken token) { - Result res = await SendMonoCommand(sessionId, MonoCommands.GetDebuggerAgentBufferReceived(RuntimeId), token); + var argsNew = JObject.FromObject(new + { + objectId = args?["callFrames"]?[0]?["scopeChain"]?[0]?["object"]?["objectId"]?.Value(), + }); + Result res = await SendCommand(sessionId, "Runtime.getProperties", argsNew, token); + SaveLastDebuggerAgentBufferReceivedToContext(sessionId, res); if (!res.IsOk) return false; ExecutionContext context = GetContext(sessionId); - byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); + byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?[2]?["value"]?["value"]?.Value()); using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadBytes(11); //skip HEADER_LEN retDebuggerCmdReader.ReadByte(); //suspend_policy @@ -1282,7 +1297,7 @@ private async Task OnAssemblyLoadedJSEvent(SessionId sessionId, JObject ev var context = GetContext(sessionId); foreach (var source in store.Add(sessionId, assembly_name, assembly_data, pdb_data, token)) { - await OnSourceFileAdded(sessionId, source, context, token); + await OnSourceFileAdded(sessionId, source, context, false, token); } return true; @@ -1460,12 +1475,13 @@ private async Task SetMonoBreakpoint(SessionId sessionId, string req return bp; } - internal virtual async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, CancellationToken token) + internal virtual async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, bool ignoreBreakpoint, CancellationToken token) { JObject scriptSource = JObject.FromObject(source.ToScriptSource(context.Id, context.AuxData)); // Log("debug", $"sending {source.Url} {context.Id} {sessionId.sessionId}"); await SendEvent(sessionId, "Debugger.scriptParsed", scriptSource, token); - + if (ignoreBreakpoint) + return; foreach (var req in context.BreakpointRequests.Values) { if (req.TryResolve(source)) @@ -1501,7 +1517,7 @@ internal virtual async Task LoadStore(SessionId sessionId, bool tryU await foreach (SourceFile source in context.store.Load(sessionId, loaded_files, context, useDebuggerProtocol, token)) { - await OnSourceFileAdded(sessionId, source, context, token); + await OnSourceFileAdded(sessionId, source, context, false, token); } } } diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs index 3a25a7fac0792..7de840d2d2878 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs @@ -806,6 +806,14 @@ public MonoSDBHelper(MonoProxy proxy, ILogger logger, SessionId sessionId) ValueCreator = new(this, logger); ResetStore(null); } + public MonoSDBHelper Clone(SessionId sessionId) + { + var ret = new MonoSDBHelper(this.proxy, this.logger, sessionId); + ret.VmMajorVersion = this.VmMajorVersion; + ret.VmMinorVersion = this.VmMinorVersion; + ret.store = this.store; + return ret; + } public void ResetStore(DebugStore store) { diff --git a/src/mono/wasm/runtime/debug.ts b/src/mono/wasm/runtime/debug.ts index 43e9ffb83d3e1..29eb60e32a99e 100644 --- a/src/mono/wasm/runtime/debug.ts +++ b/src/mono/wasm/runtime/debug.ts @@ -32,14 +32,17 @@ export function mono_wasm_runtime_ready(): void { } -export function mono_wasm_fire_debugger_agent_message(): void { +export function mono_wasm_fire_debugger_agent_message_with_data(data: number, len: number): void { + const base64String = toBase64StringImpl(new Uint8Array(Module.HEAPU8.buffer, data, len)); + //keep this console.assert, otherwise optimization will remove the assignments + console.assert(true, `mono_wasm_fire_debugger_agent_message_with_data ${base64String}`); // eslint-disable-next-line no-debugger debugger; } export function mono_wasm_add_dbg_command_received(res_ok: boolean, id: number, buffer: number, buffer_len: number): void { - const assembly_data = new Uint8Array(Module.HEAPU8.buffer, buffer, buffer_len); - const base64String = toBase64StringImpl(assembly_data); + const dbg_command = new Uint8Array(Module.HEAPU8.buffer, buffer, buffer_len); + const base64String = toBase64StringImpl(dbg_command); const buffer_obj = { res_ok, res: { diff --git a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js index 74aed3030e8a8..fc126e57375cc 100644 --- a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js @@ -61,7 +61,7 @@ const linked_functions = [ // mini-wasm-debugger.c "mono_wasm_asm_loaded", - "mono_wasm_fire_debugger_agent_message", + "mono_wasm_fire_debugger_agent_message_with_data", "mono_wasm_debugger_log", "mono_wasm_add_dbg_command_received", "mono_wasm_set_entrypoint_breakpoint", diff --git a/src/mono/wasm/runtime/exports-linker.ts b/src/mono/wasm/runtime/exports-linker.ts index 89dfc822b99d8..4b64407567d5e 100644 --- a/src/mono/wasm/runtime/exports-linker.ts +++ b/src/mono/wasm/runtime/exports-linker.ts @@ -3,7 +3,7 @@ import MonoWasmThreads from "consts:monoWasmThreads"; import { dotnet_browser_can_use_subtle_crypto_impl, dotnet_browser_simple_digest_hash, dotnet_browser_sign, dotnet_browser_encrypt_decrypt, dotnet_browser_derive_bits } from "./subtle-crypto"; -import { mono_wasm_fire_debugger_agent_message, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; +import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; import { mono_wasm_release_cs_owned_object } from "./gc-handles"; import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu"; import { mono_wasm_bind_cs_function } from "./invoke-cs"; @@ -45,7 +45,7 @@ export function export_linker(): any { // mini-wasm-debugger.c mono_wasm_asm_loaded, - mono_wasm_fire_debugger_agent_message, + mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, diff --git a/src/mono/wasm/runtime/package-lock.json b/src/mono/wasm/runtime/package-lock.json index b000c395266bf..925c78061c916 100644 --- a/src/mono/wasm/runtime/package-lock.json +++ b/src/mono/wasm/runtime/package-lock.json @@ -1,2148 +1,8 @@ { "name": "@microsoft/dotnet-runtime", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "@microsoft/dotnet-runtime", - "version": "1.0.0", - "license": "MIT", - "devDependencies": { - "@rollup/plugin-typescript": "8.3.3", - "@typescript-eslint/eslint-plugin": "5.30.7", - "@typescript-eslint/parser": "5.30.7", - "eslint": "8.20.0", - "fast-glob": "3.2.11", - "rollup": "2.77.0", - "rollup-plugin-consts": "1.1.0", - "rollup-plugin-dts": "4.2.2", - "rollup-plugin-terser": "7.0.2", - "terser": "5.14.2", - "tslib": "2.4.0", - "typescript": "4.7.4" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha1-OyXTjIlgC6otzCGe36iKdOssQno=", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha1-nJfjDTGyuMcqHQiYTyyptXTXoHY=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha1-gRWGAek+JWN5Wty/vfXWS+Py7N8=", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha1-KfksMLs+dx5KIEjJX6aFU5LfrE8=", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha1-LLr5qJRg2iS1ymUxuLv8I+HfUMc=", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha1-tSBSnsIdjllFoYUd/Rwy6U45/0U=", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha1-wa7cYehT8rufXf5tRELTtWWyU7k=", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha1-IgOxGMFXchrd/mnUe3BGVGMGbXg=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha1-fGz5mNbSC5FMClWpGuko/yWWXnI=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha1-9FNRqu1FJ6KYUS7HL4EEDJmFgPs=", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha1-rdTJjTQUcqKJGQtCTvvbCWmRuyQ=", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.14", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", - "integrity": "sha1-sjGggdj2Z5bkda1Yih70cxEnAe0=", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha1-dhnC6yGyVIP20WdUi0z9WnSIw9U=", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha1-W9Jir5Tp0lvR5xsF3u1Eh2oiLos=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha1-6Vc36LtnRt3t9pxVaVNJTxlv5po=", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@rollup/plugin-typescript": { - "version": "8.3.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@rollup/plugin-typescript/-/plugin-typescript-8.3.3.tgz", - "integrity": "sha1-7uftq5z8Bk8c/RZXBJJpPPFDIhU=", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "peerDependencies": { - "rollup": "^2.14.0", - "tslib": "*", - "typescript": ">=3.7.0" - }, - "peerDependenciesMeta": { - "tslib": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s=", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha1-1CG2xSejA398hEM/0sQingFoY9M=", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "18.0.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/node/-/node-18.0.6.tgz", - "integrity": "sha1-C6SaxRetaavnoVCLybOlSD351dc=", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", - "integrity": "sha1-FiHavBrkCEMQ4Z6e/IDf27l+dJM=", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/type-utils": "5.30.7", - "@typescript-eslint/utils": "5.30.7", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/parser/-/parser-5.30.7.tgz", - "integrity": "sha1-mdCXKTkq7J5ksd5FzWPLgaTd2YA=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", - "integrity": "sha1-gmmpMe8eWuaLXrgHQ8xRXE/+Pdc=", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", - "integrity": "sha1-VpPcPbbzE/MCdkKC1hTP28ip/P0=", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/utils": "5.30.7", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/types/-/types-5.30.7.tgz", - "integrity": "sha1-GDMUh8yS0PH7Gm9YDI7IMlKAedA=", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", - "integrity": "sha1-BdqfGygZhb/tz2I0mEf40WjuzAc=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/visitor-keys": "5.30.7", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/utils/-/utils-5.30.7.tgz", - "integrity": "sha1-cTW+BwNJ6ffKomKwylnclhIzUbs=", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.30.7", - "@typescript-eslint/types": "5.30.7", - "@typescript-eslint/typescript-estree": "5.30.7", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.30.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", - "integrity": "sha1-wJOrrnW0/YIr+62fwzfzinoUkJo=", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "5.30.7", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha1-iMAYdiBDXH9gFYA/VTna4Fqdvqg=", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha1-CCyyyJyf6GWaMRpTvWpNxTAdswQ=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha1-t5hCCtvrHego2ErNii4j0+/oXo0=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=", - "dev": true, - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/braces/-/braces-3.0.2.tgz", - "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha1-KxRqb9cugLT1XSVfNe1Zo6mkG9U=", - "dev": true, - "license": "MIT" - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", - "dev": true, - "license": "MIT" - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/commander/-/commander-2.20.3.tgz", - "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", - "dev": true, - "license": "MIT" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/debug/-/debug-4.3.4.tgz", - "integrity": "sha1-Exn2V5NX8jONMzfSzdSRS7XcyGU=", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha1-pvLc5hL63S7x9Rm3NVHxfoUZmDE=", - "dev": true, - "license": "MIT" - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha1-Vtv3PZkqSpO6FYT0U0Bj/S5BcX8=", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha1-FLqDpdNz49MR5a/KKc9b+tllvzQ=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.20.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint/-/eslint-8.20.0.tgz", - "integrity": "sha1-BIrFaqGFKZZ9qDVKR4vk7AoryBs=", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha1-iuuvrOc0W7M1WdsKHxOh0tSMNnI=", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha1-9lMoJZMFknOSyTjtROsKXJsr0wM=", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha1-9kgPprHzDv4tGWiqisdFuGJGmCY=", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha1-//NIlML2XlIm0wQaxIC0UToWNkI=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/espree/-/espree-9.3.2.tgz", - "integrity": "sha1-9Y93vTNHMRgoAc7TOAqMyFkJFZY=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.7.1", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha1-IUj/w4uC6McFff7UhCWz5h8PJKU=", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha1-eteWTWeauyi+5yzsY3WLHF0smSE=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha1-MbxdYSyWtwQQa0d+bdXYqhOMtwA=", - "dev": true, - "license": "MIT" - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha1-oRcq2VzrihbiDKpcXlZIDlEpwdk=", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true, - "license": "MIT" - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha1-YWdg+Ip1Jr38WWt8q4wYk4w2uYw=", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha1-IRst2WWcsDlLBz5zI6w8kz1SICc=", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha1-YbAzgwKy/p+Vfcwy/CqH8cMEixE=", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha1-Ai6SGMY3+fP8nDWrnJGT8FrdYLI=", - "dev": true, - "license": "ISC" - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "license": "ISC" - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", - "dev": true, - "license": "MIT" - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true, - "license": "MIT" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob/-/glob-7.2.3.tgz", - "integrity": "sha1-uN8PuAK7+o6JvR2Ti04WV47UTys=", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha1-bSN9mQg5UMeSkPJMdkKj3poo+eM=", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.17.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/globals/-/globals-13.17.0.tgz", - "integrity": "sha1-kC6x5oCkHak5Ra29y1qfNhumm9Q=", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/globby/-/globby-11.1.0.tgz", - "integrity": "sha1-vUvpi7BC+D15b344EZkfvoKg00s=", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has/-/has-1.0.3.tgz", - "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha1-bTusj6f+DUXZ+b57rC/CeVd+NFo=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha1-NxYsJfy566oublPVtNiM4X2eDCs=", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", - "dev": true, - "license": "ISC" - }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha1-4cNEKc1Rxt2eCeB5njluJ7GanGk=", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha1-ZPYeQsu7LuwgcanawLKLoeZdUIQ=", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true, - "license": "ISC" - }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha1-f3LLxNZDw2Xie5/XdfnQ6qnHqO0=", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha1-wftl+PUBeQHN0slRhkuhhFihBgI=", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true, - "license": "MIT" - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/levn/-/levn-0.4.1.tgz", - "integrity": "sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha1-VYqlO0O2YeGSWgr9+japoQhf5Xo=", - "dev": true, - "license": "MIT" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/magic-string": { - "version": "0.26.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/magic-string/-/magic-string-0.26.2.tgz", - "integrity": "sha1-UzFwDkFYzWvv2nOLtrDHuTwNRDI=", - "dev": true, - "license": "MIT", - "dependencies": { - "sourcemap-codec": "^1.4.8" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=", - "dev": true, - "license": "MIT" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha1-vImZp8u/d83InxMvbkZwUbSQkMY=", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha1-Gc0ZS/0+Qo8EmnCBfAONiatL41s=", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ms/-/ms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", - "dev": true, - "license": "MIT" - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true, - "license": "MIT" - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha1-TyNqY3Pa4FZqbUPhMmZ09QwpFJk=", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU=", - "dev": true, - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha1-O6ODNzNkbZ0+SZWUbBNlpn+wekI=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha1-SSkii7xyTfrEPg77BYyve2z7YkM=", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha1-32+ENy8CcNxlzfYpE0mrekc9Tyo=", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha1-BCWido2PI7rXDKS5BGH6LxIT4bI=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha1-J8suu1P5GrtJRwqSi7p1WAZqwXc=", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rollup": { - "version": "2.77.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup/-/rollup-2.77.0.tgz", - "integrity": "sha1-dJ6qWsCba6pSrMB2vEZhPt39U/Q=", - "dev": true, - "license": "MIT", - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/rollup-plugin-consts": { - "version": "1.1.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-consts/-/rollup-plugin-consts-1.1.0.tgz", - "integrity": "sha1-EL2UBh1+LW4G0BWAaIYLo8E3W7w=", - "dev": true, - "license": "Apache-2.0", - "peerDependencies": { - "rollup": ">=1.15.0 <3" - } - }, - "node_modules/rollup-plugin-dts": { - "version": "4.2.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", - "integrity": "sha1-godrh4QhOvKbAs8mC0XkBP+DXOE=", - "dev": true, - "license": "LGPL-3.0", - "dependencies": { - "magic-string": "^0.26.1" - }, - "engines": { - "node": ">=v12.22.11" - }, - "funding": { - "url": "https://github.com/sponsors/Swatinem" - }, - "optionalDependencies": { - "@babel/code-frame": "^7.16.7" - }, - "peerDependencies": { - "rollup": "^2.55", - "typescript": "^4.1" - } - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha1-6Pu6SGmYGy3DWufopQLVxsBNMk0=", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/semver/-/semver-7.3.7.tgz", - "integrity": "sha1-EsW2Sa/b+QSXB3luIqQCiBTOUj8=", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha1-tSXhI4SJpez8Qq+sw/6Z5mb0sao=", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/slash/-/slash-3.0.0.tgz", - "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha1-BP58f54e0tZiIzwoyys1ufY/bk8=", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=", - "dev": true, - "license": "MIT" - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha1-nibGPTD1NEPpSJSVshBdN7Z6hdk=", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha1-btpL00SjyUrqN21MwxvHcxEDngk=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/terser": { - "version": "5.14.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/terser/-/terser-5.14.2.tgz", - "integrity": "sha1-msnyKwaZTXNhdPQJGqNo24lvHBA=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true, - "license": "MIT" - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha1-fOyqfwc85oCgWEeqd76UEJjzbcM=", - "dev": true, - "license": "0BSD" - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha1-tIcX05TOpsHglpg+7Vjp1hcVtiM=", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=", - "dev": true, - "license": "0BSD" - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha1-G/IH9LKPkVg2ZstfvTJ4hzAc1fQ=", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha1-GohZbRz0fVlQehvN+1ud/k1IgjU=", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha1-LeGWGMZtwkfc+2+ZM4A12CRaLO4=", - "dev": true, - "license": "MIT" - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/which/-/which-2.0.2.tgz", - "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "license": "ISC" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", - "dev": true, - "license": "ISC" - } - }, "dependencies": { "@babel/code-frame": { "version": "7.18.6", @@ -2481,8 +341,7 @@ "version": "5.3.2", "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=", - "dev": true, - "requires": {} + "dev": true }, "ajv": { "version": "6.12.6", @@ -3304,8 +1163,7 @@ "version": "1.1.0", "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-consts/-/rollup-plugin-consts-1.1.0.tgz", "integrity": "sha1-EL2UBh1+LW4G0BWAaIYLo8E3W7w=", - "dev": true, - "requires": {} + "dev": true }, "rollup-plugin-dts": { "version": "4.2.2", diff --git a/src/mono/wasm/runtime/rollup.config.js b/src/mono/wasm/runtime/rollup.config.js index d445f52f34b7e..6ab7aa6bbb9eb 100644 --- a/src/mono/wasm/runtime/rollup.config.js +++ b/src/mono/wasm/runtime/rollup.config.js @@ -40,7 +40,7 @@ const terserConfig = { mangle: { // because of stack walk at src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs // and unit test at src\libraries\System.Private.Runtime.InteropServices.JavaScript\tests\timers.js - keep_fnames: /(mono_wasm_runtime_ready|mono_wasm_fire_debugger_agent_message|mono_wasm_set_timeout_exec)/, + keep_fnames: /(mono_wasm_runtime_ready|mono_wasm_fire_debugger_agent_message_with_data|mono_wasm_set_timeout_exec)/, keep_classnames: /(ManagedObject|ManagedError|Span|ArraySegment|WasmRootBuffer|SessionOptionsBuilder)/, }, }; From d84c33b8e75212da3ea8ad36d03ca357607f2afb Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 30 Aug 2022 13:11:40 -0300 Subject: [PATCH 02/46] Revert package-lock.json --- src/mono/wasm/runtime/package-lock.json | 2150 ++++++++++++++++++++++- 1 file changed, 2146 insertions(+), 4 deletions(-) diff --git a/src/mono/wasm/runtime/package-lock.json b/src/mono/wasm/runtime/package-lock.json index 925c78061c916..7ad1dfede5690 100644 --- a/src/mono/wasm/runtime/package-lock.json +++ b/src/mono/wasm/runtime/package-lock.json @@ -1,8 +1,2148 @@ { "name": "@microsoft/dotnet-runtime", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "@microsoft/dotnet-runtime", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@rollup/plugin-typescript": "8.3.3", + "@typescript-eslint/eslint-plugin": "5.30.7", + "@typescript-eslint/parser": "5.30.7", + "eslint": "8.20.0", + "fast-glob": "3.2.11", + "rollup": "2.77.0", + "rollup-plugin-consts": "1.1.0", + "rollup-plugin-dts": "4.2.2", + "rollup-plugin-terser": "7.0.2", + "terser": "5.14.2", + "tslib": "2.4.0", + "typescript": "4.7.4" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.18.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha1-OyXTjIlgC6otzCGe36iKdOssQno=", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.18.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", + "integrity": "sha1-nJfjDTGyuMcqHQiYTyyptXTXoHY=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha1-gRWGAek+JWN5Wty/vfXWS+Py7N8=", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha1-KfksMLs+dx5KIEjJX6aFU5LfrE8=", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha1-LLr5qJRg2iS1ymUxuLv8I+HfUMc=", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha1-tSBSnsIdjllFoYUd/Rwy6U45/0U=", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha1-wa7cYehT8rufXf5tRELTtWWyU7k=", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha1-IgOxGMFXchrd/mnUe3BGVGMGbXg=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha1-fGz5mNbSC5FMClWpGuko/yWWXnI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha1-9FNRqu1FJ6KYUS7HL4EEDJmFgPs=", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha1-rdTJjTQUcqKJGQtCTvvbCWmRuyQ=", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha1-sjGggdj2Z5bkda1Yih70cxEnAe0=", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha1-dhnC6yGyVIP20WdUi0z9WnSIw9U=", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha1-W9Jir5Tp0lvR5xsF3u1Eh2oiLos=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha1-6Vc36LtnRt3t9pxVaVNJTxlv5po=", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "8.3.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@rollup/plugin-typescript/-/plugin-typescript-8.3.3.tgz", + "integrity": "sha1-7uftq5z8Bk8c/RZXBJJpPPFDIhU=", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s=", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha1-1CG2xSejA398hEM/0sQingFoY9M=", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "18.0.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/node/-/node-18.0.6.tgz", + "integrity": "sha1-C6SaxRetaavnoVCLybOlSD351dc=", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", + "integrity": "sha1-FiHavBrkCEMQ4Z6e/IDf27l+dJM=", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "5.30.7", + "@typescript-eslint/type-utils": "5.30.7", + "@typescript-eslint/utils": "5.30.7", + "debug": "^4.3.4", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/parser/-/parser-5.30.7.tgz", + "integrity": "sha1-mdCXKTkq7J5ksd5FzWPLgaTd2YA=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "5.30.7", + "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/typescript-estree": "5.30.7", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", + "integrity": "sha1-gmmpMe8eWuaLXrgHQ8xRXE/+Pdc=", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/visitor-keys": "5.30.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", + "integrity": "sha1-VpPcPbbzE/MCdkKC1hTP28ip/P0=", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "5.30.7", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/types/-/types-5.30.7.tgz", + "integrity": "sha1-GDMUh8yS0PH7Gm9YDI7IMlKAedA=", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", + "integrity": "sha1-BdqfGygZhb/tz2I0mEf40WjuzAc=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/visitor-keys": "5.30.7", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/utils/-/utils-5.30.7.tgz", + "integrity": "sha1-cTW+BwNJ6ffKomKwylnclhIzUbs=", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.7", + "@typescript-eslint/types": "5.30.7", + "@typescript-eslint/typescript-estree": "5.30.7", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.30.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", + "integrity": "sha1-wJOrrnW0/YIr+62fwzfzinoUkJo=", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.30.7", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/acorn": { + "version": "8.8.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha1-iMAYdiBDXH9gFYA/VTna4Fqdvqg=", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha1-CCyyyJyf6GWaMRpTvWpNxTAdswQ=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha1-t5hCCtvrHego2ErNii4j0+/oXo0=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/braces/-/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha1-KxRqb9cugLT1XSVfNe1Zo6mkG9U=", + "dev": true, + "license": "MIT" + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/commander/-/commander-2.20.3.tgz", + "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/debug/-/debug-4.3.4.tgz", + "integrity": "sha1-Exn2V5NX8jONMzfSzdSRS7XcyGU=", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha1-pvLc5hL63S7x9Rm3NVHxfoUZmDE=", + "dev": true, + "license": "MIT" + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha1-Vtv3PZkqSpO6FYT0U0Bj/S5BcX8=", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha1-FLqDpdNz49MR5a/KKc9b+tllvzQ=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.20.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint/-/eslint-8.20.0.tgz", + "integrity": "sha1-BIrFaqGFKZZ9qDVKR4vk7AoryBs=", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha1-iuuvrOc0W7M1WdsKHxOh0tSMNnI=", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha1-9lMoJZMFknOSyTjtROsKXJsr0wM=", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha1-9kgPprHzDv4tGWiqisdFuGJGmCY=", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha1-//NIlML2XlIm0wQaxIC0UToWNkI=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/espree": { + "version": "9.3.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/espree/-/espree-9.3.2.tgz", + "integrity": "sha1-9Y93vTNHMRgoAc7TOAqMyFkJFZY=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha1-IUj/w4uC6McFff7UhCWz5h8PJKU=", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha1-eteWTWeauyi+5yzsY3WLHF0smSE=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha1-LupSkHAvJquP5TcDcP+GyWXSESM=", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha1-MbxdYSyWtwQQa0d+bdXYqhOMtwA=", + "dev": true, + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.2.11", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha1-oRcq2VzrihbiDKpcXlZIDlEpwdk=", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha1-YWdg+Ip1Jr38WWt8q4wYk4w2uYw=", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha1-IRst2WWcsDlLBz5zI6w8kz1SICc=", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha1-YbAzgwKy/p+Vfcwy/CqH8cMEixE=", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha1-Ai6SGMY3+fP8nDWrnJGT8FrdYLI=", + "dev": true, + "license": "ISC" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=", + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", + "dev": true, + "license": "MIT" + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob/-/glob-7.2.3.tgz", + "integrity": "sha1-uN8PuAK7+o6JvR2Ti04WV47UTys=", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha1-bSN9mQg5UMeSkPJMdkKj3poo+eM=", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.17.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/globals/-/globals-13.17.0.tgz", + "integrity": "sha1-kC6x5oCkHak5Ra29y1qfNhumm9Q=", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/globby/-/globby-11.1.0.tgz", + "integrity": "sha1-vUvpi7BC+D15b344EZkfvoKg00s=", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has/-/has-1.0.3.tgz", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha1-bTusj6f+DUXZ+b57rC/CeVd+NFo=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha1-NxYsJfy566oublPVtNiM4X2eDCs=", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", + "dev": true, + "license": "ISC" + }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha1-4cNEKc1Rxt2eCeB5njluJ7GanGk=", + "dev": true, + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha1-ZPYeQsu7LuwgcanawLKLoeZdUIQ=", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "license": "ISC" + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha1-f3LLxNZDw2Xie5/XdfnQ6qnHqO0=", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha1-wftl+PUBeQHN0slRhkuhhFihBgI=", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true, + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/levn/-/levn-0.4.1.tgz", + "integrity": "sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha1-VYqlO0O2YeGSWgr9+japoQhf5Xo=", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/magic-string": { + "version": "0.26.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/magic-string/-/magic-string-0.26.2.tgz", + "integrity": "sha1-UzFwDkFYzWvv2nOLtrDHuTwNRDI=", + "dev": true, + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha1-vImZp8u/d83InxMvbkZwUbSQkMY=", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha1-Gc0ZS/0+Qo8EmnCBfAONiatL41s=", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/ms/-/ms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true, + "license": "MIT" + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha1-TyNqY3Pa4FZqbUPhMmZ09QwpFJk=", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU=", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha1-O6ODNzNkbZ0+SZWUbBNlpn+wekI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha1-SSkii7xyTfrEPg77BYyve2z7YkM=", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha1-32+ENy8CcNxlzfYpE0mrekc9Tyo=", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha1-BCWido2PI7rXDKS5BGH6LxIT4bI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha1-J8suu1P5GrtJRwqSi7p1WAZqwXc=", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "2.77.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup/-/rollup-2.77.0.tgz", + "integrity": "sha1-dJ6qWsCba6pSrMB2vEZhPt39U/Q=", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-consts": { + "version": "1.1.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-consts/-/rollup-plugin-consts-1.1.0.tgz", + "integrity": "sha1-EL2UBh1+LW4G0BWAaIYLo8E3W7w=", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "rollup": ">=1.15.0 <3" + } + }, + "node_modules/rollup-plugin-dts": { + "version": "4.2.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", + "integrity": "sha1-godrh4QhOvKbAs8mC0XkBP+DXOE=", + "dev": true, + "license": "LGPL-3.0", + "dependencies": { + "magic-string": "^0.26.1" + }, + "engines": { + "node": ">=v12.22.11" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.16.7" + }, + "peerDependencies": { + "rollup": "^2.55", + "typescript": "^4.1" + } + }, + "node_modules/rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha1-6Pu6SGmYGy3DWufopQLVxsBNMk0=", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.3.7", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/semver/-/semver-7.3.7.tgz", + "integrity": "sha1-EsW2Sa/b+QSXB3luIqQCiBTOUj8=", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha1-tSXhI4SJpez8Qq+sw/6Z5mb0sao=", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/slash/-/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha1-BP58f54e0tZiIzwoyys1ufY/bk8=", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha1-nibGPTD1NEPpSJSVshBdN7Z6hdk=", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha1-btpL00SjyUrqN21MwxvHcxEDngk=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/terser": { + "version": "5.14.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/terser/-/terser-5.14.2.tgz", + "integrity": "sha1-msnyKwaZTXNhdPQJGqNo24lvHBA=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha1-fOyqfwc85oCgWEeqd76UEJjzbcM=", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha1-tIcX05TOpsHglpg+7Vjp1hcVtiM=", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha1-G/IH9LKPkVg2ZstfvTJ4hzAc1fQ=", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.7.4", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha1-GohZbRz0fVlQehvN+1ud/k1IgjU=", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha1-LeGWGMZtwkfc+2+ZM4A12CRaLO4=", + "dev": true, + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/which/-/which-2.0.2.tgz", + "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", + "dev": true, + "license": "ISC" + } + }, "dependencies": { "@babel/code-frame": { "version": "7.18.6", @@ -341,7 +2481,8 @@ "version": "5.3.2", "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=", - "dev": true + "dev": true, + "requires": {} }, "ajv": { "version": "6.12.6", @@ -1163,7 +3304,8 @@ "version": "1.1.0", "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/rollup-plugin-consts/-/rollup-plugin-consts-1.1.0.tgz", "integrity": "sha1-EL2UBh1+LW4G0BWAaIYLo8E3W7w=", - "dev": true + "dev": true, + "requires": {} }, "rollup-plugin-dts": { "version": "4.2.2", @@ -1407,4 +3549,4 @@ "dev": true } } -} +} \ No newline at end of file From 6c1925adafb460af88980910ec9b4af2ea16e20f Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 30 Aug 2022 13:12:52 -0300 Subject: [PATCH 03/46] New line at package-lock.json --- src/mono/wasm/runtime/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/runtime/package-lock.json b/src/mono/wasm/runtime/package-lock.json index 7ad1dfede5690..b000c395266bf 100644 --- a/src/mono/wasm/runtime/package-lock.json +++ b/src/mono/wasm/runtime/package-lock.json @@ -3549,4 +3549,4 @@ "dev": true } } -} \ No newline at end of file +} From fb7f67e6341164f4b575dca6706fc18bc2c1b714 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 30 Aug 2022 13:33:40 -0300 Subject: [PATCH 04/46] Fix not used variable. --- src/mono/mono/component/debugger-agent.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index e366ec7ba1561..36f267d96190b 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -323,9 +323,6 @@ typedef struct { /* * Globals */ -#ifdef TARGET_WASM -static DebuggerTlsData debugger_wasm_thread; -#endif static AgentConfig agent_config; /* From 215bca6e188c849db8206286121b1cede987ee34 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 30 Aug 2022 17:59:47 -0300 Subject: [PATCH 05/46] Fix debugger on firefox. --- .../Firefox/FirefoxMonoProxy.cs | 18 ++++++++++++++---- .../debugger/BrowserDebugProxy/MonoProxy.cs | 18 +++++++++++------- src/mono/wasm/runtime/debug.ts | 8 ++++++-- src/mono/wasm/runtime/rollup.config.js | 2 +- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs index 7f0e233237e82..adf0df1fff37a 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs @@ -271,11 +271,11 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject arg var topFunc = args["frame"]["displayName"].Value(); switch (topFunc) { - case "mono_wasm_fire_debugger_agent_message_with_data": - case "_mono_wasm_fire_debugger_agent_message_with_data": + case "mono_wasm_fire_debugger_agent_message_with_data_to_pause": + case "_mono_wasm_fire_debugger_agent_message_with_data_to_pause": { ctx.PausedOnWasm = true; - return await OnReceiveDebuggerAgentEvent(sessionId, args, token); + return await OnReceiveDebuggerAgentEvent(sessionId, args, GetLastDebuggerAgentBuffer(args), token); } default: ctx.PausedOnWasm = false; @@ -702,6 +702,16 @@ internal override void SaveLastDebuggerAgentBufferReceivedToContext(SessionId se var context = GetContextFixefox(sessionId); context.LastDebuggerAgentBufferReceived = res; } + internal static Result GetLastDebuggerAgentBuffer(JObject args) + { + var result = new JArray(); + result.Add(JObject.FromObject(new { value = new {value = args?["frame"]?["arguments"]?[0].Value()}})); + Result res = Result.OkFromObject(new + { + result + }); + return res; + } private async Task SendPauseToBrowser(SessionId sessionId, JObject args, CancellationToken token) { @@ -710,7 +720,7 @@ private async Task SendPauseToBrowser(SessionId sessionId, JObject args, C if (!res.IsOk) return false; - byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); + byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?[0]?["value"]?["value"]?.Value()); using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadBytes(11); retDebuggerCmdReader.ReadByte(); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 36cb3dc55e709..0b942a24e8850 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -199,11 +199,11 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par await SendResume(sessionId, token); return true; } - case "mono_wasm_fire_debugger_agent_message_with_data": - case "_mono_wasm_fire_debugger_agent_message_with_data": + case "mono_wasm_fire_debugger_agent_message_with_data_to_pause": + case "_mono_wasm_fire_debugger_agent_message_with_data_to_pause": try { - return await OnReceiveDebuggerAgentEvent(sessionId, args, token); + return await OnReceiveDebuggerAgentEvent(sessionId, args, await GetLastDebuggerAgentBuffer(sessionId, args, token), token); } catch (Exception) //if the page is refreshed maybe it stops here. { @@ -1056,20 +1056,24 @@ internal virtual void SaveLastDebuggerAgentBufferReceivedToContext(SessionId ses { } - internal async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, CancellationToken token) + internal async Task GetLastDebuggerAgentBuffer(SessionId sessionId, JObject args, CancellationToken token) { var argsNew = JObject.FromObject(new { objectId = args?["callFrames"]?[0]?["scopeChain"]?[0]?["object"]?["objectId"]?.Value(), }); Result res = await SendCommand(sessionId, "Runtime.getProperties", argsNew, token); + return res; + } - SaveLastDebuggerAgentBufferReceivedToContext(sessionId, res); - if (!res.IsOk) + internal async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, Result debuggerAgentBuffer, CancellationToken token) + { + SaveLastDebuggerAgentBufferReceivedToContext(sessionId, debuggerAgentBuffer); + if (!debuggerAgentBuffer.IsOk) return false; ExecutionContext context = GetContext(sessionId); - byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?[2]?["value"]?["value"]?.Value()); + byte[] newBytes = Convert.FromBase64String(debuggerAgentBuffer.Value?["result"]?[0]?["value"]?["value"]?.Value()); using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadBytes(11); //skip HEADER_LEN retDebuggerCmdReader.ReadByte(); //suspend_policy diff --git a/src/mono/wasm/runtime/debug.ts b/src/mono/wasm/runtime/debug.ts index 29eb60e32a99e..cc611f64a6428 100644 --- a/src/mono/wasm/runtime/debug.ts +++ b/src/mono/wasm/runtime/debug.ts @@ -32,14 +32,18 @@ export function mono_wasm_runtime_ready(): void { } -export function mono_wasm_fire_debugger_agent_message_with_data(data: number, len: number): void { - const base64String = toBase64StringImpl(new Uint8Array(Module.HEAPU8.buffer, data, len)); +export function mono_wasm_fire_debugger_agent_message_with_data_to_pause(base64String: string): void { //keep this console.assert, otherwise optimization will remove the assignments console.assert(true, `mono_wasm_fire_debugger_agent_message_with_data ${base64String}`); // eslint-disable-next-line no-debugger debugger; } +export function mono_wasm_fire_debugger_agent_message_with_data(data: number, len: number): void { + const base64String = toBase64StringImpl(new Uint8Array(Module.HEAPU8.buffer, data, len)); + mono_wasm_fire_debugger_agent_message_with_data_to_pause(base64String); +} + export function mono_wasm_add_dbg_command_received(res_ok: boolean, id: number, buffer: number, buffer_len: number): void { const dbg_command = new Uint8Array(Module.HEAPU8.buffer, buffer, buffer_len); const base64String = toBase64StringImpl(dbg_command); diff --git a/src/mono/wasm/runtime/rollup.config.js b/src/mono/wasm/runtime/rollup.config.js index 6ab7aa6bbb9eb..e8f32d3e170f0 100644 --- a/src/mono/wasm/runtime/rollup.config.js +++ b/src/mono/wasm/runtime/rollup.config.js @@ -40,7 +40,7 @@ const terserConfig = { mangle: { // because of stack walk at src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs // and unit test at src\libraries\System.Private.Runtime.InteropServices.JavaScript\tests\timers.js - keep_fnames: /(mono_wasm_runtime_ready|mono_wasm_fire_debugger_agent_message_with_data|mono_wasm_set_timeout_exec)/, + keep_fnames: /(mono_wasm_runtime_ready|mono_wasm_fire_debugger_agent_message_with_data_to_pause|mono_wasm_set_timeout_exec)/, keep_classnames: /(ManagedObject|ManagedError|Span|ArraySegment|WasmRootBuffer|SessionOptionsBuilder)/, }, }; From b028deb3a13c18655b01891e1dd234363fe142fb Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 1 Sep 2022 13:29:42 -0300 Subject: [PATCH 06/46] Rewrite code to avoid duplicated code. --- src/mono/mono/component/debugger-agent.c | 64 +++++++++---------- .../debugger/BrowserDebugProxy/MonoProxy.cs | 18 ++++-- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 36f267d96190b..c1c5a16ad8aaf 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -505,6 +505,8 @@ static void process_profiler_event (EventKind event, gpointer arg); static void invalidate_frames (DebuggerTlsData *tls); +static void mono_init_debugger_agent_common (MonoProfilerHandle *prof); + /* Callbacks used by debugger-engine */ static MonoContext* tls_get_restore_state (void *the_tls); static gboolean try_process_suspend (void *tls, MonoContext *ctx, gboolean from_breakpoint); @@ -791,26 +793,12 @@ mono_debugger_agent_init_internal (void) mono_profiler_set_domain_loaded_callback (prof, appdomain_load); mono_profiler_set_domain_unloading_callback (prof, appdomain_start_unload); mono_profiler_set_domain_unloaded_callback (prof, appdomain_unload); - mono_profiler_set_thread_started_callback (prof, thread_startup); - mono_profiler_set_thread_stopped_callback (prof, thread_end); mono_profiler_set_assembly_loaded_callback (prof, assembly_load); mono_profiler_set_assembly_unloading_callback (prof, assembly_unload); - mono_profiler_set_jit_done_callback (prof, jit_done); mono_profiler_set_jit_failed_callback (prof, jit_failed); mono_profiler_set_gc_finalizing_callback (prof, gc_finalizing); mono_profiler_set_gc_finalized_callback (prof, gc_finalized); - mono_native_tls_alloc (&debugger_tls_id, NULL); - - /* Needed by the hash_table_new_type () call below */ - mono_gc_base_init (); - - thread_to_tls = mono_g_hash_table_new_type_internal ((GHashFunc)mono_object_hash_internal, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger TLS Table"); - - tid_to_thread = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Table"); - - tid_to_thread_obj = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Object Table"); - pending_assembly_loads = g_ptr_array_new (); log_level = agent_config.log_level; @@ -829,7 +817,6 @@ mono_debugger_agent_init_internal (void) } mono_de_set_log_level (log_level, log_file); - ids_init (); objrefs_init (); suspend_init (); @@ -837,7 +824,9 @@ mono_debugger_agent_init_internal (void) if (agent_config.setpgid) setpgid (0, 0); #endif - + + mono_init_debugger_agent_common (&prof); + if (!agent_config.onuncaught && !agent_config.onthrow) finish_agent_init (TRUE); } @@ -1613,6 +1602,31 @@ static GHashTable *obj_to_objref; /* Protected by the dbg lock */ static MonoGHashTable *suspended_objs; +static void +mono_init_debugger_agent_common (MonoProfilerHandle *prof) +{ + ids_init (); + + event_requests = g_ptr_array_new (); + + pending_assembly_loads = g_ptr_array_new (); + + mono_profiler_set_thread_started_callback (*prof, thread_startup); + mono_profiler_set_thread_stopped_callback (*prof, thread_end); + mono_profiler_set_jit_done_callback (*prof, jit_done); + + mono_native_tls_alloc (&debugger_tls_id, NULL); + + /* Needed by the hash_table_new_type () call below */ + mono_gc_base_init (); + + thread_to_tls = mono_g_hash_table_new_type_internal ((GHashFunc)mono_object_hash_internal, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger TLS Table"); + + tid_to_thread = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Table"); + + tid_to_thread_obj = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Object Table"); +} + #ifdef TARGET_WASM void mono_init_debugger_agent_for_wasm (int log_level_parm, MonoProfilerHandle *prof) @@ -1623,31 +1637,17 @@ mono_init_debugger_agent_for_wasm (int log_level_parm, MonoProfilerHandle *prof) int ntransports = 0; DebuggerTransport *transports = mono_debugger_agent_get_transports (&ntransports); - ids_init(); objrefs = g_hash_table_new_full (NULL, NULL, NULL, mono_debugger_free_objref); obj_to_objref = g_hash_table_new (NULL, NULL); - pending_assembly_loads = g_ptr_array_new (); log_level = log_level_parm; - event_requests = g_ptr_array_new (); + vm_start_event_sent = TRUE; transport = &transports [0]; agent_config.enabled = TRUE; - mono_native_tls_alloc (&debugger_tls_id, NULL); - - mono_profiler_set_thread_started_callback (*prof, thread_startup); - mono_profiler_set_thread_stopped_callback (*prof, thread_end); - mono_profiler_set_jit_done_callback (*prof, jit_done); - - mono_gc_base_init (); - - thread_to_tls = mono_g_hash_table_new_type_internal ((GHashFunc)mono_object_hash_internal, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger TLS Table"); - - tid_to_thread = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Table"); - - tid_to_thread_obj = mono_g_hash_table_new_type_internal (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Object Table"); + mono_init_debugger_agent_common (prof); } void diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 0b942a24e8850..a34140f5cc954 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -174,12 +174,7 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par // Don't process events from sessions we aren't tracking unless they have asyncStackTraceId if (!contexts.ContainsKey(sessionId) && args["asyncStackTraceId"] != null) { - contexts[sessionId] = contexts.First().Value.Clone(sessionId); - var store = await LoadStore(sessionId, true, token); - foreach (var source in store.AllSources()) - { - await OnSourceFileAdded(sessionId, source, contexts[sessionId], true, token); - } + await CreateAsyncExecutionContext(sessionId, token); } //TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack @@ -251,6 +246,17 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par return false; } + + protected async Task CreateAsyncExecutionContext(SessionId sessionId, CancellationToken token) + { + contexts[sessionId] = contexts.First().Value.Clone(sessionId); + var store = await LoadStore(sessionId, true, token); + foreach (var source in store.AllSources()) + { + await OnSourceFileAdded(sessionId, source, contexts[sessionId], true, token); + } + } + protected virtual async Task SendResume(SessionId id, CancellationToken token) { await SendCommand(id, "Debugger.resume", new JObject(), token); From 037c9f297b14cae79e64dcf75d83695fc21a43e0 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 1 Sep 2022 13:42:16 -0300 Subject: [PATCH 07/46] Fix where mono_init_debugger_agent_common is called. --- src/mono/mono/component/debugger-agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index c1c5a16ad8aaf..76788083e8666 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -799,6 +799,8 @@ mono_debugger_agent_init_internal (void) mono_profiler_set_gc_finalizing_callback (prof, gc_finalizing); mono_profiler_set_gc_finalized_callback (prof, gc_finalized); + mono_init_debugger_agent_common (&prof); + pending_assembly_loads = g_ptr_array_new (); log_level = agent_config.log_level; @@ -825,8 +827,6 @@ mono_debugger_agent_init_internal (void) setpgid (0, 0); #endif - mono_init_debugger_agent_common (&prof); - if (!agent_config.onuncaught && !agent_config.onthrow) finish_agent_init (TRUE); } From df269ddfe7e35b293fb288ca449ed0b989bc0ad5 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 1 Sep 2022 13:52:24 -0300 Subject: [PATCH 08/46] Remove whitespace. --- src/mono/mono/component/debugger-agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 76788083e8666..e2a810f58a958 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -800,7 +800,7 @@ mono_debugger_agent_init_internal (void) mono_profiler_set_gc_finalized_callback (prof, gc_finalized); mono_init_debugger_agent_common (&prof); - + pending_assembly_loads = g_ptr_array_new (); log_level = agent_config.log_level; @@ -826,7 +826,7 @@ mono_debugger_agent_init_internal (void) if (agent_config.setpgid) setpgid (0, 0); #endif - + if (!agent_config.onuncaught && !agent_config.onthrow) finish_agent_init (TRUE); } From d11eaf8379114c94b3b1b3fe96745ea29e68723c Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 10 Oct 2022 15:53:32 -0300 Subject: [PATCH 09/46] Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs Co-authored-by: Ankit Jain --- .../debugger/BrowserDebugProxy/MonoSDBHelper.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs index ff9555900d2cf..e9f2427548130 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs @@ -807,14 +807,14 @@ public MonoSDBHelper(MonoProxy proxy, ILogger logger, SessionId sessionId) ValueCreator = new(this, logger); ResetStore(null); } + public MonoSDBHelper Clone(SessionId sessionId) - { - var ret = new MonoSDBHelper(this.proxy, this.logger, sessionId); - ret.VmMajorVersion = this.VmMajorVersion; - ret.VmMinorVersion = this.VmMinorVersion; - ret.store = this.store; - return ret; - } + => new MonoSDBHelper(proxy, logger, sessionId) + { + VmMajorVersion = VmMajorVersion, + VmMinorVersion = VmMinorVersion, + store = store, + }; public void ResetStore(DebugStore store) { From ac4fdec1b915e338466d9f55511ab1600035f434 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 10 Oct 2022 15:53:40 -0300 Subject: [PATCH 10/46] Update src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs Co-authored-by: Ankit Jain --- .../debugger/BrowserDebugProxy/DevToolsHelper.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index af33ea86cda4e..688ce8b2170e8 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -409,13 +409,12 @@ public ExecutionContext(MonoSDBHelper sdbAgent, int id, object auxData, PauseOnE PauseOnExceptions = pauseOnExceptions; } public ExecutionContext Clone(SessionId sessionId) - { - var ret = new ExecutionContext(SdbAgent.Clone(sessionId), Id, AuxData, PauseOnExceptions); - ret.ready = ready; - ret.store = store; - ret.Source = Source; - return ret; - } + => new ExecutionContext(SdbAgent.Clone(sessionId), Id, AuxData, PauseOnExceptions) + { + ready = ready, + store = store, + Source = Source + }; public string DebugId { get; set; } public Dictionary BreakpointRequests { get; } = new Dictionary(); public int breakpointId; From 3fdcc8def779f7cd376c1e0b63f58b645952356b Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 11 Oct 2022 10:50:45 -0300 Subject: [PATCH 11/46] Update src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs Co-authored-by: Ankit Jain --- src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index 688ce8b2170e8..ee7eea8a51720 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -439,7 +439,7 @@ public ExecutionContext Clone(SessionId sessionId) public string[] LoadedFiles { get; set; } internal DebugStore store; internal MonoSDBHelper SdbAgent { get; init; } - public TaskCompletionSource Source { get; set; } = new TaskCompletionSource(); + public TaskCompletionSource Source { get; private set; } = new TaskCompletionSource(); private Dictionary perScopeCaches { get; } = new Dictionary(); From a9bd192d9f4910dacbe9293fce9d9ae39b079f12 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:27:44 +0000 Subject: [PATCH 12/46] [wasm] Debugger tests: support running with multithreaded runtime --- .../DebuggerTestSuite/TestHarnessOptions.cs | 2 ++ .../DebuggerTestSuite/TestHarnessProxy.cs | 26 ++++++++++++++----- .../DebuggerTestSuite/TestHarnessStartup.cs | 19 +++++++++++--- src/mono/wasm/host/WebServerStartup.cs | 1 - 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessOptions.cs b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessOptions.cs index c3b9bc6c58880..c22f0563747e7 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessOptions.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessOptions.cs @@ -14,6 +14,8 @@ public class TestHarnessOptions : ProxyOptions public string PagePath { get; set; } public string NodeApp { get; set; } public string BrowserParms { get; set; } + public bool WebServerUseCors { get; set; } + public bool WebServerUseCrossOriginPolicy { get; set; } public Func, Task> ExtractConnUrl { get; set; } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs index 5124e349980fc..21cfe68664a5b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Microsoft.WebAssembly.Diagnostics; using Xunit.Abstractions; @@ -36,6 +37,15 @@ public class TestHarnessProxy public static Task Start(string appPath, string pagePath, string url, ITestOutputHelper testOutput) { + TestHarnessOptions options = new() + { + AppPath = appPath, + PagePath = pagePath, + DevToolsUrl = new Uri(url), + WebServerUseCors = false, + WebServerUseCrossOriginPolicy = true + }; + lock (proxyLock) { if (hostTask != null) @@ -76,13 +86,17 @@ public static Task Start(string appPath, string pagePath, string url, ITestOutpu }) .ConfigureServices((ctx, services) => { - services.Configure(ctx.Configuration); - services.Configure(options => + if (options.WebServerUseCors) { - options.AppPath = appPath; - options.PagePath = pagePath; - options.DevToolsUrl = new Uri(url); - }); + services.AddCors(o => o.AddPolicy("AnyCors", builder => + { + builder.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader() + .WithExposedHeaders("*"); + })); + } + services.AddSingleton(Options.Create(options)); }) .UseStartup() .UseUrls(Endpoint.ToString()) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs index e71411cfb8cb2..603c100b43e4b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs @@ -75,16 +75,15 @@ async Task SendNodeList(HttpContext context) } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IOptionsMonitor optionsAccessor, IWebHostEnvironment env, ILogger logger, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IOptions optionsContainer, IWebHostEnvironment env, ILogger logger, ILoggerFactory loggerFactory) { this.Logger = logger; this._loggerFactory = loggerFactory; + TestHarnessOptions options = optionsContainer.Value; app.UseWebSockets(); app.UseStaticFiles(); - TestHarnessOptions options = optionsAccessor.CurrentValue; - var provider = new FileExtensionContentTypeProvider(); provider.Mappings[".wasm"] = "application/wasm"; @@ -93,9 +92,21 @@ public void Configure(IApplicationBuilder app, IOptionsMonitor { + if (options.WebServerUseCrossOriginPolicy) + { + context.Context.Response.Headers.Add("Cross-Origin-Embedder-Policy", "require-corp"); + context.Context.Response.Headers.Add("Cross-Origin-Opener-Policy", "same-origin"); + } + } }); + if (options.WebServerUseCors) + { + app.UseCors("AnyCors"); + } + app.UseRouter(router => { router.MapGet("launch-host-and-connect", async context => diff --git a/src/mono/wasm/host/WebServerStartup.cs b/src/mono/wasm/host/WebServerStartup.cs index 4025bf928441c..0f26dc09479ab 100644 --- a/src/mono/wasm/host/WebServerStartup.cs +++ b/src/mono/wasm/host/WebServerStartup.cs @@ -167,7 +167,6 @@ public void Configure(IApplicationBuilder app, }); }); - applicationLifetime.ApplicationStarted.Register(() => { TaskCompletionSource tcs = realUrlsAvailableTcs; From ec9b436950725cdae28a6cb7cda0a523784cdcb9 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:30:20 +0000 Subject: [PATCH 13/46] Add runtime-wasm-dbgtests pipeline with debugger tests running on a multi-threaded runtime --- .../common/templates/wasm-debugger-tests.yml | 7 +++- eng/pipelines/runtime-wasm-dbgtests.yml | 41 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 eng/pipelines/runtime-wasm-dbgtests.yml diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml index 94fd9e024e695..1c0c6f80793d2 100644 --- a/eng/pipelines/common/templates/wasm-debugger-tests.yml +++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml @@ -4,6 +4,8 @@ parameters: isWasmOnlyBuild: false browser: 'chrome' shouldContinueOnError: false + extraBuildArgs: '' + nameSuffix: '' platforms: [] jobs: @@ -30,7 +32,10 @@ jobs: jobParameters: testGroup: innerloop isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} - nameSuffix: Mono_DebuggerTests_${{ parameters.browser }} + ${{ if eq(nameSuffix, '') }}: + nameSuffix: Mono_DebuggerTests_${{ parameters.browser }} + ${{ else }}: + nameSuffix: ${{ parameters.nameSuffix }} buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }} timeoutInMinutes: 180 # if !alwaysRun, then: diff --git a/eng/pipelines/runtime-wasm-dbgtests.yml b/eng/pipelines/runtime-wasm-dbgtests.yml new file mode 100644 index 0000000000000..ad6ec7ca566a8 --- /dev/null +++ b/eng/pipelines/runtime-wasm-dbgtests.yml @@ -0,0 +1,41 @@ +trigger: none + +variables: + - template: /eng/pipelines/common/variables.yml + +jobs: + +# +# Evaluate paths +# +- template: /eng/pipelines/common/evaluate-default-paths.yml + +# Debugger tests +- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml + parameters: + platforms: + - Browser_wasm + - Browser_wasm_win + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + +- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml + parameters: + platforms: + - Browser_wasm + - Browser_wasm_win + extraBuildArgs: /p:WasmEnableThreads=true + nameSuffix: DebuggerTests_MultiThreaded + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + +- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml + parameters: + platforms: + - Browser_wasm_firefox + browser: firefox + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + alwaysRun: ${{ parameters.isWasmOnlyBuild }} + # ff tests are unstable currently + shouldContinueOnError: true From c5808dd7b46c61de85151683eb5bb28d1baf8f61 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:34:21 +0000 Subject: [PATCH 14/46] Add multi-threaded debugger tests to runtime-wasm --- .../extra-platforms/runtime-extra-platforms-wasm.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 5f28824c09a29..52c97ab226019 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -213,6 +213,16 @@ jobs: # ff tests are unstable currently shouldContinueOnError: true + - template: /eng/pipelines/common/templates/wasm-debugger-tests.yml + parameters: + platforms: + - Browser_wasm + - Browser_wasm_win + extraBuildArgs: /p:WasmEnableThreads=true + nameSuffix: DebuggerTests_MultiThreaded + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + # Disable for now #- template: /eng/pipelines/coreclr/perf-wasm-jobs.yml #parameters: From ba0c29c77a788f9b95df95fcc18ea96945dc2e7d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:39:03 +0000 Subject: [PATCH 15/46] fix yml --- eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml index 1c0c6f80793d2..5bc1b11dce604 100644 --- a/eng/pipelines/common/templates/wasm-debugger-tests.yml +++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml @@ -32,7 +32,7 @@ jobs: jobParameters: testGroup: innerloop isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} - ${{ if eq(nameSuffix, '') }}: + ${{ if eq(parameters.nameSuffix, '') }}: nameSuffix: Mono_DebuggerTests_${{ parameters.browser }} ${{ else }}: nameSuffix: ${{ parameters.nameSuffix }} From 0865ed88fd6dfe7af4202a48bcee18be8d820858 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:45:30 +0000 Subject: [PATCH 16/46] Always run the new tests when the pipeline is invoked manually --- eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 52c97ab226019..7c5fd1de9fe2b 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -220,6 +220,7 @@ jobs: - Browser_wasm_win extraBuildArgs: /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded + alwaysRun: true # always run when invoked manually isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} From ab9b21fbd4e25cba75b0e634fbdc1ddd7f7827d4 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 11 Oct 2022 22:51:31 +0000 Subject: [PATCH 17/46] Pass through extra build args for wasm debugger tests --- eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml index 5bc1b11dce604..ff3b33fa54252 100644 --- a/eng/pipelines/common/templates/wasm-debugger-tests.yml +++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml @@ -36,7 +36,7 @@ jobs: nameSuffix: Mono_DebuggerTests_${{ parameters.browser }} ${{ else }}: nameSuffix: ${{ parameters.nameSuffix }} - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }} + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }} ${{ parameters.extraBuildArgs }} timeoutInMinutes: 180 # if !alwaysRun, then: # if this is runtime-wasm (isWasmOnlyBuild): From 7557dac57e3485b83b25221fe7477d4599c6d786 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 13 Oct 2022 16:24:32 -0300 Subject: [PATCH 18/46] Addressing @radical comments. --- .../BrowserDebugProxy/DevToolsHelper.cs | 23 ++++++--- ...buggerProxy.cs => FirefoxDebuggerProxy.cs} | 0 .../Firefox/FirefoxMonoProxy.cs | 10 ++-- .../debugger/BrowserDebugProxy/MonoProxy.cs | 47 ++++++++++++------- 4 files changed, 53 insertions(+), 27 deletions(-) rename src/mono/wasm/debugger/BrowserDebugProxy/Firefox/{FireforDebuggerProxy.cs => FirefoxDebuggerProxy.cs} (100%) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index ee7eea8a51720..62fbb466e62f3 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -408,13 +408,22 @@ public ExecutionContext(MonoSDBHelper sdbAgent, int id, object auxData, PauseOnE SdbAgent = sdbAgent; PauseOnExceptions = pauseOnExceptions; } - public ExecutionContext Clone(SessionId sessionId) - => new ExecutionContext(SdbAgent.Clone(sessionId), Id, AuxData, PauseOnExceptions) + public ExecutionContext CreateChildAsyncExecutionContext(SessionId sessionId) + => new ExecutionContext(null, Id, AuxData, PauseOnExceptions) { - ready = ready, - store = store, - Source = Source + ParentContext = this, + SessionId = sessionId }; + public bool CopyDataFromParentContext() + { + if (SdbAgent != null) + return false; + ready = ParentContext.ready; + store = ParentContext.store; + Source = ParentContext.Source; + SdbAgent = ParentContext.SdbAgent.Clone(SessionId); + return true; + } public string DebugId { get; set; } public Dictionary BreakpointRequests { get; } = new Dictionary(); public int breakpointId; @@ -425,6 +434,8 @@ public ExecutionContext Clone(SessionId sessionId) public bool IsResumedAfterBp { get; set; } public int ThreadId { get; set; } public int Id { get; set; } + public ExecutionContext ParentContext { get; set; } + public SessionId SessionId { get; set; } public bool PausedOnWasm { get; set; } @@ -438,7 +449,7 @@ public ExecutionContext Clone(SessionId sessionId) public string[] LoadedFiles { get; set; } internal DebugStore store; - internal MonoSDBHelper SdbAgent { get; init; } + internal MonoSDBHelper SdbAgent { get; set; } public TaskCompletionSource Source { get; private set; } = new TaskCompletionSource(); private Dictionary perScopeCaches { get; } = new Dictionary(); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FireforDebuggerProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxDebuggerProxy.cs similarity index 100% rename from src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FireforDebuggerProxy.cs rename to src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxDebuggerProxy.cs diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs index adf0df1fff37a..0b1e257803676 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs @@ -717,9 +717,11 @@ private async Task SendPauseToBrowser(SessionId sessionId, JObject args, C { var context = GetContextFixefox(sessionId); Result res = context.LastDebuggerAgentBufferReceived; - if (!res.IsOk) + if (!res.IsOk || res.Value?["result"].Value().Count == 0) + { + logger.LogTrace($"Unexpected DebuggerAgentBufferReceived {res}"); return false; - + } byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?[0]?["value"]?["value"]?.Value()); using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadBytes(11); @@ -835,7 +837,7 @@ internal override Task SendMonoCommand(SessionId id, MonoCommands cmd, C return SendCommand(id, "evaluateJSAsync", o, token); } - internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, bool ignoreBreakpoint, CancellationToken token) + internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, CancellationToken token, bool resolveBreakpoints = true) { //different behavior when debugging from VSCode and from Firefox var ctx = context as FirefoxExecutionContext; @@ -870,7 +872,7 @@ internal override async Task OnSourceFileAdded(SessionId sessionId, SourceFile s }); } await SendEvent(sessionId, "", sourcesJObj, token); - if (ignoreBreakpoint) + if (!resolveBreakpoints) return; foreach (var req in context.BreakpointRequests.Values) { diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 0ebfc1175700b..5ebfea5976516 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -171,10 +171,18 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par case "Debugger.paused": { - // Don't process events from sessions we aren't tracking unless they have asyncStackTraceId - if (!contexts.ContainsKey(sessionId) && args["asyncStackTraceId"] != null) + if (args["asyncStackTraceId"] != null) { - await CreateAsyncExecutionContext(sessionId, token); + if (!contexts.TryGetValue(sessionId, out ExecutionContext context)) + return false; + if (context.CopyDataFromParentContext()) + { + var store = await LoadStore(sessionId, true, token); + foreach (var source in store.AllSources()) + { + await OnSourceFileAdded(sessionId, source, context, token); + } + } } //TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack @@ -234,6 +242,8 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par { if (args["targetInfo"]["type"]?.ToString() == "page") await AttachToTarget(new SessionId(args["sessionId"]?.ToString()), token); + else if (args["targetInfo"]["type"]?.ToString() == "worker") + CreateAsyncExecutionContext(new SessionId(args["sessionId"]?.ToString()), new SessionId(parms["sessionId"]?.ToString())); break; } @@ -247,14 +257,13 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par return false; } - protected async Task CreateAsyncExecutionContext(SessionId sessionId, CancellationToken token) + protected void CreateAsyncExecutionContext(SessionId sessionId, SessionId originSessionId) { - contexts[sessionId] = contexts.First().Value.Clone(sessionId); - var store = await LoadStore(sessionId, true, token); - foreach (var source in store.AllSources()) - { - await OnSourceFileAdded(sessionId, source, contexts[sessionId], true, token); - } + if (!contexts.TryGetValue(originSessionId, out ExecutionContext context)) + return; + if (contexts.ContainsKey(sessionId)) + return; + contexts[sessionId] = context.CreateChildAsyncExecutionContext(sessionId); } protected virtual async Task SendResume(SessionId id, CancellationToken token) @@ -1071,9 +1080,11 @@ internal virtual void SaveLastDebuggerAgentBufferReceivedToContext(SessionId ses internal async Task GetLastDebuggerAgentBuffer(SessionId sessionId, JObject args, CancellationToken token) { + if (args?["callFrames"].Value().Count == 0 || args["callFrames"][0]["scopeChain"].Value().Count == 0) + return Result.Err($"Unexpected callFrames {args}"); var argsNew = JObject.FromObject(new { - objectId = args?["callFrames"]?[0]?["scopeChain"]?[0]?["object"]?["objectId"]?.Value(), + objectId = args["callFrames"][0]["scopeChain"][0]["object"]["objectId"].Value(), }); Result res = await SendCommand(sessionId, "Runtime.getProperties", argsNew, token); return res; @@ -1082,9 +1093,11 @@ internal async Task GetLastDebuggerAgentBuffer(SessionId sessionId, JObj internal async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, Result debuggerAgentBuffer, CancellationToken token) { SaveLastDebuggerAgentBufferReceivedToContext(sessionId, debuggerAgentBuffer); - if (!debuggerAgentBuffer.IsOk) + if (!debuggerAgentBuffer.IsOk || debuggerAgentBuffer.Value?["result"].Value().Count == 0) + { + logger.LogTrace($"Unexpected DebuggerAgentBufferReceived {debuggerAgentBuffer}"); return false; - + } ExecutionContext context = GetContext(sessionId); byte[] newBytes = Convert.FromBase64String(debuggerAgentBuffer.Value?["result"]?[0]?["value"]?["value"]?.Value()); using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); @@ -1311,7 +1324,7 @@ private async Task OnAssemblyLoadedJSEvent(SessionId sessionId, JObject ev var context = GetContext(sessionId); foreach (var source in store.Add(sessionId, assembly_name, assembly_data, pdb_data, token)) { - await OnSourceFileAdded(sessionId, source, context, false, token); + await OnSourceFileAdded(sessionId, source, context, token); } return true; @@ -1487,12 +1500,12 @@ private async Task SetMonoBreakpoint(SessionId sessionId, string req return bp; } - internal virtual async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, bool ignoreBreakpoint, CancellationToken token) + internal virtual async Task OnSourceFileAdded(SessionId sessionId, SourceFile source, ExecutionContext context, CancellationToken token, bool resolveBreakpoints = true) { JObject scriptSource = JObject.FromObject(source.ToScriptSource(context.Id, context.AuxData)); // Log("debug", $"sending {source.Url} {context.Id} {sessionId.sessionId}"); await SendEvent(sessionId, "Debugger.scriptParsed", scriptSource, token); - if (ignoreBreakpoint) + if (!resolveBreakpoints) return; foreach (var req in context.BreakpointRequests.Values) { @@ -1529,7 +1542,7 @@ internal virtual async Task LoadStore(SessionId sessionId, bool tryU await foreach (SourceFile source in context.store.Load(sessionId, loaded_files, context, useDebuggerProtocol, token)) { - await OnSourceFileAdded(sessionId, source, context, false, token); + await OnSourceFileAdded(sessionId, source, context, token, false); } } } From 1b6c8802e69fc773c22210707681e334c96ae1b0 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 14 Oct 2022 10:31:37 -0300 Subject: [PATCH 19/46] Apply suggestions from code review Co-authored-by: Ankit Jain --- src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index 62fbb466e62f3..d56ff4ec281af 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -434,8 +434,8 @@ public bool CopyDataFromParentContext() public bool IsResumedAfterBp { get; set; } public int ThreadId { get; set; } public int Id { get; set; } - public ExecutionContext ParentContext { get; set; } - public SessionId SessionId { get; set; } + public ExecutionContext ParentContext { get; private set; } + public SessionId SessionId { get; private set; } public bool PausedOnWasm { get; set; } @@ -449,7 +449,7 @@ public bool CopyDataFromParentContext() public string[] LoadedFiles { get; set; } internal DebugStore store; - internal MonoSDBHelper SdbAgent { get; set; } + internal MonoSDBHelper SdbAgent { get; private set; } public TaskCompletionSource Source { get; private set; } = new TaskCompletionSource(); private Dictionary perScopeCaches { get; } = new Dictionary(); From 1aee947e2b73d0e0a4af5d56c0323ad8ac541046 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 14 Oct 2022 11:35:36 -0300 Subject: [PATCH 20/46] addressing radical comments --- .../debugger/BrowserDebugProxy/MonoProxy.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 5ebfea5976516..ca9063a0e60c3 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -180,7 +180,7 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par var store = await LoadStore(sessionId, true, token); foreach (var source in store.AllSources()) { - await OnSourceFileAdded(sessionId, source, context, token); + await OnSourceFileAdded(sessionId, source, context, token, false); } } } @@ -240,10 +240,11 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par case "Target.attachedToTarget": { - if (args["targetInfo"]["type"]?.ToString() == "page") + var targetType = args["targetInfo"]["type"]?.ToString(); + if (targetType == "page") await AttachToTarget(new SessionId(args["sessionId"]?.ToString()), token); - else if (args["targetInfo"]["type"]?.ToString() == "worker") - CreateAsyncExecutionContext(new SessionId(args["sessionId"]?.ToString()), new SessionId(parms["sessionId"]?.ToString())); + else if (targetType == "worker") + CreateWorkerExecutionContext(new SessionId(args["sessionId"]?.ToString()), new SessionId(parms["sessionId"]?.ToString())); break; } @@ -257,13 +258,19 @@ protected override async Task AcceptEvent(SessionId sessionId, JObject par return false; } - protected void CreateAsyncExecutionContext(SessionId sessionId, SessionId originSessionId) + protected void CreateWorkerExecutionContext(SessionId workerSessionId, SessionId originSessionId) { if (!contexts.TryGetValue(originSessionId, out ExecutionContext context)) + { + logger.LogDebug($"Origin sessionId does not exist - {originSessionId}"); return; - if (contexts.ContainsKey(sessionId)) + } + if (contexts.ContainsKey(workerSessionId)) + { + logger.LogDebug($"Worker sessionId already exists - {originSessionId}"); return; - contexts[sessionId] = context.CreateChildAsyncExecutionContext(sessionId); + } + contexts[workerSessionId] = context.CreateChildAsyncExecutionContext(workerSessionId); } protected virtual async Task SendResume(SessionId id, CancellationToken token) @@ -1542,7 +1549,7 @@ internal virtual async Task LoadStore(SessionId sessionId, bool tryU await foreach (SourceFile source in context.store.Load(sessionId, loaded_files, context, useDebuggerProtocol, token)) { - await OnSourceFileAdded(sessionId, source, context, token, false); + await OnSourceFileAdded(sessionId, source, context, token); } } } From 884bd1669ae2b79dba60dafa46977219f9fb63b6 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 17 Oct 2022 15:28:31 -0300 Subject: [PATCH 21/46] Fixing tests failures and adding a schema to run a test that will only run in a multithreaded environment. --- .../wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs | 5 +++++ .../debugger/DebuggerTestSuite/DebuggerTestSuite.csproj | 1 + src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs | 7 +++++++ .../wasm/debugger/tests/debugger-test/debugger-test.csproj | 1 + 4 files changed, 14 insertions(+) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index b533d39910ac1..286962abd2c6b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -36,6 +36,11 @@ public static WasmHost RunningOn => WasmHost.Chrome; #else => WasmHost.Firefox; +#endif +#if WASM_ENABLE_THREADS + public static bool WasmEnableThreads = true; +#else + public static bool WasmEnableThreads = false; #endif public static bool RunningOnChrome => RunningOn == WasmHost.Chrome; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj index 45e5d54b85f46..131224a47c723 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj @@ -7,6 +7,7 @@ false chrome $(DefineConstants);RUN_IN_CHROME + $(DefineConstants);WASM_ENABLE_THREADS windows true true diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs index 77a967f1f96f3..84d6562ece3c1 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs @@ -1037,5 +1037,12 @@ await EvaluateAndCheck( step_into2["callFrames"][0]["location"]["lineNumber"].Value() ); } + + [ConditionalFact(nameof(WasmEnableThreads))] + public async Task TestDebugUsingMultiThreadedRuntime() + { + //TODO WRITE HERE A TEST LIKE THE SAMPLE AND CHECK IF IT'S PAUSING IN ALL THREADS CORRECTLY + await Task.Delay(1); + } } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj index a9d8b0e66ecdc..472026062a71f 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj @@ -8,6 +8,7 @@ true library true + <_WasmPThreadPoolSize Condition="'$(WasmEnableThreads)'=='true'">10 From 18cb99366fe7adf628c6b24cfe83ef1b67d32655 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 18 Oct 2022 10:35:31 -0300 Subject: [PATCH 22/46] Adding support for run debugger-tests in a multithreaded runtime. --- .../runtime-extra-platforms-wasm.yml | 2 +- eng/pipelines/runtime-wasm-dbgtests.yml | 2 +- .../DebuggerTestSuite/DebuggerTestBase.cs | 31 ++++++++++++------- .../DebuggerTestSuite.csproj | 1 - .../debugger/DebuggerTestSuite/Inspector.cs | 10 ++++++ .../DebuggerTestSuite/InspectorClient.cs | 3 ++ .../DebuggerTestSuite/SteppingTests.cs | 1 + 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 7c5fd1de9fe2b..ff85ae1b3ab2f 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -218,7 +218,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true + extraBuildArgs: /p:WasmEnableThreads=true /e:WASM_TESTS_USING_VARIANT=multithreaded nameSuffix: DebuggerTests_MultiThreaded alwaysRun: true # always run when invoked manually isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} diff --git a/eng/pipelines/runtime-wasm-dbgtests.yml b/eng/pipelines/runtime-wasm-dbgtests.yml index ad6ec7ca566a8..64cf092793e0c 100644 --- a/eng/pipelines/runtime-wasm-dbgtests.yml +++ b/eng/pipelines/runtime-wasm-dbgtests.yml @@ -24,7 +24,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true + extraBuildArgs: /p:WasmEnableThreads=true /e:WASM_TESTS_USING_VARIANT=multithreaded nameSuffix: DebuggerTests_MultiThreaded isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index 286962abd2c6b..a20cd71fe0979 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -37,11 +37,18 @@ public static WasmHost RunningOn #else => WasmHost.Firefox; #endif -#if WASM_ENABLE_THREADS - public static bool WasmEnableThreads = true; -#else - public static bool WasmEnableThreads = false; -#endif + + public static bool WasmEnableThreads + { + get + { + var envVar = Environment.GetEnvironmentVariable("WASM_TESTS_USING_VARIANT"); + if (envVar == "multithreaded") + return true; + return false; + } + } + public static bool RunningOnChrome => RunningOn == WasmHost.Chrome; public const int FirefoxProxyPort = 6002; @@ -138,15 +145,17 @@ public virtual async Task InitializeAsync() { Func)>> fn = (client, token) => { - Func)> getInitCmdFn = (cmd) => (cmd, client.SendCommand(cmd, null, token)); + Func)> getInitCmdFn = (cmd, args) => (cmd, client.SendCommand(cmd, args, token)); var init_cmds = new List<(string, Task)> { - getInitCmdFn("Profiler.enable"), - getInitCmdFn("Runtime.enable"), - getInitCmdFn("Debugger.enable"), - getInitCmdFn("Runtime.runIfWaitingForDebugger") + getInitCmdFn("Profiler.enable", null), + getInitCmdFn("Runtime.enable", null), + getInitCmdFn("Debugger.enable", null), + getInitCmdFn("Runtime.runIfWaitingForDebugger", null), + getInitCmdFn("Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32})), + getInitCmdFn("Target.setAutoAttach", JObject.FromObject(new { autoAttach = true, waitForDebuggerOnStart = true, flatten = true})) + //getInitCmdFn("ServiceWorker.enable", null) }; - return init_cmds; }; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj index 131224a47c723..45e5d54b85f46 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj @@ -7,7 +7,6 @@ false chrome $(DefineConstants);RUN_IN_CHROME - $(DefineConstants);WASM_ENABLE_THREADS windows true true diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index 42e880f6dd095..fd0ce3009c86b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -199,6 +199,16 @@ async Task OnMessage(string method, JObject args, CancellationToken token) bool fail = false; switch (method) { + case "Target.attachedToTarget": + { + var sessionId = new SessionId(args["sessionId"]?.Value()); + await Client.SendCommand(sessionId, "Profiler.enable", null, token); + await Client.SendCommand(sessionId, "Runtime.enable", null, token); + await Client.SendCommand(sessionId, "Debugger.enable", null, token); + await Client.SendCommand(sessionId, "Runtime.runIfWaitingForDebugger", null, token); + await Client.SendCommand(sessionId, "Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32}), token); + break; + } case "Debugger.paused": NotifyOf(PAUSE, args); break; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs index ad4aab960c3c7..827a557bd9ce6 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs @@ -90,6 +90,9 @@ public virtual Task SendCommand(SessionId sessionId, string method, JObj @params = args }); + if (sessionId != SessionId.Null) + o.Add("sessionId", sessionId.sessionId); + var tcs = new TaskCompletionSource(); pending_cmds[new MessageId(sessionId.sessionId, id)] = tcs; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs index 84d6562ece3c1..334da4f6f15a5 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs @@ -1042,6 +1042,7 @@ await EvaluateAndCheck( public async Task TestDebugUsingMultiThreadedRuntime() { //TODO WRITE HERE A TEST LIKE THE SAMPLE AND CHECK IF IT'S PAUSING IN ALL THREADS CORRECTLY + Assert.Equal(1, 2); await Task.Delay(1); } } From 40afb37524477b46711159cabff6a003347cc808 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Wed, 19 Oct 2022 17:07:02 -0300 Subject: [PATCH 23/46] Fix running debugger tests for multithreaded runtime, passing sessionId where it's necessary. --- src/mono/mono/component/debugger-agent.c | 4 + .../debugger/BrowserDebugProxy/MonoProxy.cs | 4 + .../debugger/DebuggerTestSuite/ArrayTests.cs | 2 +- .../DebuggerTestSuite/AssignmentTests.cs | 4 +- .../debugger/DebuggerTestSuite/AsyncTests.cs | 18 +-- .../DebuggerTestSuite/BreakpointTests.cs | 52 ++++---- .../DebuggerTestSuite/CustomViewTests.cs | 4 +- .../DebuggerTestSuite/DateTimeTests.cs | 2 +- .../DebuggerTestSuite/DebuggerTestBase.cs | 104 ++++++++-------- .../DebuggerTestSuite/DebuggerTestFirefox.cs | 14 +-- .../EvaluateOnCallFrameTests.cs | 114 +++++++++--------- .../FirefoxInspectorClient.cs | 4 +- .../DebuggerTestSuite/GetPropertiesTests.cs | 2 +- .../DebuggerTestSuite/HotReloadTests.cs | 44 +++---- .../debugger/DebuggerTestSuite/Inspector.cs | 27 +++-- .../DebuggerTestSuite/InspectorClient.cs | 6 +- .../debugger/DebuggerTestSuite/MiscTests.cs | 20 +-- .../DebuggerTestSuite/SetNextIpTests.cs | 108 +++++++++-------- .../SetVariableValueTests.cs | 36 +++--- .../DebuggerTestSuite/SteppingTests.cs | 42 +++---- 20 files changed, 323 insertions(+), 288 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 11063d09ab54c..fa27e01cd8b9b 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -2843,7 +2843,11 @@ wait_for_suspend (void) static gboolean is_suspended (void) { +#ifdef HOST_WASM + return true; +#else return count_threads_to_wait_for () == 0; +#endif } static void diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index e5b16e02a723a..361706f66f10f 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -1148,6 +1148,10 @@ internal async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObje else if (event_kind == EventKind.Breakpoint) context.PauseKind = "breakpoint"; Breakpoint bp = context.BreakpointRequests.Values.SelectMany(v => v.Locations).FirstOrDefault(b => b.RemoteId == request_id); + if (bp == null && context.ParentContext != null) + { + bp = context.ParentContext.BreakpointRequests.Values.SelectMany(v => v.Locations).FirstOrDefault(b => b.RemoteId == request_id); + } if (request_id == context.TempBreakpointForSetNextIP) { context.TempBreakpointForSetNextIP = -1; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs index ff0712e320377..c4c5de0361d35 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs @@ -589,7 +589,7 @@ public async Task InvalidArrayId() => await CheckInspectLocalsAtBreakpointSite( public async Task InvalidAccessors() => await CheckInspectLocalsAtBreakpointSite( "DebuggerTests.Container", "PlaceholderMethod", 1, "DebuggerTests.Container.PlaceholderMethod", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers'); }, 1);", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { var this_obj = GetAndAssertObjectWithName(locals, "this"); var this_obj_id = this_obj["value"]?["objectId"]?.Value(); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs index ea2fc12f67e08..ed30423421bdc 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs @@ -57,7 +57,7 @@ public async Task InspectVariableBeforeAndAfterAssignment(string clazz, JObject // 1) check un-assigned variables await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, methodName, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { int numLocals = locals.Count(); if (numLocals != 2) @@ -69,7 +69,7 @@ await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-assignmen // 2) check assigned variables await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, methodName, times: 3, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { int numLocals = locals.Count(); if (numLocals != 2) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs index 17d29d62bab84..f64532ca159fb 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs @@ -30,14 +30,14 @@ public async Task AsyncLocalsInContinueWith(string method_name, string expected_ "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), code = TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests.<>c"), dt = TDateTime(new DateTime(4513, 4, 5, 6, 7, 8)) - }, "locals"); + }, "locals", sessionIdStr : pause_location["sessionId"].Value()); var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status"); await CheckValue(res.Value["result"], TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), "t.Status"); @@ -49,20 +49,20 @@ public async Task AsyncLocalsInContinueWithInstanceUsingThisBlock() => await Che "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), code = TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), dt = TDateTime(new DateTime(4513, 4, 5, 6, 7, 8)), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests") - }, "locals"); + }, "locals", sessionIdStr : pause_location["sessionId"].Value()); - var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status"); + var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status", sessionIdStr : pause_location["sessionId"].Value()); await CheckValue(res.Value["result"], TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), "t.Status"); - res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "this"), "Date"); - await CheckValue(res.Value["result"], TDateTime(new DateTime(2510, 1, 2, 3, 4, 5)), "this.Date"); + res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "this"), "Date", sessionIdStr : pause_location["sessionId"].Value()); + await CheckValue(res.Value["result"], TDateTime(new DateTime(2510, 1, 2, 3, 4, 5)), "this.Date", sessionIdStr : pause_location["sessionId"].Value()); }); [Fact] // NestedContinueWith @@ -71,7 +71,7 @@ public async Task AsyncLocalsInNestedContinueWithStaticBlock() => await CheckIns "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), @@ -79,7 +79,7 @@ public async Task AsyncLocalsInNestedContinueWithStaticBlock() => await CheckIns str = TString("foobar"), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests.<>c__DisplayClass4_0"), ncs_dt0 = TDateTime(new DateTime(3412, 4, 6, 8, 0, 2)) - }, "locals"); + }, "locals", sessionIdStr : pause_location["sessionId"].Value()); }); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index 7949ebec263fa..7167d142fe38a 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -219,23 +219,25 @@ await EvaluateAndCheck( } [ConditionalTheory(nameof(RunningOnChrome))] - [InlineData("c == 15", 79, 3, 79, 11)] - [InlineData("c == 17", 79, 3, 80, 11)] - [InlineData("g == 17", 79, 3, 80, 11)] - [InlineData("true", 79, 3, 79, 11)] - [InlineData("\"false\"", 79, 3, 79, 11)] - [InlineData("\"true\"", 79, 3, 79, 11)] - [InlineData("5", 79, 3, 79, 11)] - [InlineData("p", 79, 3, 80, 11)] - [InlineData("0.0", 79, 3, 80, 11)] - public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected) + [InlineData("c == 15", 79, 3, 79, 11, "dotnet.worker.js")] + [InlineData("c == 17", 79, 3, 80, 11, "debugger-driver.html")] + [InlineData("g == 17", 79, 3, 80, 11, "debugger-driver.html")] + [InlineData("true", 79, 3, 79, 11, "dotnet.worker.js")] + [InlineData("\"false\"", 79, 3, 79, 11, "dotnet.worker.js")] + [InlineData("\"true\"", 79, 3, 79, 11, "dotnet.worker.js")] + [InlineData("5", 79, 3, 79, 11, "dotnet.worker.js")] + [InlineData("p", 79, 3, 80, 11, "debugger-driver.html")] + [InlineData("0.0", 79, 3, 80, 11, "debugger-driver.html")] + public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected, string file_name) { await SetBreakpoint("/debugger-driver.html", line_bp, column_bp, condition: condition); await SetBreakpoint("/debugger-driver.html", 80, 11); - await EvaluateAndCheck( + var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { conditional_breakpoint_test(5, 10, null); }, 1);", - "debugger-driver.html", line_expected, column_expected, "conditional_breakpoint_test"); + "", -1, -1, "conditional_breakpoint_test"); + + CheckLocationLineColumn(pause_location["callFrames"]?[0]["location"], line_expected, column_expected); } [Theory] @@ -268,35 +270,35 @@ await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);", "dotnet://debugger-test.dll/debugger-test2.cs", 58, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 59, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 60, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 61, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 50); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 62, 4, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 100); await Task.CompletedTask; @@ -344,7 +346,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; @@ -369,7 +371,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; @@ -381,7 +383,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; @@ -392,7 +394,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 6); await Task.CompletedTask; @@ -403,7 +405,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 9); await Task.CompletedTask; @@ -440,7 +442,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; @@ -452,7 +454,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 1); await Task.CompletedTask; @@ -463,7 +465,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 2); await Task.CompletedTask; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs index 48f4f0a70804c..c984da8f51117 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs @@ -65,7 +65,7 @@ public async Task UsingDebuggerTypeProxy() props = await GetObjectOnFrame(frame, "openWith"); Assert.Equal(1, props.Count()); - await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value(), + await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), ("listToTestToList.ToList()", TObject("System.Collections.Generic.List", description: "Count = 11"))); } @@ -119,7 +119,7 @@ await EvaluateAndCheck( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("a", TObject("ToStringOverriden", description:"helloToStringOverriden")), ("b", TObject("ToStringOverriden.ToStringOverridenB", description:"helloToStringOverridenA")), ("c", TObject("ToStringOverriden.ToStringOverridenD", description:"helloToStringOverridenD")), diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs index 9963b2b05d33a..632902c015e8b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs @@ -29,7 +29,7 @@ public async Task CheckDateTimeLocale(string locale, string fdtp, string ldp, st "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.DateTimeTest:LocaleTest'," + $"'{locale}'); }}, 1);", debugger_test_loc, 25, 12, "DebuggerTests.DateTimeTest.LocaleTest", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(locale).DateTimeFormat; CultureInfo.CurrentCulture = new CultureInfo(locale, false); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index a20cd71fe0979..b93fe14a44bdb 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -38,7 +38,7 @@ public static WasmHost RunningOn => WasmHost.Firefox; #endif - public static bool WasmEnableThreads + public static bool WasmMultiThreaded { get { @@ -48,6 +48,7 @@ public static bool WasmEnableThreads return false; } } + public static bool WasmSingleThreaded => !WasmMultiThreaded; public static bool RunningOnChrome => RunningOn == WasmHost.Chrome; @@ -200,7 +201,7 @@ protected Task DefaultScriptParsedHandler(JObject ar } internal async Task CheckInspectLocalsAtBreakpointSite(string url_key, int line, int column, string function_name, string eval_expression, - Func test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false) + Func test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false) { UseCallFunctionOnBeforeGetProperties = use_cfo; @@ -223,10 +224,10 @@ await EvaluateAndCheck( else await Task.CompletedTask; }, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { if (test_fn != null) - await test_fn(locals); + await test_fn(locals, sessionIdStr); } ); } @@ -287,7 +288,7 @@ public async Task WaitForScriptParsedEventsAsync(params string[] paths) // sets breakpoint by method name and line offset internal async Task CheckInspectLocalsAtBreakpointSite(string type, string method, int line_offset, string bp_function_name, string eval_expression, - Func locals_fn = null, Func wait_for_event_fn = null, bool use_cfo = false, string assembly = "debugger-test.dll", int col = 0) + Func locals_fn = null, Func wait_for_event_fn = null, bool use_cfo = false, string assembly = "debugger-test.dll", int col = 0) { UseCallFunctionOnBeforeGetProperties = use_cfo; @@ -304,7 +305,7 @@ internal async Task CheckInspectLocalsAtBreakpointSite(string type, string metho Assert.Equal(bp_function_name, pause_location["callFrames"]?[0]?["functionName"]?.Value()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value()); - + var top_frame = pause_location!["callFrames"]?[0]; var scope = top_frame?["scopeChain"]?[0]; @@ -314,8 +315,8 @@ internal async Task CheckInspectLocalsAtBreakpointSite(string type, string metho if (locals_fn != null) { - var locals = await GetProperties(pause_location?["callFrames"]?[0]?["callFrameId"]?.Value()); - await locals_fn(locals); + var locals = await GetProperties(pause_location?["callFrames"]?[0]?["callFrameId"]?.Value(), sessionIdStr : pause_location?["sessionId"]?.Value()); + await locals_fn(locals, pause_location?["sessionId"]?.Value()); } } @@ -334,6 +335,12 @@ internal virtual void CheckLocationLine(JToken location, int line) Assert.Equal(location["lineNumber"].Value(), line); } + internal virtual void CheckLocationLineColumn(JToken location, int line, int col) + { + CheckLocationLine(location, line); + Assert.Equal(location["columnNumber"].Value(), col); + } + internal void CheckNumber(JToken locals, string name, T value) { foreach (var l in locals) @@ -400,24 +407,24 @@ internal async Task CheckPointerValue(JToken locals, string name, JToken return l; } - internal async Task CheckDateTime(JToken value, DateTime expected, string label = "") + internal async Task CheckDateTime(JToken value, DateTime expected, string label = "", string sessionIdStr = null) { await CheckValue(value, TValueType("System.DateTime", expected.ToString()), label); - await CheckDateTimeValue(value, expected, label); + await CheckDateTimeValue(value, expected, label, sessionIdStr); } - internal async Task CheckDateTime(JToken locals, string name, DateTime expected, string label = "") + internal async Task CheckDateTime(JToken locals, string name, DateTime expected, string label = "", string sessionIdStr = null) { var obj = GetAndAssertObjectWithName(locals, name, label); - await CheckDateTimeValue(obj["value"], expected, label); + await CheckDateTimeValue(obj["value"], expected, label, sessionIdStr); } - async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "") + async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "", string sessionIdStr = null) { AssertEqual("System.DateTime", v["className"]?.Value(), $"{label}#className"); AssertEqual(exp_dt.ToString(), v["description"]?.Value(), $"{label}#description"); - var members = await GetProperties(v["objectId"]?.Value()); + var members = await GetProperties(v["objectId"]?.Value(), sessionIdStr : sessionIdStr); // not checking everything CheckNumber(members, "Year", exp_dt.Year); @@ -428,17 +435,17 @@ async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "") CheckNumber(members, "Second", exp_dt.Second); } - internal virtual async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "") + internal virtual async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "", string sessionIdStr = null) { - var res = await InvokeGetter(JObject.FromObject(new { value = value }), "Date"); - await CheckDateTimeMembers(res.Value["result"], expected.Date, label); + var res = await InvokeGetter(JObject.FromObject(new { value = value }), "Date", sessionIdStr: sessionIdStr); + await CheckDateTimeMembers(res.Value["result"], expected.Date, label, sessionIdStr); } - internal async Task CheckDateTimeValue(JToken value, DateTime expected, string label = "") + internal async Task CheckDateTimeValue(JToken value, DateTime expected, string label = "", string sessionIdStr = null) { - await CheckDateTimeMembers(value, expected, label); + await CheckDateTimeMembers(value, expected, label, sessionIdStr); - await CheckDateTimeGetter(value, expected, label); + await CheckDateTimeGetter(value, expected, label, sessionIdStr); } internal async Task CheckBool(JToken locals, string name, bool expected) @@ -524,7 +531,7 @@ internal async Task RunUntil(string methodName) return wait_res; } - internal async Task InvokeGetter(JToken obj, object arguments, string fn = "function(e){return this[e]}", bool expect_ok = true, bool? returnByValue = null) + internal async Task InvokeGetter(JToken obj, object arguments, string fn = "function(e){return this[e]}", bool expect_ok = true, bool? returnByValue = null, string sessionIdStr = null) { var req = JObject.FromObject(new { @@ -535,7 +542,7 @@ internal async Task InvokeGetter(JToken obj, object arguments, string fn if (returnByValue != null) req["returnByValue"] = returnByValue.Value; - var res = await cli.SendCommand("Runtime.callFunctionOn", req, token); + var res = await cli.SendCommand(new SessionId(sessionIdStr), "Runtime.callFunctionOn", req, token); Assert.True(expect_ok == res.IsOk, $"InvokeGetter failed for {req} with {res}"); return res; @@ -557,23 +564,24 @@ internal async Task InvokeGetter(JToken obj, object arguments, string fn } internal virtual async Task StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, int times = 1) + Func wait_for_event_fn = null, Func locals_fn = null, int times = 1, string sessionIdStr = null) { string method = (kind == StepKind.Resume ? "Debugger.resume" : $"Debugger.step{kind}"); for (int i = 0; i < times - 1; i++) { - await SendCommandAndCheck(null, method, null, -1, -1, null); + await SendCommandAndCheck(null, method, null, -1, -1, null, sessionIdStr : sessionIdStr); } // Check for method/line etc only at the last step return await SendCommandAndCheck( null, method, script_loc, line, column, function_name, wait_for_event_fn: wait_for_event_fn, - locals_fn: locals_fn); + locals_fn: locals_fn, + sessionIdStr : sessionIdStr); } - internal async Task SetNextIPAndCheck(string script_id, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, bool expected_error = false) + internal async Task SetNextIPAndCheck(string sessionIdStr, string script_id, string script_loc, int line, int column, string function_name, + Func wait_for_event_fn = null, Func locals_fn = null, bool expected_error = false) { var setNextIPArgs = JObject.FromObject(new { @@ -587,17 +595,18 @@ internal async Task SetNextIPAndCheck(string script_id, string script_l return await SendCommandAndCheck( JObject.FromObject(new { location = setNextIPArgs }), "DotnetDebugger.setNextIP", script_loc, line, column, function_name, wait_for_event_fn: wait_for_event_fn, - locals_fn: locals_fn); + locals_fn: locals_fn, + sessionIdStr: sessionIdStr); } - var res = await cli.SendCommand("DotnetDebugger.setNextIP", JObject.FromObject(new { location = setNextIPArgs }), token); + var res = await cli.SendCommand(new SessionId(sessionIdStr), "DotnetDebugger.setNextIP", JObject.FromObject(new { location = setNextIPArgs }), token); Assert.False(res.IsOk); return JObject.FromObject(res); } internal virtual async Task EvaluateAndCheck( string expression, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null) + Func wait_for_event_fn = null, Func locals_fn = null) => await SendCommandAndCheck( CreateEvaluateArgs(expression), "Runtime.evaluate", script_loc, line, column, function_name, @@ -605,9 +614,9 @@ internal virtual async Task EvaluateAndCheck( locals_fn: locals_fn); internal virtual async Task SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE) + Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE, string sessionIdStr = null) { - var res = await cli.SendCommand(method, args, token); + var res = await cli.SendCommand(new SessionId(sessionIdStr), method, args, token); if (!res.IsOk) { _testOutput.WriteLine($"Failed to run command {method} with args: {args?.ToString()}\nresult: {res.Error.ToString()}"); @@ -629,10 +638,10 @@ internal virtual async Task SendCommandAndCheck(JObject args, string me if (locals_fn != null) { - var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value()); + var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value(), sessionIdStr : wait_res["sessionId"].Value()); try { - await locals_fn(locals); + await locals_fn(locals, sessionIdStr); } catch (System.AggregateException ex) { @@ -693,7 +702,7 @@ void CheckDelegateTarget(string actual_target, string exp_target) } } - internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string label) + internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string label, string sessionIdStr = null) { var ctype = exp_val["__custom_type"].Value(); switch (ctype) @@ -755,7 +764,7 @@ internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string la case "datetime": { var dateTime = DateTime.FromBinary(exp_val["binary"].Value()); - await CheckDateTime(actual_val, dateTime, label); + await CheckDateTime(actual_val, dateTime, label, sessionIdStr : sessionIdStr); break; } @@ -768,7 +777,7 @@ internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string la } } - internal async Task CheckProps(JToken actual, object exp_o, string label, int num_fields = -1, bool skip_num_fields_check = false) + internal async Task CheckProps(JToken actual, object exp_o, string label, int num_fields = -1, bool skip_num_fields_check = false, string sessionIdStr = null) { if (exp_o.GetType().IsArray || exp_o is JArray) { @@ -841,7 +850,7 @@ internal async Task CheckProps(JToken actual, object exp_o, string label, int nu } else { - await CheckValue(actual_obj["value"], exp_val, $"{label}#{exp_name}"); + await CheckValue(actual_obj["value"], exp_val, $"{label}#{exp_name}", sessionIdStr: sessionIdStr); } } } @@ -851,11 +860,11 @@ internal virtual bool SkipProperty(string propertyName) return false; } - internal async Task CheckValue(JToken actual_val, JToken exp_val, string label) + internal async Task CheckValue(JToken actual_val, JToken exp_val, string label, string sessionIdStr = null) { if (exp_val["__custom_type"] != null) { - await CheckCustomType(actual_val, exp_val, label); + await CheckCustomType(actual_val, exp_val, label, sessionIdStr : sessionIdStr); return; } @@ -940,8 +949,9 @@ internal async Task GetObjectOnLocals(JToken locals, string name) } /* @fn_args is for use with `Runtime.callFunctionOn` only */ - internal virtual async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true) + internal virtual async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true, string sessionIdStr = null) { + var sessionId = new SessionId(sessionIdStr); if (UseCallFunctionOnBeforeGetProperties && !id.StartsWith("dotnet:scope:")) { var fn_decl = "function () { return this; }"; @@ -953,7 +963,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu if (fn_args != null) cfo_args["arguments"] = fn_args; - var result = await cli.SendCommand("Runtime.callFunctionOn", cfo_args, token); + var result = await cli.SendCommand(sessionId, "Runtime.callFunctionOn", cfo_args, token); AssertEqual(expect_ok, result.IsOk, $"Runtime.getProperties returned {result.IsOk} instead of {expect_ok}, for {cfo_args.ToString()}, with Result: {result}"); if (!result.IsOk) return null; @@ -973,7 +983,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu get_prop_req["accessorPropertiesOnly"] = accessors_only.Value; } - var frame_props = await cli.SendCommand("Runtime.getProperties", get_prop_req, token); + var frame_props = await cli.SendCommand(sessionId,"Runtime.getProperties", get_prop_req, token); AssertEqual(expect_ok, frame_props.IsOk, $"Runtime.getProperties returned {frame_props.IsOk} instead of {expect_ok}, for {get_prop_req}, with Result: {frame_props}"); if (!frame_props.IsOk) return null; @@ -1060,7 +1070,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu return (locals, locals_private); } - internal virtual async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true) + internal virtual async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true, string sessionIdStr = null) { var evaluate_req = JObject.FromObject(new { @@ -1068,7 +1078,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu expression = expression }); - var res = await cli.SendCommand("Debugger.evaluateOnCallFrame", evaluate_req, token); + var res = await cli.SendCommand(new SessionId(sessionIdStr), "Debugger.evaluateOnCallFrame", evaluate_req, token); AssertEqual(expect_ok, res.IsOk, $"Debugger.evaluateOnCallFrame ('{expression}', scope: {id}) returned {res.IsOk} instead of {expect_ok}, with Result: {res}"); if (res.IsOk) return (res.Value["result"], res); @@ -1172,11 +1182,11 @@ internal virtual async Task SetBreakpointInMethod(string assembly, strin return res; } - internal async Task EvaluateOnCallFrameAndCheck(string call_frame_id, params (string expression, JObject expected)[] args) + internal async Task EvaluateOnCallFrameAndCheck(string call_frame_id, string sessionIdStr, params (string expression, JObject expected)[] args) { foreach (var arg in args) { - var (eval_val, _) = await EvaluateOnCallFrame(call_frame_id, arg.expression).ConfigureAwait(false); + var (eval_val, _) = await EvaluateOnCallFrame(call_frame_id, arg.expression, sessionIdStr : sessionIdStr).ConfigureAwait(false); try { await CheckValue(eval_val, arg.expected, arg.expression); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs index eaafe3ffcbbc0..f610a7f719d72 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs @@ -109,7 +109,7 @@ internal override async Task SetBreakpoint(string url_key, int line, int } internal override async Task EvaluateAndCheck( string expression, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null) + Func wait_for_event_fn = null, Func locals_fn = null) { return await SendCommandAndCheck( CreateEvaluateArgs(expression), @@ -181,7 +181,7 @@ private JObject ConvertFirefoxToDefaultFormat(JArray frames, JObject wait_res) } internal override async Task SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE) + Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE, string sessionIdStr = null) { switch (method) { @@ -215,7 +215,7 @@ internal override async Task SendCommandAndCheck(JObject args, string m var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value()); try { - await locals_fn(locals); + await locals_fn(locals, sessionIdStr); } catch (System.AggregateException ex) { @@ -313,7 +313,7 @@ internal JObject ConvertFromFirefoxToDefaultFormat(KeyValuePair } /* @fn_args is for use with `Runtime.callFunctionOn` only */ - internal override async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true) + internal override async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true, string sessionIdStr = null) { if (id.StartsWith("dotnet:scope:")) { @@ -357,7 +357,7 @@ internal override async Task GetProperties(string id, JToken fn_args = n } internal override async Task StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, int times = 1) + Func wait_for_event_fn = null, Func locals_fn = null, int times = 1, string sessionIdStr = null) { JObject resumeLimit = null; @@ -424,7 +424,7 @@ internal override async Task SetBreakpointInMethod(string assembly, stri return bp1_res; } - internal override async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true) + internal override async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true, string sessionIdStr = null) { var o = CreateEvaluateArgs(expression); var res = await cli.SendCommand("evaluateJSAsync", o, token); @@ -452,7 +452,7 @@ internal override async Task SetBreakpointInMethod(string assembly, stri internal override bool SkipProperty(string propertyName) => propertyName == "isEnum"; - internal override async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "") => await Task.CompletedTask; + internal override async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "", string sessionIdStr = null) => await Task.CompletedTask; internal override string EvaluateCommand() => "evaluateJSAsync"; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs index 30d391700c9af..8b073693e7ec5 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs @@ -56,7 +56,7 @@ public async Task EvaluateTypeInstanceMembers(string prefix, int bias, string ty foreach (var pad in new[] { String.Empty, " " }) { var padded_prefix = pad + prefix; - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{padded_prefix}a", TNumber(4)), // fields @@ -87,7 +87,7 @@ public async Task EvaluateInstanceMethodArguments(string type, string method, st var id = pause_location["callFrames"][0]["callFrameId"].Value(); var DTProp = new DateTime(2010, 9, 8, 7, 6, 5).AddMinutes(10); _testOutput.WriteLine ($"------- test running the bits.."); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("g", TNumber(400)), ("h", TNumber(123)), ("valString", TString("just a test")), @@ -114,7 +114,7 @@ public async Task EvaluateMethodLocals(string type, string method, string bp_fun var id = pause_location["callFrames"][0]["callFrameId"].Value(); var dt = new DateTime(2025, 3, 5, 7, 9, 11); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), (" d ", TNumber(401)), ("d", TNumber(401)), (" d", TNumber(401)), @@ -137,7 +137,7 @@ public async Task EvaluateStaticLocalsWithDeepMemberAccess() => await CheckInspe var id = pause_location["callFrames"][0]["callFrameId"].Value(); var dt = new DateTime(2020, 1, 2, 3, 4, 5); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f_s.c", TNumber(4)), ("f_s", TValueType("DebuggerTests.EvaluateTestsStructWithProperties")), @@ -169,7 +169,7 @@ public async Task EvaluateLocalsAsync() => await CheckInspectLocalsAtBreakpointS PointWithCustomGetter = TGetter("PointWithCustomGetter") }, "sc_arg_props#1"); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("(sc_arg.PointWithCustomGetter.X)", TNumber(100)), ("sc_arg.Id + \"_foo\"", TString($"sc#Id_foo")), ("sc_arg.Id + (sc_arg.X==10 ? \"_is_ten\" : \"_not_ten\")", TString($"sc#Id_is_ten"))); @@ -190,7 +190,7 @@ await EvaluateOnCallFrameAndCheck(id, Color = TEnum("DebuggerTests.RGB", "Red"), Value = TNumber(0) }, "local_gs_props#1"); - await EvaluateOnCallFrameAndCheck(id, ("(local_gs.Id)", TString(null))); + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("(local_gs.Id)", TString(null))); } }); @@ -207,7 +207,7 @@ public async Task EvaluateExpressionsWithDeepMemberAccesses(string prefix, int b var dateTime = new DateTime(2010, 9, 8, 7, 6, 5 + bias); var DTProp = dateTime.AddMinutes(10); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{prefix}a + 5", TNumber(9)), ($"10 + {prefix}IntProp", TNumber(19)), ($" {prefix}IntProp + {prefix}DTProp.Second", TNumber(9 + DTProp.Second)), @@ -232,7 +232,7 @@ public async Task InheritedAndPrivateMembersInAClass(string prefix) foreach (var pad in new[] { String.Empty, " " }) { var padded_prefix = pad + prefix; - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), // overridden ($"{padded_prefix}FirstName + \"_foo\"", TString("DerivedClass#FirstName_foo")), ($"{padded_prefix}DateTimeForOverride.Date.Year", TNumber(2190)), @@ -261,7 +261,7 @@ public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreak { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), // "((this))", TObject("foo")); //FIXME: // "((dt))", TObject("foo")); //FIXME: @@ -303,7 +303,7 @@ public async Task LocalsAndArgsShadowingThisMembers(string type_name, string met { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("a", TString("hello")), ("this.a", TNumber(4))); @@ -312,7 +312,7 @@ await EvaluateOnCallFrameAndCheck(id, async Task CheckExpressions(string prefix, DateTime dateTime) { - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), (prefix + "dateTime", TDateTime(dateTime)), (prefix + "dateTime.TimeOfDay.Minutes", TNumber(dateTime.TimeOfDay.Minutes)), (prefix + "dateTime.TimeOfDay", TValueType("System.TimeSpan", dateTime.TimeOfDay.ToString()))); @@ -333,22 +333,22 @@ public async Task EvaluateOnPreviousFrames(string type_name, bool is_valuetype) // At EvaluateShadow { var id0 = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id0, + await EvaluateOnCallFrameAndCheck(id0, sessionIdStr : pause_location["sessionId"].Value(), ("dateTime", TDateTime(dt_local)), ("this.dateTime", TDateTime(dt_this)) ); - await EvaluateOnCallFrameFail(id0, ("obj.IntProp", "ReferenceError")); + await EvaluateOnCallFrameFail(id0, sessionIdStr : pause_location["sessionId"].Value(), ("obj.IntProp", "ReferenceError")); } { var id1 = pause_location["callFrames"][1]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id1, + await EvaluateOnCallFrameFail(id1, sessionIdStr : pause_location["sessionId"].Value(), ("dateTime", "ReferenceError"), ("this.dateTime", "ReferenceError")); // obj available only on the -1 frame - await EvaluateOnCallFrameAndCheck(id1, ("obj.IntProp", TNumber(7))); + await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId"].Value(), ("obj.IntProp", TNumber(7))); } await SetBreakpointInMethod("debugger-test.dll", type_name, "SomeMethod", 1); @@ -363,7 +363,7 @@ await EvaluateOnCallFrameFail(id1, var id0 = pause_location["callFrames"][0]["callFrameId"].Value(); // 'me' and 'dateTime' are reversed in this method - await EvaluateOnCallFrameAndCheck(id0, + await EvaluateOnCallFrameAndCheck(id0, sessionIdStr : pause_location["sessionId"].Value(), ("dateTime", is_valuetype ? TValueType(type_name) : TObject(type_name)), ("this.dateTime", TDateTime(dt_this)), ("me", TDateTime(dt_local)), @@ -374,14 +374,14 @@ await EvaluateOnCallFrameAndCheck(id0, // access field via `this.` ("this.DTProp", TDateTime(dt_this.AddMinutes(10)))); - await EvaluateOnCallFrameFail(id0, ("obj", "ReferenceError")); + await EvaluateOnCallFrameFail(id0, sessionIdStr : pause_location["sessionId"].Value(), ("obj", "ReferenceError")); } // check frame1 { var id1 = pause_location["callFrames"][1]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id1, + await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId"].Value(), // 'me' and 'dateTime' are reversed in this method ("dateTime", TDateTime(dt_local)), ("this.dateTime", TDateTime(dt_this)), @@ -393,7 +393,7 @@ await EvaluateOnCallFrameAndCheck(id1, // access field via `this.` ("this.DTProp", TDateTime(dt_this.AddMinutes(10)))); - await EvaluateOnCallFrameFail(id1, ("obj", "ReferenceError")); + await EvaluateOnCallFrameFail(id1, sessionIdStr : pause_location["sessionId"].Value(), ("obj", "ReferenceError")); } // check frame2 @@ -401,12 +401,12 @@ await EvaluateOnCallFrameAndCheck(id1, var id2 = pause_location["callFrames"][2]["callFrameId"].Value(); // Only obj should be available - await EvaluateOnCallFrameFail(id2, + await EvaluateOnCallFrameFail(id2, sessionIdStr : pause_location["sessionId"].Value(), ("dateTime", "ReferenceError"), ("this.dateTime", "ReferenceError"), ("me", "ReferenceError")); - await EvaluateOnCallFrameAndCheck(id2, ("obj", is_valuetype ? TValueType(type_name) : TObject(type_name))); + await EvaluateOnCallFrameAndCheck(id2, sessionIdStr : pause_location["sessionId"].Value(), ("obj", is_valuetype ? TValueType(type_name) : TObject(type_name))); } }); @@ -425,7 +425,7 @@ public async Task JSEvaluate() var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id, + await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), ("me.foo", null), ("obj.foo.bar", null)); @@ -441,7 +441,7 @@ public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtB var id = pause_location["callFrames"][0]["callFrameId"].Value(); // Use '.' on a primitive member - await EvaluateOnCallFrameFail(id, + await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), //BUG: TODO: //("a)", "CompilationError"), @@ -467,7 +467,7 @@ public async Task NegativeTestsInStaticMethod() => await CheckInspectLocalsAtBre { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id, + await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), ("me.foo", "ReferenceError"), ("this", "CompilationError"), ("this.NullIfAIsNotZero.foo", "ReferenceError")); @@ -481,14 +481,14 @@ public async Task EvaluatePropertyThatThrows() wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, ("this.PropertyThrowException", TString("System.Exception: error"))); + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.PropertyThrowException", TString("System.Exception: error"))); }); - async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expression, string class_name)[] args) + async Task EvaluateOnCallFrameFail(string call_frame_id, string sessionIdStr, params (string expression, string class_name)[] args) { foreach (var arg in args) { - var (_, res) = await EvaluateOnCallFrame(call_frame_id, arg.expression, expect_ok: false); + var (_, res) = await EvaluateOnCallFrame(call_frame_id, arg.expression, expect_ok: false, sessionIdStr: sessionIdStr); if (arg.class_name != null) AssertEqual(arg.class_name, res.Error["result"]?["className"]?.Value(), $"Error className did not match for expression '{arg.expression}'"); } @@ -531,7 +531,7 @@ public async Task EvaluateSimpleMethodCallsWithoutParms() => await CheckInspectL { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.CallMethod()", TNumber(1)), ("this.CallMethod()", TNumber(1)), ("this.CallMethodReturningChar()", TChar('A')), @@ -549,7 +549,7 @@ public async Task EvaluateSimpleMethodCallsWithConstParms() => await CheckInspec { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.CallMethodWithParm(10)", TNumber(11)), ("this.CallMethodWithMultipleParms(10, 10)", TNumber(21)), ("this.CallMethodWithParmBool(true)", TString("TRUE")), @@ -573,7 +573,7 @@ public async Task EvaluateSimpleMethodCallsWithVariableParms() => await CheckIns { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.CallMethodWithParm(this.a)", TNumber(2)), ("this.CallMethodWithMultipleParms(this.a, 10)", TNumber(12)), ("this.CallMethodWithParmString(this.str)", TString("str_const_str_const_")), @@ -604,7 +604,7 @@ public async Task EvaluateIndexingsByConstant() => await CheckInspectLocalsAtBre { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.numList[0]", TNumber(1)), ("f.textList[1]", TString("2")), ("f.numArray[1]", TNumber(2)), @@ -619,7 +619,7 @@ public async Task EvaluateIndexingByLocalVariable() => await CheckInspectLocalsA { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.numList[i]", TNumber(1)), ("f.textList[j]", TString("2")), ("f.numArray[j]", TNumber(2)), @@ -634,7 +634,7 @@ public async Task EvaluateIndexingByExpression() => await CheckInspectLocalsAtBr wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.numList[i + 1]", TNumber(2)), ("f.textList[(2 * j) - 1]", TString("2")), ("f.textList[j - 1]", TString("1")), @@ -650,7 +650,7 @@ public async Task EvaluateIndexingByExpressionMultidimensional() => await CheckI wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.numArray2D[0, j - 1]", TNumber(1)), // 0, 0 ("f.numArray2D[f.idx1, i + j]", TNumber(4)), // 1, 1 ("f.numArray2D[(f.idx1 - j) * 5, i + j]", TNumber(2)), // 0, 1 @@ -690,7 +690,7 @@ public async Task EvaluateIndexingByMemberVariables() => await CheckInspectLocal { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.idx0", TNumber(0)), ("f.idx1", TNumber(1)), ("f.numList[f.idx0]", TNumber(1)), @@ -707,7 +707,7 @@ public async Task EvaluateIndexingNested() => await CheckInspectLocalsAtBreakpoi { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("f.idx0", TNumber(0)), ("f.numList[f.numList[f.idx0]]", TNumber(2)), ("f.textList[f.numList[f.idx0]]", TString("2")), @@ -724,7 +724,7 @@ public async Task EvaluateIndexingMultidimensional() => await CheckInspectLocals { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("j", TNumber(1)), ("f.idx1", TNumber(1)), ("f.numArray2D[0, 0]", TNumber(1)), @@ -789,7 +789,7 @@ public async Task EvaluateIndexingJagged() => await CheckInspectLocalsAtBreakpoi { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("j", TNumber(1)), ("f.idx1", TNumber(1)), ("f.numArrayOfArrays[1][1]", TNumber(2)), @@ -819,7 +819,7 @@ public async Task EvaluateSimpleMethodCallsCheckChangedValue() => await CheckIns var props = await GetObjectOnFrame(frame, "this"); CheckNumber(props, "a", 1); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.CallMethodChangeValue()", TObject("object", is_null : true))); frame = pause_location["callFrames"][0]; @@ -845,7 +845,7 @@ await CheckInspectLocalsAtBreakpointSite( var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}{namespaceName}.{className}.StaticField", TNumber(expectedInt * 10)), ($"{pad}{namespaceName}{pad}.{className}.{pad}StaticProperty", TString($"StaticProperty{expectedInt}")), ($"{namespaceName}.{pad}{className}.StaticPropertyWithError", TString($"System.Exception: not implemented {expectedInt}")), @@ -868,7 +868,7 @@ public async Task EvaluateStaticClassesNested() => await CheckInspectLocalsAtBre var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}DebuggerTests{pad}.EvaluateStaticFieldsInStaticClass.NestedClass1.{pad}NestedClass2.NestedClass3.{pad}StaticField", TNumber(3)), ($"{pad}DebuggerTests.EvaluateStaticFieldsInStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty", TString("StaticProperty3")), ($"{pad}{pad}DebuggerTests.{pad}EvaluateStaticFieldsInStaticClass.NestedClass1.NestedClass2.NestedClass3.{pad}StaticPropertyWithError", TString("System.Exception: not implemented 3")), @@ -887,7 +887,7 @@ public async Task EvaluateStaticClassesNestedWithNoNamespace() => await CheckIns var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}NoNamespaceClass.NestedClass1.NestedClass2.{pad}NestedClass3.StaticField", TNumber(30)), ($"NoNamespaceClass.NestedClass1.{pad}NestedClass2.NestedClass3.StaticProperty", TString("StaticProperty30")), ($"NoNamespaceClass.{pad}NestedClass1.NestedClass2.NestedClass3.{pad}StaticPropertyWithError", TString("System.Exception: not implemented 30"))); @@ -903,7 +903,7 @@ public async Task EvaluateStaticClassesNestedWithSameNames() => await CheckInspe var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}NestedWithSameNames", TNumber(90)), ($"B.{pad}NestedWithSameNames", TNumber(90)), ($"{pad}B.{pad}StaticField", TNumber(40)), @@ -943,7 +943,7 @@ await CheckInspectLocalsAtBreakpointSite( foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id_top, + await EvaluateOnCallFrameAndCheck(id_top, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}StaticField", TNumber(20)), ($"{pad}{namespaceName}.{pad}{className}.StaticField{pad}", TNumber(expectedInt * 10)), ($"{pad}StaticProperty", TString($"StaticProperty2")), @@ -954,14 +954,14 @@ await EvaluateOnCallFrameAndCheck(id_top, if (!isFromDifferentNamespace) { - await EvaluateOnCallFrameAndCheck(id_top, + await EvaluateOnCallFrameAndCheck(id_top, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}{className}.StaticField", TNumber(expectedInt * 10)), ($"{className}{pad}.StaticProperty{pad}", TString($"StaticProperty{expectedInt}")), ($"{className}{pad}.{pad}StaticPropertyWithError", TString($"System.Exception: not implemented {expectedInt}")) ); } - await EvaluateOnCallFrameAndCheck(id_second, + await EvaluateOnCallFrameAndCheck(id_second, sessionIdStr : pause_location["sessionId"].Value(), ($"{pad}{namespaceName}.{pad}{className}.{pad}StaticField", TNumber(expectedInt * 10)), ($"{pad}{className}.StaticField", TNumber(expectedIntInPrevFrame * 10)), ($"{namespaceName}{pad}.{pad}{className}.StaticProperty", TString($"StaticProperty{expectedInt}")), @@ -1000,15 +1000,15 @@ public async Task AsyncLocalsInContinueWithBlock() => await CheckInspectLocalsAt "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr: pause_location["sessionId"].Value()); var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ($"t.Status", TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion")), ($" t.Status", TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion")) ); - await EvaluateOnCallFrameFail(id, + await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), ("str", "ReferenceError"), (" str", "ReferenceError") ); @@ -1266,7 +1266,7 @@ public async Task EvaluateMethodWithDefaultParam() => await CheckInspectLocalsAt wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("test.GetByte()", TNumber(1)), ("test.GetSByte()", TNumber(1)), ("test.GetByteNullable()", TNumber(1)), @@ -1324,7 +1324,7 @@ public async Task EvaluateMethodWithLinq() => await CheckInspectLocalsAtBreakpoi wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("test.listToLinq.ToList()", TObject("System.Collections.Generic.List", description: "Count = 11")) ); }); @@ -1339,7 +1339,7 @@ public async Task EvaluateNullObjectPropertiesPositive() => await CheckInspectLo // we have no way of returning int? for null values, // so we return the last non-null class name - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("list.Count", TNumber(1)), ("list!.Count", TNumber(1)), ("list?.Count", TNumber(1)), @@ -1395,7 +1395,7 @@ public async Task EvaluateMethodsOnPrimitiveTypesReturningPrimitives() => await wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("test.propInt.ToString()", TString("12")), ("test.propUint.ToString()", TString("12")), ("test.propLong.ToString()", TString("12")), @@ -1434,7 +1434,7 @@ await CheckInspectLocalsAtBreakpointSite( // expected value depends on the debugger's user culture and is equal to // description of the number that also respects user's culture settings - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("test.propFloat.ToString()", TString(floatMemberVal["description"]?.Value())), ("test.propDouble.ToString()", TString(doubleMemberVal["description"]?.Value())), @@ -1472,7 +1472,7 @@ await CheckInspectLocalsAtBreakpointSite( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("localString", TString($"{pauseMethod}()")), ("this", TObject("DIMClass")), ("this.dimClassMember", TNumber(123))); @@ -1488,7 +1488,7 @@ await CheckInspectLocalsAtBreakpointSite( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("localString", TString($"{pauseMethod}()")), ("IDefaultInterface.defaultInterfaceMember", TString("defaultInterfaceMember")), ("defaultInterfaceMember", TString("defaultInterfaceMember")) @@ -1502,7 +1502,7 @@ public async Task EvaluateStringProperties() => await CheckInspectLocalsAtBreakp wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("localString.Length", TNumber(5)), ("localString[1]", TChar('B')), ("instance.str.Length", TNumber(5)), diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs b/src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs index 47a2ba64b57e2..4362ff6935f7f 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs @@ -111,7 +111,7 @@ await SendCommand("attach", JObject.FromObject(new if (res["type"]?.Value() == "newSource") { var method = res["type"]?.Value(); - return onEvent(method, res, token); + return onEvent("", method, res, token); } if (res["type"]?.Value() == "target-available-form" && res["target"] is JObject target) @@ -178,7 +178,7 @@ await SendCommand("attach", JObject.FromObject(new break; } } - return onEvent(method, res, token); + return onEvent("", method, res, token); } return null; } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs index 3bf376c8954de..734eceb994541 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs @@ -437,7 +437,7 @@ public async Task GetObjectValueWithInheritance() GetK = TGetter("GetK", TNumber(30)), GetD = TGetter("GetD", TDateTime(new DateTime(2020, 7, 6, 5, 4, 3))) }, "test_props"); - await EvaluateOnCallFrameAndCheck(frame_id, + await EvaluateOnCallFrameAndCheck(frame_id, sessionIdStr : pause_location["sessionId"].Value(), ($"test.GetJ", TNumber(20)), ($"test.GetI", TNumber(50)), ($"test.GetK", TNumber(30)) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs index eec98fcbd1902..21d72dfc4e1a5 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs @@ -75,14 +75,14 @@ public async Task DebugHotReloadMethodAddBreakpoint(string assembly_name) await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 31, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 32, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -90,7 +90,7 @@ await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs" } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 33, 8, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -116,14 +116,14 @@ public async Task DebugHotReloadMethodEmpty() pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -131,7 +131,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -139,7 +139,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -147,7 +147,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -259,14 +259,14 @@ public async Task DebugHotReloadMethodAddBreakpointUsingSDB(string assembly_name await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 31, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 32, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -274,7 +274,7 @@ await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs" } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 33, 8, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -301,14 +301,14 @@ public async Task DebugHotReloadMethodEmptyUsingSDB() asm_file_hot_reload, "MethodBody4", "StaticMethod4", 1); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -316,7 +316,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -324,7 +324,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -332,7 +332,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -437,7 +437,7 @@ public async Task DebugHotReloadMethod_AddingNewMethod() AssertEqual("ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", top_frame?["functionName"]?.Value(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 59, 12, scripts, top_frame["location"]); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 60, 12, "ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 20); await Task.CompletedTask; @@ -468,13 +468,13 @@ public async Task DebugHotReloadMethod_AddingNewStaticField() CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 59, 12, scripts, top_frame["location"]); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 61, 12, "ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "i", 20); await Task.CompletedTask; }, times: 2 ); - await EvaluateOnCallFrameAndCheck(top_frame["callFrameId"].Value(), + await EvaluateOnCallFrameAndCheck(top_frame["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody6.newStaticField", TNumber(10))); } @@ -504,7 +504,7 @@ public async Task DebugHotReloadMethod_AddingNewClass() CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 73, 12, scripts, top_frame["location"]); pause_location = await StepAndCheck(StepKind.Resume, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 83, 12, "ApplyUpdateReferencedAssembly.MethodBody7.InstanceMethod", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "aLocal", 50); await Task.CompletedTask; @@ -516,7 +516,7 @@ public async Task DebugHotReloadMethod_AddingNewClass() CheckNumber(props, "attr1", 15); await CheckString(props, "attr2", "20"); - await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), + await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody7.staticField", TNumber(80))); //apply second update @@ -527,7 +527,7 @@ await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId" AssertEqual("ApplyUpdateReferencedAssembly.MethodBody8.InstanceMethod", top_frame?["functionName"]?.Value(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 102, 12, scripts, top_frame["location"]); - await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), + await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody8.staticField", TNumber(80))); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index fd0ce3009c86b..81ad71d856835 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -101,13 +101,13 @@ public void ClearWaiterFor(string what) notifications.Remove(what, out _); } - void NotifyOf(string what, JObject args) + void NotifyOf(string what, string sessionId, JObject args) { + args.Add("sessionId", sessionId); if (notifications.TryGetValue(what, out TaskCompletionSource? tcs)) { if (tcs.Task.IsCompleted) throw new Exception($"Invalid internal state. Notifying for {what} again, but the previous one hasn't been read."); - notifications[what].SetResult(args); notifications.Remove(what, out _); } @@ -194,31 +194,34 @@ void FailAllWaiters(Exception? exception = null) return ($"console.{type}: {output}", type); } - async Task OnMessage(string method, JObject args, CancellationToken token) + async Task OnMessage(string sessionId, string method, JObject args, CancellationToken token) { bool fail = false; switch (method) { case "Target.attachedToTarget": { - var sessionId = new SessionId(args["sessionId"]?.Value()); - await Client.SendCommand(sessionId, "Profiler.enable", null, token); - await Client.SendCommand(sessionId, "Runtime.enable", null, token); - await Client.SendCommand(sessionId, "Debugger.enable", null, token); - await Client.SendCommand(sessionId, "Runtime.runIfWaitingForDebugger", null, token); - await Client.SendCommand(sessionId, "Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32}), token); + var sessionIdNewTarget = new SessionId(args["sessionId"]?.Value()); + await Client.SendCommand(sessionIdNewTarget, "Profiler.enable", null, token); + await Client.SendCommand(sessionIdNewTarget, "Runtime.enable", null, token); + await Client.SendCommand(sessionIdNewTarget, "Debugger.enable", null, token); + await Client.SendCommand(sessionIdNewTarget, "Runtime.runIfWaitingForDebugger", null, token); + await Client.SendCommand(sessionIdNewTarget, "Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32}), token); break; } case "Debugger.paused": - NotifyOf(PAUSE, args); + { + Console.WriteLine($"debugger.paused - {sessionId}"); + NotifyOf(PAUSE, sessionId, args); break; + } case "Mono.runtimeReady": { _gotRuntimeReady = true; if (_gotAppReady || !DebuggerTestBase.RunningOnChrome) { // got both the events - NotifyOf(APP_READY, args); + NotifyOf(APP_READY, sessionId, args); } break; } @@ -242,7 +245,7 @@ async Task OnMessage(string method, JObject args, CancellationToken token) if (_gotRuntimeReady) { // got both the events - NotifyOf(APP_READY, args); + NotifyOf(APP_READY, sessionId, args); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs index 827a557bd9ce6..c1f58ccb39f72 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs @@ -18,7 +18,7 @@ namespace DebuggerTests internal class InspectorClient : DevToolsClient { protected Dictionary> pending_cmds = new Dictionary>(); - protected Func onEvent; + protected Func onEvent; protected int next_cmd_id; public InspectorClient(ILogger logger) : base(logger) { } @@ -34,7 +34,7 @@ protected virtual Task HandleMessage(string msg, CancellationToken token) var res = JObject.Parse(msg); if (res["id"] == null) - return onEvent(res["method"].Value(), res["params"] as JObject, token); + return onEvent(res["sessionId"]?.Value(), res["method"].Value(), res["params"] as JObject, token); var id = res.ToObject(); if (!pending_cmds.Remove(id, out var item)) @@ -51,7 +51,7 @@ public virtual async Task ProcessCommand(Result command, CancellationToken token public virtual async Task Connect( Uri uri, - Func onEvent, + Func onEvent, CancellationTokenSource cts) { this.onEvent = onEvent; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index a22b82a5d8d88..3dde9f1107f39 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -68,7 +68,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", "window.setTimeout(function() { invoke_add(); }, 1);", use_cfo: use_cfo, - test_fn: async (locals) => + test_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -84,7 +84,7 @@ public async Task InspectPrimitiveTypeLocalsAtBreakpointSite() => await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 154, 8, "Math.PrimitiveTypesTest", "window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:PrimitiveTypesTest'); }, 1);", - test_fn: async (locals) => + test_fn: async (locals, sessionIdStr) => { await CheckSymbol(locals, "c0", '€'); await CheckSymbol(locals, "c1", 'A'); @@ -98,7 +98,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test2.cs", 50, 8, "Fancy.Types", "window.setTimeout(function() { invoke_static_method (\"[debugger-test] Fancy:Types\")(); }, 1);", use_cfo: false, - test_fn: async (locals) => + test_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "dPI", Math.PI); CheckNumber(locals, "fPI", (float)Math.PI); @@ -204,7 +204,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 74, 8, "Math.GenericTypesTest", "window.setTimeout(function() { invoke_generic_types_test (); }, 1);", use_cfo: use_cfo, - test_fn: async (locals) => + test_fn: async (locals, sessionIdStr) => { await CheckObject(locals, "list", "System.Collections.Generic.Dictionary", description: "Count = 0"); await CheckObject(locals, "list_null", "System.Collections.Generic.Dictionary", is_null: true); @@ -867,7 +867,7 @@ public async Task InspectTaskAtLocals() => await CheckInspectLocalsAtBreakpointS $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] InspectTask:RunInspectTask'); }}, 1);", wait_for_event_fn: async (pause_location) => { - var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr: pause_location["sessionId"].Value()); CheckNumber(locals, "a", 10); var t_props = await GetObjectOnLocals(locals, "t"); @@ -885,7 +885,7 @@ await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] MainPage:CallSetValue'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 758, 16, "MainPage.set_SomeValue", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "view", 150); await Task.CompletedTask; @@ -1034,7 +1034,7 @@ await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 1258, 8, $"InspectIntPtr.Run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckValueType(locals, "myInt", "System.IntPtr"); await CheckValueType(locals, "myInt2", "System.IntPtr"); @@ -1058,7 +1058,7 @@ await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", line, 8, $"{class_name}.CallMethod", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { var this_props = await GetObjectOnLocals(locals, "this"); if (jmc) @@ -1117,13 +1117,13 @@ await EvaluateAndCheck( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("parameters.ToString()", TString("System.ReadOnlySpan[1]")) ); } ); await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1363, 8, "ReadOnlySpanTest.Run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckValueType(locals, "var1", "System.ReadOnlySpan", description: "System.ReadOnlySpan[0]"); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs index f19f5a556a3cf..11697e5678607 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs @@ -36,24 +36,28 @@ async Task CheckLocalsAsync(JToken locals, int c, int d, int e, bool f) "Math.IntAdd" ); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, false)); + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, false)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 13, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, true)); - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, true)); + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, true), + sessionIdStr : pause_location["sessionId"].Value()); + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd", + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, true)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 0, true)); - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 11, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 0, true)); + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 0, true), + sessionIdStr : pause_location["sessionId"].Value()); + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 11, 8, "Math.IntAdd", + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 0, true)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", - locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 10, true)); + locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 10, true), + sessionIdStr : pause_location["sessionId"].Value()); //to check that after moving the execution pointer to the same line that there is already //a breakpoint, the breakpoint continue working pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, - "Math.IntAdd"); + "Math.IntAdd" , + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -66,16 +70,17 @@ public async Task OutsideTheCurrentMethod() "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd"); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 20, 8, "Math.IntAdd", + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 20, 8, "Math.IntAdd", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "c", 30); CheckNumber(locals, "d", 0); CheckNumber(locals, "e", 0); await CheckBool(locals, "f", false); - }); + }, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -88,7 +93,7 @@ public async Task AsyncMethod() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_async_method_with_await(); }, 1);", debugger_test_loc, 140, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); @@ -96,24 +101,25 @@ public async Task AsyncMethod() } ); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 141, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals) => + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 141, 12, "Math.NestedInMath.AsyncTest", + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); await CheckString(locals, "ls", null); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 142, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); await CheckString(locals, "ls", "string from jstest"); - }); + }, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] - public async Task Lambda() + public async Task Lambda2() { var debugger_test_loc = "dotnet://debugger-test.dll/debugger-async-test.cs"; @@ -121,41 +127,43 @@ public async Task Lambda() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 80, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); - }); - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); + }, + sessionIdStr : pause_location["sessionId"].Value()); + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); - }); + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); + }, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -167,24 +175,25 @@ public async Task Lambda_InvalidLocation() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 8, "MoveNext", + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 8, "MoveNext", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2); + times: 2, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -196,7 +205,7 @@ public async Task Lambda_ToNestedLambda() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -204,17 +213,18 @@ public async Task Lambda_ToNestedLambda() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 88, 20, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 88, 20, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2); + times: 2, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -226,7 +236,7 @@ public async Task Lambda_ToNestedSingleLineLambda_Invalid() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -234,17 +244,18 @@ public async Task Lambda_ToNestedSingleLineLambda_Invalid() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 58, "MoveNext", + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 58, "MoveNext", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2); + times: 2, + sessionIdStr : pause_location["sessionId"].Value()); } [ConditionalFact(nameof(RunningOnChrome))] @@ -256,7 +267,7 @@ public async Task Lambda_ToNestedSingleLineLambda_Valid() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -264,8 +275,8 @@ public async Task Lambda_ToNestedSingleLineLambda_Valid() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -273,11 +284,12 @@ await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugge }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); - }); + }, + sessionIdStr : pause_location["sessionId"].Value()); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs index b93a525b012c4..313b06abd7ed6 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs @@ -36,7 +36,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -47,7 +47,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -59,7 +59,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=overflowValue}) }), false); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -75,7 +75,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -86,7 +86,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -98,7 +98,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue2); await Task.CompletedTask; @@ -114,7 +114,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -125,7 +125,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -137,7 +137,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue2); await Task.CompletedTask; @@ -164,7 +164,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumberAsString(locals, variableName, originalValue.ToString()); await Task.CompletedTask; @@ -175,7 +175,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumberAsString(locals, variableName, newValue.ToString()); await Task.CompletedTask; @@ -187,7 +187,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumberAsString(locals, variableName, newValue2.ToString()); await Task.CompletedTask; @@ -206,7 +206,7 @@ public async Task SetLocalPrimitiveTypeVariable(int offset, string variableName, var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -217,7 +217,7 @@ public async Task SetLocalPrimitiveTypeVariable(int offset, string variableName, await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -236,7 +236,7 @@ public async Task SetVariableValuesAtBreakpointSiteFail(int offset, string varia var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -247,7 +247,7 @@ public async Task SetVariableValuesAtBreakpointSiteFail(int offset, string varia await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=invalidValue}) }), false); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -263,7 +263,7 @@ public async Task SetLocalBoolTypeVariable(int offset, string variableName, bool var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckBool(locals, variableName, originalValue); } @@ -273,7 +273,7 @@ public async Task SetLocalBoolTypeVariable(int offset, string variableName, bool await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 4, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { await CheckBool(locals, variableName, newValue); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs index 334da4f6f15a5..3542cbe508b26 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs @@ -54,7 +54,7 @@ public async Task InspectLocalsDuringStepping() await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", debugger_test_loc, 10, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -66,7 +66,7 @@ await EvaluateAndCheck( ); await StepAndCheck(StepKind.Over, debugger_test_loc, 11, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -79,7 +79,7 @@ await StepAndCheck(StepKind.Over, debugger_test_loc, 11, 8, "Math.IntAdd", //step and get locals await StepAndCheck(StepKind.Over, debugger_test_loc, 12, 8, "Math.IntAdd", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -107,7 +107,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn2(bool use_cfo) var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_use_complex (); }, 1);", dep_cs_loc, 35, 8, "Simple.Complex.DoEvenMoreStuff", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Single(locals); await CheckObject(locals, "this", "Simple.Complex"); @@ -172,7 +172,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn(bool use_cfo) var wait_res = await EvaluateAndCheck( "window.setTimeout(function() { invoke_outer_method(); }, 1);", debugger_test_loc, 111, 12, "Math.NestedInMath.InnerMethod", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(4, locals.Count()); CheckNumber(locals, "i", 5); @@ -207,7 +207,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn(bool use_cfo) // step back into OuterMethod await StepAndCheck(StepKind.Over, debugger_test_loc, 91, 8, "Math.OuterMethod", times: 6, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(5, locals.Count()); @@ -223,7 +223,7 @@ await StepAndCheck(StepKind.Over, debugger_test_loc, 91, 8, "Math.OuterMethod", // step into InnerMethod2 await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 96, 4, "Math.InnerMethod2", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(3, locals.Count()); @@ -235,7 +235,7 @@ await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 100, 4, "Math.InnerMethod2", times: 4, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(3, locals.Count()); @@ -247,7 +247,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 92, 8, "Math.OuterMethod", times: 1, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(5, locals.Count()); @@ -267,7 +267,7 @@ public async Task InspectLocalsDuringSteppingIn() await EvaluateAndCheck("window.setTimeout(function() { invoke_outer_method(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 86, 8, "Math.OuterMethod", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(5, locals.Count()); @@ -280,7 +280,7 @@ public async Task InspectLocalsDuringSteppingIn() ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 87, 8, "Math.OuterMethod", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(5, locals.Count()); @@ -296,7 +296,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", // Step into InnerMethod await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 105, 8, "Math.NestedInMath.InnerMethod"); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 110, 12, "Math.NestedInMath.InnerMethod", times: 5, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(4, locals.Count()); @@ -310,7 +310,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", // Step back to OuterMethod await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 90, 8, "Math.OuterMethod", times: 6, - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(5, locals.Count()); @@ -338,7 +338,7 @@ public async Task InspectLocalsInAsyncMethods(bool use_cfo) var wait_res = await EvaluateAndCheck( "window.setTimeout(function() { invoke_async_method_with_await(); }, 1);", debugger_test_loc, 120, 12, "Math.NestedInMath.AsyncMethod0", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(4, locals.Count()); await CheckString(locals, "s", "string from js"); @@ -359,7 +359,7 @@ public async Task InspectLocalsInAsyncMethods(bool use_cfo) // TODO: previous frames have async machinery details, so no point checking that right now var pause_loc = await SendCommandAndCheck(null, "Debugger.resume", debugger_test_loc, 135, 12, "Math.NestedInMath.AsyncMethodNoReturn", - locals_fn: async (locals) => + locals_fn: async (locals, sessionIdStr) => { Assert.Equal(4, locals.Count()); await CheckString(locals, "str", "AsyncMethodNoReturn's local"); @@ -430,7 +430,7 @@ public async Task InspectValueTypeMethodArgsWhileStepping(bool use_cfo) } pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 40, 8, "DebuggerTests.ValueTypesTest.MethodWithStructArgs", times: 4, - locals_fn: async (l) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); + locals_fn: async (l, sessionIdStr) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); { Assert.Equal(3, locals.Count()); @@ -482,7 +482,7 @@ public async Task InspectValueTypeMethodArgsWhileStepping(bool use_cfo) // ----------- Step back to the caller --------- pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 30, 12, "DebuggerTests.ValueTypesTest.TestStructsAsMethodArgs", - times: 1, locals_fn: async (l) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); + times: 1, locals_fn: async (l, sessionIdStr) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(locals, new { @@ -716,7 +716,7 @@ await EvaluateAndCheck( await StepAndCheck(StepKind.Out, source_file, 15, 4, "TestAsyncStepOut"); } - [Fact] + [ConditionalFact(nameof(WasmSingleThreaded))] public async Task ResumeOutOfAsyncMethodToAsyncCallerWithBreakpoint() { string source_file = "dotnet://debugger-test.dll/debugger-async-step.cs"; @@ -931,10 +931,10 @@ await EvaluateAndCheck( "Foo.RunBart"); var pause_location = await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 671, 4, "Foo.Bart"); var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, ("this.Bar", TString("Same of something"))); + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.Bar", TString("Same of something"))); pause_location = await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 673, 8, "Foo.Bart"); id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, ("this.Bar", TString("Same of something"))); + await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.Bar", TString("Same of something"))); } [Fact] @@ -1038,7 +1038,7 @@ await EvaluateAndCheck( ); } - [ConditionalFact(nameof(WasmEnableThreads))] + [ConditionalFact(nameof(WasmMultiThreaded))] public async Task TestDebugUsingMultiThreadedRuntime() { //TODO WRITE HERE A TEST LIKE THE SAMPLE AND CHECK IF IT'S PAUSING IN ALL THREADS CORRECTLY From be15c98cd4a1263f850cc5c51ecdce2bf89ffeaa Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Wed, 19 Oct 2022 18:12:27 -0300 Subject: [PATCH 24/46] Fix CI. --- eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml | 2 +- eng/pipelines/runtime-wasm-dbgtests.yml | 2 +- src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs | 1 - .../debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index ff85ae1b3ab2f..7c5fd1de9fe2b 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -218,7 +218,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true /e:WASM_TESTS_USING_VARIANT=multithreaded + extraBuildArgs: /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded alwaysRun: true # always run when invoked manually isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} diff --git a/eng/pipelines/runtime-wasm-dbgtests.yml b/eng/pipelines/runtime-wasm-dbgtests.yml index 64cf092793e0c..ad6ec7ca566a8 100644 --- a/eng/pipelines/runtime-wasm-dbgtests.yml +++ b/eng/pipelines/runtime-wasm-dbgtests.yml @@ -24,7 +24,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true /e:WASM_TESTS_USING_VARIANT=multithreaded + extraBuildArgs: /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index 81ad71d856835..2f87deb18e59d 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -211,7 +211,6 @@ async Task OnMessage(string sessionId, string method, JObject args, Cancellation } case "Debugger.paused": { - Console.WriteLine($"debugger.paused - {sessionId}"); NotifyOf(PAUSE, sessionId, args); break; } diff --git a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj index 8a0a2e95de496..6abfc89aa19b9 100644 --- a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj +++ b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj @@ -56,6 +56,7 @@ <_DotnetCommand Condition="'$(OS)' == 'Windows_NT'">dotnet.exe $(_DotnetCommand) test DebuggerTestSuite/DebuggerTestSuite.dll + $(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded $(RunScriptCommand) "-l:trx%3BLogFileName=testResults.trx" $(RunScriptCommand) --results-directory "$TEST_LOG_PATH" From 369f9250b9250ff5991c5a5107e0e041c551962c Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 20 Oct 2022 19:16:05 -0300 Subject: [PATCH 25/46] Addressing @radical comments Adding a test case. --- .../debugger/DebuggerTestSuite/ArrayTests.cs | 2 +- .../DebuggerTestSuite/AssignmentTests.cs | 4 +- .../debugger/DebuggerTestSuite/AsyncTests.cs | 18 +-- .../DebuggerTestSuite/BreakpointTests.cs | 26 ++-- .../DebuggerTestSuite/CustomViewTests.cs | 4 +- .../DebuggerTestSuite/DateTimeTests.cs | 2 +- .../DebuggerTestSuite/DebuggerTestBase.cs | 93 +++++++------- .../DebuggerTestSuite/DebuggerTestFirefox.cs | 14 +-- .../EvaluateOnCallFrameTests.cs | 114 +++++++++--------- .../DebuggerTestSuite/GetPropertiesTests.cs | 2 +- .../DebuggerTestSuite/HotReloadTests.cs | 44 +++---- .../debugger/DebuggerTestSuite/Inspector.cs | 28 +++-- .../DebuggerTestSuite/InspectorClient.cs | 5 +- .../debugger/DebuggerTestSuite/MiscTests.cs | 55 +++++++-- .../DebuggerTestSuite/SetNextIpTests.cs | 108 ++++++++--------- .../SetVariableValueTests.cs | 36 +++--- .../DebuggerTestSuite/SteppingTests.cs | 46 +++---- .../tests/debugger-test/debugger-test.cs | 24 ++++ 18 files changed, 337 insertions(+), 288 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs index c4c5de0361d35..ff0712e320377 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs @@ -589,7 +589,7 @@ public async Task InvalidArrayId() => await CheckInspectLocalsAtBreakpointSite( public async Task InvalidAccessors() => await CheckInspectLocalsAtBreakpointSite( "DebuggerTests.Container", "PlaceholderMethod", 1, "DebuggerTests.Container.PlaceholderMethod", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ArrayTestsClass:ObjectArrayMembers'); }, 1);", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { var this_obj = GetAndAssertObjectWithName(locals, "this"); var this_obj_id = this_obj["value"]?["objectId"]?.Value(); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs index ed30423421bdc..ea2fc12f67e08 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs @@ -57,7 +57,7 @@ public async Task InspectVariableBeforeAndAfterAssignment(string clazz, JObject // 1) check un-assigned variables await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, methodName, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { int numLocals = locals.Count(); if (numLocals != 2) @@ -69,7 +69,7 @@ await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-assignmen // 2) check assigned variables await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, methodName, times: 3, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { int numLocals = locals.Count(); if (numLocals != 2) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs index f64532ca159fb..17d29d62bab84 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs @@ -30,14 +30,14 @@ public async Task AsyncLocalsInContinueWith(string method_name, string expected_ "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), code = TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests.<>c"), dt = TDateTime(new DateTime(4513, 4, 5, 6, 7, 8)) - }, "locals", sessionIdStr : pause_location["sessionId"].Value()); + }, "locals"); var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status"); await CheckValue(res.Value["result"], TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), "t.Status"); @@ -49,20 +49,20 @@ public async Task AsyncLocalsInContinueWithInstanceUsingThisBlock() => await Che "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), code = TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), dt = TDateTime(new DateTime(4513, 4, 5, 6, 7, 8)), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests") - }, "locals", sessionIdStr : pause_location["sessionId"].Value()); + }, "locals"); - var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status", sessionIdStr : pause_location["sessionId"].Value()); + var res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "t"), "Status"); await CheckValue(res.Value["result"], TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion"), "t.Status"); - res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "this"), "Date", sessionIdStr : pause_location["sessionId"].Value()); - await CheckValue(res.Value["result"], TDateTime(new DateTime(2510, 1, 2, 3, 4, 5)), "this.Date", sessionIdStr : pause_location["sessionId"].Value()); + res = await InvokeGetter(GetAndAssertObjectWithName(frame_locals, "this"), "Date"); + await CheckValue(res.Value["result"], TDateTime(new DateTime(2510, 1, 2, 3, 4, 5)), "this.Date"); }); [Fact] // NestedContinueWith @@ -71,7 +71,7 @@ public async Task AsyncLocalsInNestedContinueWithStaticBlock() => await CheckIns "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(frame_locals, new { t = TObject("System.Threading.Tasks.Task.DelayPromise"), @@ -79,7 +79,7 @@ public async Task AsyncLocalsInNestedContinueWithStaticBlock() => await CheckIns str = TString("foobar"), @this = TObject("DebuggerTests.AsyncTests.ContinueWithTests.<>c__DisplayClass4_0"), ncs_dt0 = TDateTime(new DateTime(3412, 4, 6, 8, 0, 2)) - }, "locals", sessionIdStr : pause_location["sessionId"].Value()); + }, "locals"); }); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index 7167d142fe38a..2e7a904280ca0 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -270,35 +270,35 @@ await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);", "dotnet://debugger-test.dll/debugger-test2.cs", 58, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 59, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 60, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 61, 8, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 50); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 62, 4, "UserBreak.BreakOnDebuggerBreakCommand", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 100); await Task.CompletedTask; @@ -346,7 +346,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; @@ -371,7 +371,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; @@ -383,7 +383,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; @@ -394,7 +394,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 6); await Task.CompletedTask; @@ -405,7 +405,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 9); await Task.CompletedTask; @@ -442,7 +442,7 @@ await EvaluateAndCheck( bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; @@ -454,7 +454,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 1); await Task.CompletedTask; @@ -465,7 +465,7 @@ await SendCommandAndCheck(null, "Debugger.resume", bp_conditional.Value["locations"][0]["lineNumber"].Value(), bp_conditional.Value["locations"][0]["columnNumber"].Value(), "LoopClass.LoopToBreak", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 2); await Task.CompletedTask; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs index c984da8f51117..48f4f0a70804c 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs @@ -65,7 +65,7 @@ public async Task UsingDebuggerTypeProxy() props = await GetObjectOnFrame(frame, "openWith"); Assert.Equal(1, props.Count()); - await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(frame["callFrameId"].Value(), ("listToTestToList.ToList()", TObject("System.Collections.Generic.List", description: "Count = 11"))); } @@ -119,7 +119,7 @@ await EvaluateAndCheck( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("a", TObject("ToStringOverriden", description:"helloToStringOverriden")), ("b", TObject("ToStringOverriden.ToStringOverridenB", description:"helloToStringOverridenA")), ("c", TObject("ToStringOverriden.ToStringOverridenD", description:"helloToStringOverridenD")), diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs index 632902c015e8b..9963b2b05d33a 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs @@ -29,7 +29,7 @@ public async Task CheckDateTimeLocale(string locale, string fdtp, string ldp, st "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.DateTimeTest:LocaleTest'," + $"'{locale}'); }}, 1);", debugger_test_loc, 25, 12, "DebuggerTests.DateTimeTest.LocaleTest", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(locale).DateTimeFormat; CultureInfo.CurrentCulture = new CultureInfo(locale, false); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index b93fe14a44bdb..7a3be48a31e89 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -201,7 +201,7 @@ protected Task DefaultScriptParsedHandler(JObject ar } internal async Task CheckInspectLocalsAtBreakpointSite(string url_key, int line, int column, string function_name, string eval_expression, - Func test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false) + Func test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false) { UseCallFunctionOnBeforeGetProperties = use_cfo; @@ -224,10 +224,10 @@ await EvaluateAndCheck( else await Task.CompletedTask; }, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { if (test_fn != null) - await test_fn(locals, sessionIdStr); + await test_fn(locals); } ); } @@ -288,7 +288,7 @@ public async Task WaitForScriptParsedEventsAsync(params string[] paths) // sets breakpoint by method name and line offset internal async Task CheckInspectLocalsAtBreakpointSite(string type, string method, int line_offset, string bp_function_name, string eval_expression, - Func locals_fn = null, Func wait_for_event_fn = null, bool use_cfo = false, string assembly = "debugger-test.dll", int col = 0) + Func locals_fn = null, Func wait_for_event_fn = null, bool use_cfo = false, string assembly = "debugger-test.dll", int col = 0) { UseCallFunctionOnBeforeGetProperties = use_cfo; @@ -315,8 +315,8 @@ internal async Task CheckInspectLocalsAtBreakpointSite(string type, string metho if (locals_fn != null) { - var locals = await GetProperties(pause_location?["callFrames"]?[0]?["callFrameId"]?.Value(), sessionIdStr : pause_location?["sessionId"]?.Value()); - await locals_fn(locals, pause_location?["sessionId"]?.Value()); + var locals = await GetProperties(pause_location?["callFrames"]?[0]?["callFrameId"]?.Value()); + await locals_fn(locals); } } @@ -407,24 +407,24 @@ internal async Task CheckPointerValue(JToken locals, string name, JToken return l; } - internal async Task CheckDateTime(JToken value, DateTime expected, string label = "", string sessionIdStr = null) + internal async Task CheckDateTime(JToken value, DateTime expected, string label = "") { await CheckValue(value, TValueType("System.DateTime", expected.ToString()), label); - await CheckDateTimeValue(value, expected, label, sessionIdStr); + await CheckDateTimeValue(value, expected, label); } - internal async Task CheckDateTime(JToken locals, string name, DateTime expected, string label = "", string sessionIdStr = null) + internal async Task CheckDateTime(JToken locals, string name, DateTime expected, string label = "") { var obj = GetAndAssertObjectWithName(locals, name, label); - await CheckDateTimeValue(obj["value"], expected, label, sessionIdStr); + await CheckDateTimeValue(obj["value"], expected, label); } - async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "", string sessionIdStr = null) + async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "") { AssertEqual("System.DateTime", v["className"]?.Value(), $"{label}#className"); AssertEqual(exp_dt.ToString(), v["description"]?.Value(), $"{label}#description"); - var members = await GetProperties(v["objectId"]?.Value(), sessionIdStr : sessionIdStr); + var members = await GetProperties(v["objectId"]?.Value()); // not checking everything CheckNumber(members, "Year", exp_dt.Year); @@ -435,17 +435,17 @@ async Task CheckDateTimeMembers(JToken v, DateTime exp_dt, string label = "", st CheckNumber(members, "Second", exp_dt.Second); } - internal virtual async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "", string sessionIdStr = null) + internal virtual async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "") { - var res = await InvokeGetter(JObject.FromObject(new { value = value }), "Date", sessionIdStr: sessionIdStr); - await CheckDateTimeMembers(res.Value["result"], expected.Date, label, sessionIdStr); + var res = await InvokeGetter(JObject.FromObject(new { value = value }), "Date"); + await CheckDateTimeMembers(res.Value["result"], expected.Date, label); } - internal async Task CheckDateTimeValue(JToken value, DateTime expected, string label = "", string sessionIdStr = null) + internal async Task CheckDateTimeValue(JToken value, DateTime expected, string label = "") { - await CheckDateTimeMembers(value, expected, label, sessionIdStr); + await CheckDateTimeMembers(value, expected, label); - await CheckDateTimeGetter(value, expected, label, sessionIdStr); + await CheckDateTimeGetter(value, expected, label); } internal async Task CheckBool(JToken locals, string name, bool expected) @@ -531,7 +531,7 @@ internal async Task RunUntil(string methodName) return wait_res; } - internal async Task InvokeGetter(JToken obj, object arguments, string fn = "function(e){return this[e]}", bool expect_ok = true, bool? returnByValue = null, string sessionIdStr = null) + internal async Task InvokeGetter(JToken obj, object arguments, string fn = "function(e){return this[e]}", bool expect_ok = true, bool? returnByValue = null) { var req = JObject.FromObject(new { @@ -542,7 +542,7 @@ internal async Task InvokeGetter(JToken obj, object arguments, string fn if (returnByValue != null) req["returnByValue"] = returnByValue.Value; - var res = await cli.SendCommand(new SessionId(sessionIdStr), "Runtime.callFunctionOn", req, token); + var res = await cli.SendCommand("Runtime.callFunctionOn", req, token); Assert.True(expect_ok == res.IsOk, $"InvokeGetter failed for {req} with {res}"); return res; @@ -564,24 +564,23 @@ internal async Task InvokeGetter(JToken obj, object arguments, string fn } internal virtual async Task StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, int times = 1, string sessionIdStr = null) + Func wait_for_event_fn = null, Func locals_fn = null, int times = 1) { string method = (kind == StepKind.Resume ? "Debugger.resume" : $"Debugger.step{kind}"); for (int i = 0; i < times - 1; i++) { - await SendCommandAndCheck(null, method, null, -1, -1, null, sessionIdStr : sessionIdStr); + await SendCommandAndCheck(null, method, null, -1, -1, null); } // Check for method/line etc only at the last step return await SendCommandAndCheck( null, method, script_loc, line, column, function_name, wait_for_event_fn: wait_for_event_fn, - locals_fn: locals_fn, - sessionIdStr : sessionIdStr); + locals_fn: locals_fn); } - internal async Task SetNextIPAndCheck(string sessionIdStr, string script_id, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, bool expected_error = false) + internal async Task SetNextIPAndCheck(string script_id, string script_loc, int line, int column, string function_name, + Func wait_for_event_fn = null, Func locals_fn = null, bool expected_error = false) { var setNextIPArgs = JObject.FromObject(new { @@ -595,18 +594,17 @@ internal async Task SetNextIPAndCheck(string sessionIdStr, string scrip return await SendCommandAndCheck( JObject.FromObject(new { location = setNextIPArgs }), "DotnetDebugger.setNextIP", script_loc, line, column, function_name, wait_for_event_fn: wait_for_event_fn, - locals_fn: locals_fn, - sessionIdStr: sessionIdStr); + locals_fn: locals_fn); } - var res = await cli.SendCommand(new SessionId(sessionIdStr), "DotnetDebugger.setNextIP", JObject.FromObject(new { location = setNextIPArgs }), token); + var res = await cli.SendCommand("DotnetDebugger.setNextIP", JObject.FromObject(new { location = setNextIPArgs }), token); Assert.False(res.IsOk); return JObject.FromObject(res); } internal virtual async Task EvaluateAndCheck( string expression, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null) + Func wait_for_event_fn = null, Func locals_fn = null) => await SendCommandAndCheck( CreateEvaluateArgs(expression), "Runtime.evaluate", script_loc, line, column, function_name, @@ -614,9 +612,9 @@ internal virtual async Task EvaluateAndCheck( locals_fn: locals_fn); internal virtual async Task SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE, string sessionIdStr = null) + Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE) { - var res = await cli.SendCommand(new SessionId(sessionIdStr), method, args, token); + var res = await cli.SendCommand(method, args, token); if (!res.IsOk) { _testOutput.WriteLine($"Failed to run command {method} with args: {args?.ToString()}\nresult: {res.Error.ToString()}"); @@ -638,10 +636,10 @@ internal virtual async Task SendCommandAndCheck(JObject args, string me if (locals_fn != null) { - var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value(), sessionIdStr : wait_res["sessionId"].Value()); + var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value()); try { - await locals_fn(locals, sessionIdStr); + await locals_fn(locals); } catch (System.AggregateException ex) { @@ -702,7 +700,7 @@ void CheckDelegateTarget(string actual_target, string exp_target) } } - internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string label, string sessionIdStr = null) + internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string label) { var ctype = exp_val["__custom_type"].Value(); switch (ctype) @@ -764,7 +762,7 @@ internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string la case "datetime": { var dateTime = DateTime.FromBinary(exp_val["binary"].Value()); - await CheckDateTime(actual_val, dateTime, label, sessionIdStr : sessionIdStr); + await CheckDateTime(actual_val, dateTime, label); break; } @@ -777,7 +775,7 @@ internal async Task CheckCustomType(JToken actual_val, JToken exp_val, string la } } - internal async Task CheckProps(JToken actual, object exp_o, string label, int num_fields = -1, bool skip_num_fields_check = false, string sessionIdStr = null) + internal async Task CheckProps(JToken actual, object exp_o, string label, int num_fields = -1, bool skip_num_fields_check = false) { if (exp_o.GetType().IsArray || exp_o is JArray) { @@ -850,7 +848,7 @@ internal async Task CheckProps(JToken actual, object exp_o, string label, int nu } else { - await CheckValue(actual_obj["value"], exp_val, $"{label}#{exp_name}", sessionIdStr: sessionIdStr); + await CheckValue(actual_obj["value"], exp_val, $"{label}#{exp_name}"); } } } @@ -860,11 +858,11 @@ internal virtual bool SkipProperty(string propertyName) return false; } - internal async Task CheckValue(JToken actual_val, JToken exp_val, string label, string sessionIdStr = null) + internal async Task CheckValue(JToken actual_val, JToken exp_val, string label) { if (exp_val["__custom_type"] != null) { - await CheckCustomType(actual_val, exp_val, label, sessionIdStr : sessionIdStr); + await CheckCustomType(actual_val, exp_val, label); return; } @@ -949,9 +947,8 @@ internal async Task GetObjectOnLocals(JToken locals, string name) } /* @fn_args is for use with `Runtime.callFunctionOn` only */ - internal virtual async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true, string sessionIdStr = null) + internal virtual async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true) { - var sessionId = new SessionId(sessionIdStr); if (UseCallFunctionOnBeforeGetProperties && !id.StartsWith("dotnet:scope:")) { var fn_decl = "function () { return this; }"; @@ -963,7 +960,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu if (fn_args != null) cfo_args["arguments"] = fn_args; - var result = await cli.SendCommand(sessionId, "Runtime.callFunctionOn", cfo_args, token); + var result = await cli.SendCommand("Runtime.callFunctionOn", cfo_args, token); AssertEqual(expect_ok, result.IsOk, $"Runtime.getProperties returned {result.IsOk} instead of {expect_ok}, for {cfo_args.ToString()}, with Result: {result}"); if (!result.IsOk) return null; @@ -983,7 +980,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu get_prop_req["accessorPropertiesOnly"] = accessors_only.Value; } - var frame_props = await cli.SendCommand(sessionId,"Runtime.getProperties", get_prop_req, token); + var frame_props = await cli.SendCommand("Runtime.getProperties", get_prop_req, token); AssertEqual(expect_ok, frame_props.IsOk, $"Runtime.getProperties returned {frame_props.IsOk} instead of {expect_ok}, for {get_prop_req}, with Result: {frame_props}"); if (!frame_props.IsOk) return null; @@ -1070,7 +1067,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu return (locals, locals_private); } - internal virtual async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true, string sessionIdStr = null) + internal virtual async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true) { var evaluate_req = JObject.FromObject(new { @@ -1078,7 +1075,7 @@ internal virtual async Task GetProperties(string id, JToken fn_args = nu expression = expression }); - var res = await cli.SendCommand(new SessionId(sessionIdStr), "Debugger.evaluateOnCallFrame", evaluate_req, token); + var res = await cli.SendCommand("Debugger.evaluateOnCallFrame", evaluate_req, token); AssertEqual(expect_ok, res.IsOk, $"Debugger.evaluateOnCallFrame ('{expression}', scope: {id}) returned {res.IsOk} instead of {expect_ok}, with Result: {res}"); if (res.IsOk) return (res.Value["result"], res); @@ -1182,11 +1179,11 @@ internal virtual async Task SetBreakpointInMethod(string assembly, strin return res; } - internal async Task EvaluateOnCallFrameAndCheck(string call_frame_id, string sessionIdStr, params (string expression, JObject expected)[] args) + internal async Task EvaluateOnCallFrameAndCheck(string call_frame_id, params (string expression, JObject expected)[] args) { foreach (var arg in args) { - var (eval_val, _) = await EvaluateOnCallFrame(call_frame_id, arg.expression, sessionIdStr : sessionIdStr).ConfigureAwait(false); + var (eval_val, _) = await EvaluateOnCallFrame(call_frame_id, arg.expression).ConfigureAwait(false); try { await CheckValue(eval_val, arg.expected, arg.expression); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs index f610a7f719d72..eaafe3ffcbbc0 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestFirefox.cs @@ -109,7 +109,7 @@ internal override async Task SetBreakpoint(string url_key, int line, int } internal override async Task EvaluateAndCheck( string expression, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null) + Func wait_for_event_fn = null, Func locals_fn = null) { return await SendCommandAndCheck( CreateEvaluateArgs(expression), @@ -181,7 +181,7 @@ private JObject ConvertFirefoxToDefaultFormat(JArray frames, JObject wait_res) } internal override async Task SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE, string sessionIdStr = null) + Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE) { switch (method) { @@ -215,7 +215,7 @@ internal override async Task SendCommandAndCheck(JObject args, string m var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value()); try { - await locals_fn(locals, sessionIdStr); + await locals_fn(locals); } catch (System.AggregateException ex) { @@ -313,7 +313,7 @@ internal JObject ConvertFromFirefoxToDefaultFormat(KeyValuePair } /* @fn_args is for use with `Runtime.callFunctionOn` only */ - internal override async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true, string sessionIdStr = null) + internal override async Task GetProperties(string id, JToken fn_args = null, bool? own_properties = null, bool? accessors_only = null, bool expect_ok = true) { if (id.StartsWith("dotnet:scope:")) { @@ -357,7 +357,7 @@ internal override async Task GetProperties(string id, JToken fn_args = n } internal override async Task StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name, - Func wait_for_event_fn = null, Func locals_fn = null, int times = 1, string sessionIdStr = null) + Func wait_for_event_fn = null, Func locals_fn = null, int times = 1) { JObject resumeLimit = null; @@ -424,7 +424,7 @@ internal override async Task SetBreakpointInMethod(string assembly, stri return bp1_res; } - internal override async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true, string sessionIdStr = null) + internal override async Task<(JToken, Result)> EvaluateOnCallFrame(string id, string expression, bool expect_ok = true) { var o = CreateEvaluateArgs(expression); var res = await cli.SendCommand("evaluateJSAsync", o, token); @@ -452,7 +452,7 @@ internal override async Task SetBreakpointInMethod(string assembly, stri internal override bool SkipProperty(string propertyName) => propertyName == "isEnum"; - internal override async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "", string sessionIdStr = null) => await Task.CompletedTask; + internal override async Task CheckDateTimeGetter(JToken value, DateTime expected, string label = "") => await Task.CompletedTask; internal override string EvaluateCommand() => "evaluateJSAsync"; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs index 8b073693e7ec5..30d391700c9af 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs @@ -56,7 +56,7 @@ public async Task EvaluateTypeInstanceMembers(string prefix, int bias, string ty foreach (var pad in new[] { String.Empty, " " }) { var padded_prefix = pad + prefix; - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{padded_prefix}a", TNumber(4)), // fields @@ -87,7 +87,7 @@ public async Task EvaluateInstanceMethodArguments(string type, string method, st var id = pause_location["callFrames"][0]["callFrameId"].Value(); var DTProp = new DateTime(2010, 9, 8, 7, 6, 5).AddMinutes(10); _testOutput.WriteLine ($"------- test running the bits.."); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("g", TNumber(400)), ("h", TNumber(123)), ("valString", TString("just a test")), @@ -114,7 +114,7 @@ public async Task EvaluateMethodLocals(string type, string method, string bp_fun var id = pause_location["callFrames"][0]["callFrameId"].Value(); var dt = new DateTime(2025, 3, 5, 7, 9, 11); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, (" d ", TNumber(401)), ("d", TNumber(401)), (" d", TNumber(401)), @@ -137,7 +137,7 @@ public async Task EvaluateStaticLocalsWithDeepMemberAccess() => await CheckInspe var id = pause_location["callFrames"][0]["callFrameId"].Value(); var dt = new DateTime(2020, 1, 2, 3, 4, 5); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f_s.c", TNumber(4)), ("f_s", TValueType("DebuggerTests.EvaluateTestsStructWithProperties")), @@ -169,7 +169,7 @@ public async Task EvaluateLocalsAsync() => await CheckInspectLocalsAtBreakpointS PointWithCustomGetter = TGetter("PointWithCustomGetter") }, "sc_arg_props#1"); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("(sc_arg.PointWithCustomGetter.X)", TNumber(100)), ("sc_arg.Id + \"_foo\"", TString($"sc#Id_foo")), ("sc_arg.Id + (sc_arg.X==10 ? \"_is_ten\" : \"_not_ten\")", TString($"sc#Id_is_ten"))); @@ -190,7 +190,7 @@ await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"] Color = TEnum("DebuggerTests.RGB", "Red"), Value = TNumber(0) }, "local_gs_props#1"); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("(local_gs.Id)", TString(null))); + await EvaluateOnCallFrameAndCheck(id, ("(local_gs.Id)", TString(null))); } }); @@ -207,7 +207,7 @@ public async Task EvaluateExpressionsWithDeepMemberAccesses(string prefix, int b var dateTime = new DateTime(2010, 9, 8, 7, 6, 5 + bias); var DTProp = dateTime.AddMinutes(10); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{prefix}a + 5", TNumber(9)), ($"10 + {prefix}IntProp", TNumber(19)), ($" {prefix}IntProp + {prefix}DTProp.Second", TNumber(9 + DTProp.Second)), @@ -232,7 +232,7 @@ public async Task InheritedAndPrivateMembersInAClass(string prefix) foreach (var pad in new[] { String.Empty, " " }) { var padded_prefix = pad + prefix; - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, // overridden ($"{padded_prefix}FirstName + \"_foo\"", TString("DerivedClass#FirstName_foo")), ($"{padded_prefix}DateTimeForOverride.Date.Year", TNumber(2190)), @@ -261,7 +261,7 @@ public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreak { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, // "((this))", TObject("foo")); //FIXME: // "((dt))", TObject("foo")); //FIXME: @@ -303,7 +303,7 @@ public async Task LocalsAndArgsShadowingThisMembers(string type_name, string met { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("a", TString("hello")), ("this.a", TNumber(4))); @@ -312,7 +312,7 @@ await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"] async Task CheckExpressions(string prefix, DateTime dateTime) { - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, (prefix + "dateTime", TDateTime(dateTime)), (prefix + "dateTime.TimeOfDay.Minutes", TNumber(dateTime.TimeOfDay.Minutes)), (prefix + "dateTime.TimeOfDay", TValueType("System.TimeSpan", dateTime.TimeOfDay.ToString()))); @@ -333,22 +333,22 @@ public async Task EvaluateOnPreviousFrames(string type_name, bool is_valuetype) // At EvaluateShadow { var id0 = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id0, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id0, ("dateTime", TDateTime(dt_local)), ("this.dateTime", TDateTime(dt_this)) ); - await EvaluateOnCallFrameFail(id0, sessionIdStr : pause_location["sessionId"].Value(), ("obj.IntProp", "ReferenceError")); + await EvaluateOnCallFrameFail(id0, ("obj.IntProp", "ReferenceError")); } { var id1 = pause_location["callFrames"][1]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id1, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id1, ("dateTime", "ReferenceError"), ("this.dateTime", "ReferenceError")); // obj available only on the -1 frame - await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId"].Value(), ("obj.IntProp", TNumber(7))); + await EvaluateOnCallFrameAndCheck(id1, ("obj.IntProp", TNumber(7))); } await SetBreakpointInMethod("debugger-test.dll", type_name, "SomeMethod", 1); @@ -363,7 +363,7 @@ await EvaluateOnCallFrameFail(id1, sessionIdStr : pause_location["sessionId"].Va var id0 = pause_location["callFrames"][0]["callFrameId"].Value(); // 'me' and 'dateTime' are reversed in this method - await EvaluateOnCallFrameAndCheck(id0, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id0, ("dateTime", is_valuetype ? TValueType(type_name) : TObject(type_name)), ("this.dateTime", TDateTime(dt_this)), ("me", TDateTime(dt_local)), @@ -374,14 +374,14 @@ await EvaluateOnCallFrameAndCheck(id0, sessionIdStr : pause_location["sessionId" // access field via `this.` ("this.DTProp", TDateTime(dt_this.AddMinutes(10)))); - await EvaluateOnCallFrameFail(id0, sessionIdStr : pause_location["sessionId"].Value(), ("obj", "ReferenceError")); + await EvaluateOnCallFrameFail(id0, ("obj", "ReferenceError")); } // check frame1 { var id1 = pause_location["callFrames"][1]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id1, // 'me' and 'dateTime' are reversed in this method ("dateTime", TDateTime(dt_local)), ("this.dateTime", TDateTime(dt_this)), @@ -393,7 +393,7 @@ await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId" // access field via `this.` ("this.DTProp", TDateTime(dt_this.AddMinutes(10)))); - await EvaluateOnCallFrameFail(id1, sessionIdStr : pause_location["sessionId"].Value(), ("obj", "ReferenceError")); + await EvaluateOnCallFrameFail(id1, ("obj", "ReferenceError")); } // check frame2 @@ -401,12 +401,12 @@ await EvaluateOnCallFrameAndCheck(id1, sessionIdStr : pause_location["sessionId" var id2 = pause_location["callFrames"][2]["callFrameId"].Value(); // Only obj should be available - await EvaluateOnCallFrameFail(id2, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id2, ("dateTime", "ReferenceError"), ("this.dateTime", "ReferenceError"), ("me", "ReferenceError")); - await EvaluateOnCallFrameAndCheck(id2, sessionIdStr : pause_location["sessionId"].Value(), ("obj", is_valuetype ? TValueType(type_name) : TObject(type_name))); + await EvaluateOnCallFrameAndCheck(id2, ("obj", is_valuetype ? TValueType(type_name) : TObject(type_name))); } }); @@ -425,7 +425,7 @@ public async Task JSEvaluate() var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id, ("me.foo", null), ("obj.foo.bar", null)); @@ -441,7 +441,7 @@ public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtB var id = pause_location["callFrames"][0]["callFrameId"].Value(); // Use '.' on a primitive member - await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id, //BUG: TODO: //("a)", "CompilationError"), @@ -467,7 +467,7 @@ public async Task NegativeTestsInStaticMethod() => await CheckInspectLocalsAtBre { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id, ("me.foo", "ReferenceError"), ("this", "CompilationError"), ("this.NullIfAIsNotZero.foo", "ReferenceError")); @@ -481,14 +481,14 @@ public async Task EvaluatePropertyThatThrows() wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.PropertyThrowException", TString("System.Exception: error"))); + await EvaluateOnCallFrameAndCheck(id, ("this.PropertyThrowException", TString("System.Exception: error"))); }); - async Task EvaluateOnCallFrameFail(string call_frame_id, string sessionIdStr, params (string expression, string class_name)[] args) + async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expression, string class_name)[] args) { foreach (var arg in args) { - var (_, res) = await EvaluateOnCallFrame(call_frame_id, arg.expression, expect_ok: false, sessionIdStr: sessionIdStr); + var (_, res) = await EvaluateOnCallFrame(call_frame_id, arg.expression, expect_ok: false); if (arg.class_name != null) AssertEqual(arg.class_name, res.Error["result"]?["className"]?.Value(), $"Error className did not match for expression '{arg.expression}'"); } @@ -531,7 +531,7 @@ public async Task EvaluateSimpleMethodCallsWithoutParms() => await CheckInspectL { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("this.CallMethod()", TNumber(1)), ("this.CallMethod()", TNumber(1)), ("this.CallMethodReturningChar()", TChar('A')), @@ -549,7 +549,7 @@ public async Task EvaluateSimpleMethodCallsWithConstParms() => await CheckInspec { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("this.CallMethodWithParm(10)", TNumber(11)), ("this.CallMethodWithMultipleParms(10, 10)", TNumber(21)), ("this.CallMethodWithParmBool(true)", TString("TRUE")), @@ -573,7 +573,7 @@ public async Task EvaluateSimpleMethodCallsWithVariableParms() => await CheckIns { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("this.CallMethodWithParm(this.a)", TNumber(2)), ("this.CallMethodWithMultipleParms(this.a, 10)", TNumber(12)), ("this.CallMethodWithParmString(this.str)", TString("str_const_str_const_")), @@ -604,7 +604,7 @@ public async Task EvaluateIndexingsByConstant() => await CheckInspectLocalsAtBre { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.numList[0]", TNumber(1)), ("f.textList[1]", TString("2")), ("f.numArray[1]", TNumber(2)), @@ -619,7 +619,7 @@ public async Task EvaluateIndexingByLocalVariable() => await CheckInspectLocalsA { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.numList[i]", TNumber(1)), ("f.textList[j]", TString("2")), ("f.numArray[j]", TNumber(2)), @@ -634,7 +634,7 @@ public async Task EvaluateIndexingByExpression() => await CheckInspectLocalsAtBr wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.numList[i + 1]", TNumber(2)), ("f.textList[(2 * j) - 1]", TString("2")), ("f.textList[j - 1]", TString("1")), @@ -650,7 +650,7 @@ public async Task EvaluateIndexingByExpressionMultidimensional() => await CheckI wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.numArray2D[0, j - 1]", TNumber(1)), // 0, 0 ("f.numArray2D[f.idx1, i + j]", TNumber(4)), // 1, 1 ("f.numArray2D[(f.idx1 - j) * 5, i + j]", TNumber(2)), // 0, 1 @@ -690,7 +690,7 @@ public async Task EvaluateIndexingByMemberVariables() => await CheckInspectLocal { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.idx0", TNumber(0)), ("f.idx1", TNumber(1)), ("f.numList[f.idx0]", TNumber(1)), @@ -707,7 +707,7 @@ public async Task EvaluateIndexingNested() => await CheckInspectLocalsAtBreakpoi { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("f.idx0", TNumber(0)), ("f.numList[f.numList[f.idx0]]", TNumber(2)), ("f.textList[f.numList[f.idx0]]", TString("2")), @@ -724,7 +724,7 @@ public async Task EvaluateIndexingMultidimensional() => await CheckInspectLocals { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("j", TNumber(1)), ("f.idx1", TNumber(1)), ("f.numArray2D[0, 0]", TNumber(1)), @@ -789,7 +789,7 @@ public async Task EvaluateIndexingJagged() => await CheckInspectLocalsAtBreakpoi { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("j", TNumber(1)), ("f.idx1", TNumber(1)), ("f.numArrayOfArrays[1][1]", TNumber(2)), @@ -819,7 +819,7 @@ public async Task EvaluateSimpleMethodCallsCheckChangedValue() => await CheckIns var props = await GetObjectOnFrame(frame, "this"); CheckNumber(props, "a", 1); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("this.CallMethodChangeValue()", TObject("object", is_null : true))); frame = pause_location["callFrames"][0]; @@ -845,7 +845,7 @@ await CheckInspectLocalsAtBreakpointSite( var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{pad}{namespaceName}.{className}.StaticField", TNumber(expectedInt * 10)), ($"{pad}{namespaceName}{pad}.{className}.{pad}StaticProperty", TString($"StaticProperty{expectedInt}")), ($"{namespaceName}.{pad}{className}.StaticPropertyWithError", TString($"System.Exception: not implemented {expectedInt}")), @@ -868,7 +868,7 @@ public async Task EvaluateStaticClassesNested() => await CheckInspectLocalsAtBre var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{pad}DebuggerTests{pad}.EvaluateStaticFieldsInStaticClass.NestedClass1.{pad}NestedClass2.NestedClass3.{pad}StaticField", TNumber(3)), ($"{pad}DebuggerTests.EvaluateStaticFieldsInStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty", TString("StaticProperty3")), ($"{pad}{pad}DebuggerTests.{pad}EvaluateStaticFieldsInStaticClass.NestedClass1.NestedClass2.NestedClass3.{pad}StaticPropertyWithError", TString("System.Exception: not implemented 3")), @@ -887,7 +887,7 @@ public async Task EvaluateStaticClassesNestedWithNoNamespace() => await CheckIns var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{pad}NoNamespaceClass.NestedClass1.NestedClass2.{pad}NestedClass3.StaticField", TNumber(30)), ($"NoNamespaceClass.NestedClass1.{pad}NestedClass2.NestedClass3.StaticProperty", TString("StaticProperty30")), ($"NoNamespaceClass.{pad}NestedClass1.NestedClass2.NestedClass3.{pad}StaticPropertyWithError", TString("System.Exception: not implemented 30"))); @@ -903,7 +903,7 @@ public async Task EvaluateStaticClassesNestedWithSameNames() => await CheckInspe var id = pause_location["callFrames"][0]["callFrameId"].Value(); foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"{pad}NestedWithSameNames", TNumber(90)), ($"B.{pad}NestedWithSameNames", TNumber(90)), ($"{pad}B.{pad}StaticField", TNumber(40)), @@ -943,7 +943,7 @@ await CheckInspectLocalsAtBreakpointSite( foreach (var pad in new[] { String.Empty, " " }) { - await EvaluateOnCallFrameAndCheck(id_top, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id_top, ($"{pad}StaticField", TNumber(20)), ($"{pad}{namespaceName}.{pad}{className}.StaticField{pad}", TNumber(expectedInt * 10)), ($"{pad}StaticProperty", TString($"StaticProperty2")), @@ -954,14 +954,14 @@ await EvaluateOnCallFrameAndCheck(id_top, sessionIdStr : pause_location["session if (!isFromDifferentNamespace) { - await EvaluateOnCallFrameAndCheck(id_top, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id_top, ($"{pad}{className}.StaticField", TNumber(expectedInt * 10)), ($"{className}{pad}.StaticProperty{pad}", TString($"StaticProperty{expectedInt}")), ($"{className}{pad}.{pad}StaticPropertyWithError", TString($"System.Exception: not implemented {expectedInt}")) ); } - await EvaluateOnCallFrameAndCheck(id_second, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id_second, ($"{pad}{namespaceName}.{pad}{className}.{pad}StaticField", TNumber(expectedInt * 10)), ($"{pad}{className}.StaticField", TNumber(expectedIntInPrevFrame * 10)), ($"{namespaceName}{pad}.{pad}{className}.StaticProperty", TString($"StaticProperty{expectedInt}")), @@ -1000,15 +1000,15 @@ public async Task AsyncLocalsInContinueWithBlock() => await CheckInspectLocalsAt "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", wait_for_event_fn: async (pause_location) => { - var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr: pause_location["sessionId"].Value()); + var frame_locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ($"t.Status", TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion")), ($" t.Status", TEnum("System.Threading.Tasks.TaskStatus", "RanToCompletion")) ); - await EvaluateOnCallFrameFail(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameFail(id, ("str", "ReferenceError"), (" str", "ReferenceError") ); @@ -1266,7 +1266,7 @@ public async Task EvaluateMethodWithDefaultParam() => await CheckInspectLocalsAt wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("test.GetByte()", TNumber(1)), ("test.GetSByte()", TNumber(1)), ("test.GetByteNullable()", TNumber(1)), @@ -1324,7 +1324,7 @@ public async Task EvaluateMethodWithLinq() => await CheckInspectLocalsAtBreakpoi wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("test.listToLinq.ToList()", TObject("System.Collections.Generic.List", description: "Count = 11")) ); }); @@ -1339,7 +1339,7 @@ public async Task EvaluateNullObjectPropertiesPositive() => await CheckInspectLo // we have no way of returning int? for null values, // so we return the last non-null class name - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("list.Count", TNumber(1)), ("list!.Count", TNumber(1)), ("list?.Count", TNumber(1)), @@ -1395,7 +1395,7 @@ public async Task EvaluateMethodsOnPrimitiveTypesReturningPrimitives() => await wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("test.propInt.ToString()", TString("12")), ("test.propUint.ToString()", TString("12")), ("test.propLong.ToString()", TString("12")), @@ -1434,7 +1434,7 @@ await CheckInspectLocalsAtBreakpointSite( // expected value depends on the debugger's user culture and is equal to // description of the number that also respects user's culture settings - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("test.propFloat.ToString()", TString(floatMemberVal["description"]?.Value())), ("test.propDouble.ToString()", TString(doubleMemberVal["description"]?.Value())), @@ -1472,7 +1472,7 @@ await CheckInspectLocalsAtBreakpointSite( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("localString", TString($"{pauseMethod}()")), ("this", TObject("DIMClass")), ("this.dimClassMember", TNumber(123))); @@ -1488,7 +1488,7 @@ await CheckInspectLocalsAtBreakpointSite( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("localString", TString($"{pauseMethod}()")), ("IDefaultInterface.defaultInterfaceMember", TString("defaultInterfaceMember")), ("defaultInterfaceMember", TString("defaultInterfaceMember")) @@ -1502,7 +1502,7 @@ public async Task EvaluateStringProperties() => await CheckInspectLocalsAtBreakp wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("localString.Length", TNumber(5)), ("localString[1]", TChar('B')), ("instance.str.Length", TNumber(5)), diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs index 734eceb994541..3bf376c8954de 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/GetPropertiesTests.cs @@ -437,7 +437,7 @@ public async Task GetObjectValueWithInheritance() GetK = TGetter("GetK", TNumber(30)), GetD = TGetter("GetD", TDateTime(new DateTime(2020, 7, 6, 5, 4, 3))) }, "test_props"); - await EvaluateOnCallFrameAndCheck(frame_id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(frame_id, ($"test.GetJ", TNumber(20)), ($"test.GetI", TNumber(50)), ($"test.GetK", TNumber(30)) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs index 21d72dfc4e1a5..eec98fcbd1902 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/HotReloadTests.cs @@ -75,14 +75,14 @@ public async Task DebugHotReloadMethodAddBreakpoint(string assembly_name) await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 31, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 32, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -90,7 +90,7 @@ await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs" } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 33, 8, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -116,14 +116,14 @@ public async Task DebugHotReloadMethodEmpty() pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -131,7 +131,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -139,7 +139,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -147,7 +147,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -259,14 +259,14 @@ public async Task DebugHotReloadMethodAddBreakpointUsingSDB(string assembly_name await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 31, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 32, 12, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -274,7 +274,7 @@ await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs" } ); await StepAndCheck(StepKind.Over, $"dotnet://{assembly_name}.dll/MethodBody1.cs", 33, 8, "ApplyUpdateReferencedAssembly.MethodBody3.StaticMethod3", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); @@ -301,14 +301,14 @@ public async Task DebugHotReloadMethodEmptyUsingSDB() asm_file_hot_reload, "MethodBody4", "StaticMethod4", 1); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -316,7 +316,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -324,7 +324,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -332,7 +332,7 @@ await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/Me } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "ApplyUpdateReferencedAssembly.MethodBody4.StaticMethod4", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -437,7 +437,7 @@ public async Task DebugHotReloadMethod_AddingNewMethod() AssertEqual("ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", top_frame?["functionName"]?.Value(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 59, 12, scripts, top_frame["location"]); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 60, 12, "ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 20); await Task.CompletedTask; @@ -468,13 +468,13 @@ public async Task DebugHotReloadMethod_AddingNewStaticField() CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 59, 12, scripts, top_frame["location"]); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 61, 12, "ApplyUpdateReferencedAssembly.MethodBody6.NewMethodStatic", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "i", 20); await Task.CompletedTask; }, times: 2 ); - await EvaluateOnCallFrameAndCheck(top_frame["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(top_frame["callFrameId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody6.newStaticField", TNumber(10))); } @@ -504,7 +504,7 @@ public async Task DebugHotReloadMethod_AddingNewClass() CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 73, 12, scripts, top_frame["location"]); pause_location = await StepAndCheck(StepKind.Resume, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 83, 12, "ApplyUpdateReferencedAssembly.MethodBody7.InstanceMethod", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "aLocal", 50); await Task.CompletedTask; @@ -516,7 +516,7 @@ public async Task DebugHotReloadMethod_AddingNewClass() CheckNumber(props, "attr1", 15); await CheckString(props, "attr2", "20"); - await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody7.staticField", TNumber(80))); //apply second update @@ -527,7 +527,7 @@ await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId" AssertEqual("ApplyUpdateReferencedAssembly.MethodBody8.InstanceMethod", top_frame?["functionName"]?.Value(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 102, 12, scripts, top_frame["location"]); - await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(pause_location["callFrames"]?[0]["callFrameId"].Value(), ("ApplyUpdateReferencedAssembly.MethodBody8.staticField", TNumber(80))); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index 2f87deb18e59d..b82cd6b5e3b65 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -26,7 +26,7 @@ class Inspector ConcurrentDictionary> notifications = new (); ConcurrentDictionary>> eventListeners = new (); - + ConcurrentQueue nextNotifications = new (); public const string PAUSE = "pause"; public const string APP_READY = "app-ready"; public CancellationToken Token { get; } @@ -81,12 +81,20 @@ public Task WaitFor(string what) { if (tcs.Task.IsCompleted) { + Client.CurrentSessionId = new SessionId(tcs.Task.Result["sessionId"]?.Value()); notifications.Remove(what, out _); return tcs.Task; } throw new Exception($"Invalid internal state, waiting for {what} while another wait is already setup"); } + else if (nextNotifications.TryDequeue(out var notification)) + { + var n = new TaskCompletionSource(); + Client.CurrentSessionId = new SessionId(notification["sessionId"]?.Value()); + n.SetResult(notification); + return n.Task; + } else { var n = new TaskCompletionSource(); @@ -101,13 +109,17 @@ public void ClearWaiterFor(string what) notifications.Remove(what, out _); } - void NotifyOf(string what, string sessionId, JObject args) + void NotifyOf(string what, JObject args) { - args.Add("sessionId", sessionId); if (notifications.TryGetValue(what, out TaskCompletionSource? tcs)) { if (tcs.Task.IsCompleted) - throw new Exception($"Invalid internal state. Notifying for {what} again, but the previous one hasn't been read."); + { + nextNotifications.Enqueue(args); + return; + //throw new Exception($"Invalid internal state. Notifying for {what} again, but the previous one hasn't been read."); + } + Client.CurrentSessionId = new SessionId(args["sessionId"]?.Value()); notifications[what].SetResult(args); notifications.Remove(what, out _); } @@ -211,7 +223,9 @@ async Task OnMessage(string sessionId, string method, JObject args, Cancellation } case "Debugger.paused": { - NotifyOf(PAUSE, sessionId, args); + if (sessionId != "") + args.Add("sessionId", sessionId); + NotifyOf(PAUSE, args); break; } case "Mono.runtimeReady": @@ -220,7 +234,7 @@ async Task OnMessage(string sessionId, string method, JObject args, Cancellation if (_gotAppReady || !DebuggerTestBase.RunningOnChrome) { // got both the events - NotifyOf(APP_READY, sessionId, args); + NotifyOf(APP_READY, args); } break; } @@ -244,7 +258,7 @@ async Task OnMessage(string sessionId, string method, JObject args, Cancellation if (_gotRuntimeReady) { // got both the events - NotifyOf(APP_READY, sessionId, args); + NotifyOf(APP_READY, args); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs index c1f58ccb39f72..e3145cd205895 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs @@ -21,6 +21,8 @@ internal class InspectorClient : DevToolsClient protected Func onEvent; protected int next_cmd_id; + public SessionId CurrentSessionId { get; set; } = new SessionId(null); + public InspectorClient(ILogger logger) : base(logger) { } protected override async Task SetupConnection(Uri webserverUri, CancellationToken token) @@ -75,7 +77,7 @@ public virtual async Task Connect( } public Task SendCommand(string method, JObject args, CancellationToken token) - => SendCommand(new SessionId(null), method, args, token); + => SendCommand(CurrentSessionId, method, args, token); public virtual Task SendCommand(SessionId sessionId, string method, JObject args, CancellationToken token) { @@ -92,7 +94,6 @@ public virtual Task SendCommand(SessionId sessionId, string method, JObj if (sessionId != SessionId.Null) o.Add("sessionId", sessionId.sessionId); - var tcs = new TaskCompletionSource(); pending_cmds[new MessageId(sessionId.sessionId, id)] = tcs; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index 3dde9f1107f39..23ca07f687f9c 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -68,7 +68,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", "window.setTimeout(function() { invoke_add(); }, 1);", use_cfo: use_cfo, - test_fn: async (locals, sessionIdStr) => + test_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -84,7 +84,7 @@ public async Task InspectPrimitiveTypeLocalsAtBreakpointSite() => await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 154, 8, "Math.PrimitiveTypesTest", "window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:PrimitiveTypesTest'); }, 1);", - test_fn: async (locals, sessionIdStr) => + test_fn: async (locals) => { await CheckSymbol(locals, "c0", '€'); await CheckSymbol(locals, "c1", 'A'); @@ -98,7 +98,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test2.cs", 50, 8, "Fancy.Types", "window.setTimeout(function() { invoke_static_method (\"[debugger-test] Fancy:Types\")(); }, 1);", use_cfo: false, - test_fn: async (locals, sessionIdStr) => + test_fn: async (locals) => { CheckNumber(locals, "dPI", Math.PI); CheckNumber(locals, "fPI", (float)Math.PI); @@ -204,7 +204,7 @@ await CheckInspectLocalsAtBreakpointSite( "dotnet://debugger-test.dll/debugger-test.cs", 74, 8, "Math.GenericTypesTest", "window.setTimeout(function() { invoke_generic_types_test (); }, 1);", use_cfo: use_cfo, - test_fn: async (locals, sessionIdStr) => + test_fn: async (locals) => { await CheckObject(locals, "list", "System.Collections.Generic.Dictionary", description: "Count = 0"); await CheckObject(locals, "list_null", "System.Collections.Generic.Dictionary", is_null: true); @@ -858,7 +858,7 @@ public async Task GetSourceEmbeddedSource() Assert.False(source.Value["scriptSource"].Value().Contains("// Unable to read document")); } - [ConditionalFact(nameof(RunningOnChrome))] + [ConditionalFact(nameof(WasmSingleThreaded), nameof(RunningOnChrome))] public async Task InspectTaskAtLocals() => await CheckInspectLocalsAtBreakpointSite( "InspectTask", "RunInspectTask", @@ -867,7 +867,7 @@ public async Task InspectTaskAtLocals() => await CheckInspectLocalsAtBreakpointS $"window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] InspectTask:RunInspectTask'); }}, 1);", wait_for_event_fn: async (pause_location) => { - var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value(), sessionIdStr: pause_location["sessionId"].Value()); + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); CheckNumber(locals, "a", 10); var t_props = await GetObjectOnLocals(locals, "t"); @@ -885,7 +885,7 @@ await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] MainPage:CallSetValue'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 758, 16, "MainPage.set_SomeValue", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "view", 150); await Task.CompletedTask; @@ -1034,7 +1034,7 @@ await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 1258, 8, $"InspectIntPtr.Run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckValueType(locals, "myInt", "System.IntPtr"); await CheckValueType(locals, "myInt2", "System.IntPtr"); @@ -1058,7 +1058,7 @@ await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", line, 8, $"{class_name}.CallMethod", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { var this_props = await GetObjectOnLocals(locals, "this"); if (jmc) @@ -1117,17 +1117,50 @@ await EvaluateAndCheck( wait_for_event_fn: async (pause_location) => { var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), + await EvaluateOnCallFrameAndCheck(id, ("parameters.ToString()", TString("System.ReadOnlySpan[1]")) ); } ); await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1363, 8, "ReadOnlySpanTest.Run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckValueType(locals, "var1", "System.ReadOnlySpan", description: "System.ReadOnlySpan[0]"); } ); } + + [ConditionalFact(nameof(WasmMultiThreaded))] + public async Task TestDebugUsingMultiThreadedRuntime() + { + var bp = await SetBreakpointInMethod("debugger-test.dll", "MultiThreadedTest", "Write", 2); + var expression = $"{{ invoke_static_method('[debugger-test] MultiThreadedTest:Run'); }}"; + + await EvaluateAndCheck( + "window.setTimeout(function() {" + expression + "; }, 1);", + "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, + "MultiThreadedTest.Write", + wait_for_event_fn: async (pause_location) => + { + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write", + wait_for_event_fn: async (pause_location) => + { + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write", + wait_for_event_fn: async (pause_location) => + { + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + }); + }); + } + ); + } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs index 11697e5678607..f19f5a556a3cf 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SetNextIpTests.cs @@ -36,28 +36,24 @@ async Task CheckLocalsAsync(JToken locals, int c, int d, int e, bool f) "Math.IntAdd" ); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, false)); + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", + locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, false)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 13, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, true), - sessionIdStr : pause_location["sessionId"].Value()); - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 0, 0, 0, true)); + locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, true)); + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd", + locals_fn: async (locals) => await CheckLocalsAsync(locals, 0, 0, 0, true)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 0, true), - sessionIdStr : pause_location["sessionId"].Value()); - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 11, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 0, true)); + locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 0, true)); + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 11, 8, "Math.IntAdd", + locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 0, true)); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 12, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => await CheckLocalsAsync(locals, 30, 0, 10, true), - sessionIdStr : pause_location["sessionId"].Value()); + locals_fn: async (locals) => await CheckLocalsAsync(locals, 30, 0, 10, true)); //to check that after moving the execution pointer to the same line that there is already //a breakpoint, the breakpoint continue working pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, - "Math.IntAdd" , - sessionIdStr : pause_location["sessionId"].Value()); + "Math.IntAdd"); } [ConditionalFact(nameof(RunningOnChrome))] @@ -70,17 +66,16 @@ public async Task OutsideTheCurrentMethod() "dotnet://debugger-test.dll/debugger-test.cs", 9, 8, "Math.IntAdd"); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 20, 8, "Math.IntAdd", + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 20, 8, "Math.IntAdd", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "c", 30); CheckNumber(locals, "d", 0); CheckNumber(locals, "e", 0); await CheckBool(locals, "f", false); - }, - sessionIdStr : pause_location["sessionId"].Value()); + }); } [ConditionalFact(nameof(RunningOnChrome))] @@ -93,7 +88,7 @@ public async Task AsyncMethod() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_async_method_with_await(); }, 1);", debugger_test_loc, 140, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); @@ -101,25 +96,24 @@ public async Task AsyncMethod() } ); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 141, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals, sessionIdStr) => + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-test.cs", 141, 12, "Math.NestedInMath.AsyncTest", + locals_fn: async (locals) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); await CheckString(locals, "ls", null); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 142, 12, "Math.NestedInMath.AsyncTest", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "li", 0); CheckNumber(locals, "i", 42); await CheckString(locals, "ls", "string from jstest"); - }, - sessionIdStr : pause_location["sessionId"].Value()); + }); } [ConditionalFact(nameof(RunningOnChrome))] - public async Task Lambda2() + public async Task Lambda() { var debugger_test_loc = "dotnet://debugger-test.dll/debugger-async-test.cs"; @@ -127,43 +121,41 @@ public async Task Lambda2() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 80, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); - }, - sessionIdStr : pause_location["sessionId"].Value()); - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); + }); + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); - await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2), sessionIdStr: sessionIdStr); - }, - sessionIdStr : pause_location["sessionId"].Value()); + await CheckDateTime(locals, "dt0", new DateTime(3412, 4, 6, 8, 0, 2)); + }); } [ConditionalFact(nameof(RunningOnChrome))] @@ -175,25 +167,24 @@ public async Task Lambda_InvalidLocation() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 8, "MoveNext", + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 8, "MoveNext", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2, - sessionIdStr : pause_location["sessionId"].Value()); + times: 2); } [ConditionalFact(nameof(RunningOnChrome))] @@ -205,7 +196,7 @@ public async Task Lambda_ToNestedLambda() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -213,18 +204,17 @@ public async Task Lambda_ToNestedLambda() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 88, 20, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 88, 20, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2, - sessionIdStr : pause_location["sessionId"].Value()); + times: 2); } [ConditionalFact(nameof(RunningOnChrome))] @@ -236,7 +226,7 @@ public async Task Lambda_ToNestedSingleLineLambda_Invalid() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -244,18 +234,17 @@ public async Task Lambda_ToNestedSingleLineLambda_Invalid() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 58, "MoveNext", + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 58, "MoveNext", expected_error: true); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 79, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "RanToCompletion"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); }, - times: 2, - sessionIdStr : pause_location["sessionId"].Value()); + times: 2); } [ConditionalFact(nameof(RunningOnChrome))] @@ -267,7 +256,7 @@ public async Task Lambda_ToNestedSingleLineLambda_Valid() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", debugger_test_loc, 77, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -275,8 +264,8 @@ public async Task Lambda_ToNestedSingleLineLambda_Valid() }); var top_frame = pause_location["callFrames"][0]["functionLocation"]; - await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + await SetNextIPAndCheck(top_frame["scriptId"].Value(), "dotnet://debugger-test.dll/debugger-async-test.cs", 91, 16, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); @@ -284,12 +273,11 @@ await SetNextIPAndCheck(pause_location["sessionId"].Value(), top_frame[" }); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-async-test.cs", 92, 12, "DebuggerTests.AsyncTests.ContinueWithTests.NestedContinueWithInstanceAsync", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckString(locals, "str", "foobar"); await CheckValueType(locals, "code", "System.Threading.Tasks.TaskStatus", description: "Created"); await CheckValueType(locals, "dt0", "System.DateTime", description: "1/1/0001 12:00:00 AM"); - }, - sessionIdStr : pause_location["sessionId"].Value()); + }); } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs index 313b06abd7ed6..b93a525b012c4 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SetVariableValueTests.cs @@ -36,7 +36,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -47,7 +47,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -59,7 +59,7 @@ public async Task SetLocalPrimitiveTypeVariableOutOfRange(string variableName, l await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=overflowValue}) }), false); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -75,7 +75,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -86,7 +86,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -98,7 +98,7 @@ public async Task SetLocalFloatVariable(string variableName, float originalValue await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue2); await Task.CompletedTask; @@ -114,7 +114,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -125,7 +125,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -137,7 +137,7 @@ public async Task SetLocalDoubleVariable(string variableName, double originalVal await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue2); await Task.CompletedTask; @@ -164,7 +164,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {{ invoke_static_method_async('[debugger-test] DebuggerTests.SetVariableLocals:run');}}, 1);", "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 22, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumberAsString(locals, variableName, originalValue.ToString()); await Task.CompletedTask; @@ -175,7 +175,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 23, 12, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumberAsString(locals, variableName, newValue.ToString()); await Task.CompletedTask; @@ -187,7 +187,7 @@ public async Task SetLocalPrimitiveTypeVariableValid(string variableName, string await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue2}) })); pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-set-variable-value-test.cs", 24, 8, "DebuggerTests.SetVariableLocals.run", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumberAsString(locals, variableName, newValue2.ToString()); await Task.CompletedTask; @@ -206,7 +206,7 @@ public async Task SetLocalPrimitiveTypeVariable(int offset, string variableName, var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -217,7 +217,7 @@ public async Task SetLocalPrimitiveTypeVariable(int offset, string variableName, await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, newValue); await Task.CompletedTask; @@ -236,7 +236,7 @@ public async Task SetVariableValuesAtBreakpointSiteFail(int offset, string varia var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -247,7 +247,7 @@ public async Task SetVariableValuesAtBreakpointSiteFail(int offset, string varia await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=invalidValue}) }), false); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, variableName, originalValue); await Task.CompletedTask; @@ -263,7 +263,7 @@ public async Task SetLocalBoolTypeVariable(int offset, string variableName, bool var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 8+offset, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckBool(locals, variableName, originalValue); } @@ -273,7 +273,7 @@ public async Task SetLocalBoolTypeVariable(int offset, string variableName, bool await SetVariableValueOnCallFrame( JObject.FromObject(new {callFrameId, variableName, newValue=JObject.FromObject(new {value=newValue}) })); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 9+offset, 4, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { await CheckBool(locals, variableName, newValue); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs index 3542cbe508b26..39d3079096138 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs @@ -54,7 +54,7 @@ public async Task InspectLocalsDuringStepping() await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", debugger_test_loc, 10, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -66,7 +66,7 @@ await EvaluateAndCheck( ); await StepAndCheck(StepKind.Over, debugger_test_loc, 11, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -79,7 +79,7 @@ await StepAndCheck(StepKind.Over, debugger_test_loc, 11, 8, "Math.IntAdd", //step and get locals await StepAndCheck(StepKind.Over, debugger_test_loc, 12, 8, "Math.IntAdd", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); @@ -107,7 +107,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn2(bool use_cfo) var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_use_complex (); }, 1);", dep_cs_loc, 35, 8, "Simple.Complex.DoEvenMoreStuff", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Single(locals); await CheckObject(locals, "this", "Simple.Complex"); @@ -172,7 +172,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn(bool use_cfo) var wait_res = await EvaluateAndCheck( "window.setTimeout(function() { invoke_outer_method(); }, 1);", debugger_test_loc, 111, 12, "Math.NestedInMath.InnerMethod", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(4, locals.Count()); CheckNumber(locals, "i", 5); @@ -207,7 +207,7 @@ public async Task InspectLocalsInPreviousFramesDuringSteppingIn(bool use_cfo) // step back into OuterMethod await StepAndCheck(StepKind.Over, debugger_test_loc, 91, 8, "Math.OuterMethod", times: 6, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(5, locals.Count()); @@ -223,7 +223,7 @@ await StepAndCheck(StepKind.Over, debugger_test_loc, 91, 8, "Math.OuterMethod", // step into InnerMethod2 await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 96, 4, "Math.InnerMethod2", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(3, locals.Count()); @@ -235,7 +235,7 @@ await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 100, 4, "Math.InnerMethod2", times: 4, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(3, locals.Count()); @@ -247,7 +247,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 92, 8, "Math.OuterMethod", times: 1, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(5, locals.Count()); @@ -267,7 +267,7 @@ public async Task InspectLocalsDuringSteppingIn() await EvaluateAndCheck("window.setTimeout(function() { invoke_outer_method(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 86, 8, "Math.OuterMethod", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(5, locals.Count()); @@ -280,7 +280,7 @@ public async Task InspectLocalsDuringSteppingIn() ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 87, 8, "Math.OuterMethod", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(5, locals.Count()); @@ -296,7 +296,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", // Step into InnerMethod await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 105, 8, "Math.NestedInMath.InnerMethod"); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 110, 12, "Math.NestedInMath.InnerMethod", times: 5, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(4, locals.Count()); @@ -310,7 +310,7 @@ await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", // Step back to OuterMethod await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 90, 8, "Math.OuterMethod", times: 6, - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(5, locals.Count()); @@ -338,7 +338,7 @@ public async Task InspectLocalsInAsyncMethods(bool use_cfo) var wait_res = await EvaluateAndCheck( "window.setTimeout(function() { invoke_async_method_with_await(); }, 1);", debugger_test_loc, 120, 12, "Math.NestedInMath.AsyncMethod0", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(4, locals.Count()); await CheckString(locals, "s", "string from js"); @@ -359,7 +359,7 @@ public async Task InspectLocalsInAsyncMethods(bool use_cfo) // TODO: previous frames have async machinery details, so no point checking that right now var pause_loc = await SendCommandAndCheck(null, "Debugger.resume", debugger_test_loc, 135, 12, "Math.NestedInMath.AsyncMethodNoReturn", - locals_fn: async (locals, sessionIdStr) => + locals_fn: async (locals) => { Assert.Equal(4, locals.Count()); await CheckString(locals, "str", "AsyncMethodNoReturn's local"); @@ -430,7 +430,7 @@ public async Task InspectValueTypeMethodArgsWhileStepping(bool use_cfo) } pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 40, 8, "DebuggerTests.ValueTypesTest.MethodWithStructArgs", times: 4, - locals_fn: async (l, sessionIdStr) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); + locals_fn: async (l) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); { Assert.Equal(3, locals.Count()); @@ -482,7 +482,7 @@ public async Task InspectValueTypeMethodArgsWhileStepping(bool use_cfo) // ----------- Step back to the caller --------- pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 30, 12, "DebuggerTests.ValueTypesTest.TestStructsAsMethodArgs", - times: 1, locals_fn: async (l, sessionIdStr) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); + times: 1, locals_fn: async (l) => { /* non-null to make sure that locals get fetched */ await Task.CompletedTask; }); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(locals, new { @@ -931,10 +931,10 @@ await EvaluateAndCheck( "Foo.RunBart"); var pause_location = await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 671, 4, "Foo.Bart"); var id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.Bar", TString("Same of something"))); + await EvaluateOnCallFrameAndCheck(id, ("this.Bar", TString("Same of something"))); pause_location = await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-test.cs", 673, 8, "Foo.Bart"); id = pause_location["callFrames"][0]["callFrameId"].Value(); - await EvaluateOnCallFrameAndCheck(id, sessionIdStr : pause_location["sessionId"].Value(), ("this.Bar", TString("Same of something"))); + await EvaluateOnCallFrameAndCheck(id, ("this.Bar", TString("Same of something"))); } [Fact] @@ -1037,13 +1037,5 @@ await EvaluateAndCheck( step_into2["callFrames"][0]["location"]["lineNumber"].Value() ); } - - [ConditionalFact(nameof(WasmMultiThreaded))] - public async Task TestDebugUsingMultiThreadedRuntime() - { - //TODO WRITE HERE A TEST LIKE THE SAMPLE AND CHECK IF IT'S PAUSING IN ALL THREADS CORRECTLY - Assert.Equal(1, 2); - await Task.Delay(1); - } } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs index 325fc7d76ad85..741fb786161bb 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs @@ -1505,4 +1505,28 @@ public static void Run() var n = new ToStringOverridenN(); System.Diagnostics.Debugger.Break(); } +} + +public class MultiThreadedTest +{ + public static void Run() + { + System.Collections.Generic.List myThreads = new(); + for (int i = 0 ; i < 3; i++) + { + var t = new System.Threading.Thread (() => Write("y")); + myThreads.Add(t); + t.Start(); + } + + foreach (System.Threading.Thread curThread in myThreads) + { + curThread.Join(); + } + } + static void Write(string input) + { + var currentThread = System.Threading.Thread.CurrentThread.ManagedThreadId; + Console.WriteLine($"Thread:{currentThread} - {input}"); + } } \ No newline at end of file From 06bae94d45255aeed006f58df95164e8e17c0d8a Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 09:50:50 -0300 Subject: [PATCH 26/46] Update src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs Co-authored-by: Ankit Jain --- src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index 7a3be48a31e89..ce457d849391a 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -153,7 +153,7 @@ public virtual async Task InitializeAsync() getInitCmdFn("Runtime.enable", null), getInitCmdFn("Debugger.enable", null), getInitCmdFn("Runtime.runIfWaitingForDebugger", null), - getInitCmdFn("Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32})), + getInitCmdFn("Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32 })), getInitCmdFn("Target.setAutoAttach", JObject.FromObject(new { autoAttach = true, waitForDebuggerOnStart = true, flatten = true})) //getInitCmdFn("ServiceWorker.enable", null) }; From ff6bba08bdf29ddd996822626039fe97e9a58514 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 09:51:01 -0300 Subject: [PATCH 27/46] Update src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs Co-authored-by: Ankit Jain --- .../debugger/DebuggerTestSuite/MiscTests.cs | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index 23ca07f687f9c..b933d9a055a68 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -1136,31 +1136,24 @@ public async Task TestDebugUsingMultiThreadedRuntime() var bp = await SetBreakpointInMethod("debugger-test.dll", "MultiThreadedTest", "Write", 2); var expression = $"{{ invoke_static_method('[debugger-test] MultiThreadedTest:Run'); }}"; - await EvaluateAndCheck( + var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, - "MultiThreadedTest.Write", - wait_for_event_fn: async (pause_location) => - { - var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); - Assert.Equal(locals[1]["value"]["type"], "number"); - Assert.Equal(locals[1]["name"], "currentThread"); - await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write", - wait_for_event_fn: async (pause_location) => - { - var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); - Assert.Equal(locals[1]["value"]["type"], "number"); - Assert.Equal(locals[1]["name"], "currentThread"); - await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write", - wait_for_event_fn: async (pause_location) => - { - var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); - Assert.Equal(locals[1]["value"]["type"], "number"); - Assert.Equal(locals[1]["name"], "currentThread"); - }); - }); - } - ); + "MultiThreadedTest.Write"); + + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); + locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); + locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); } } } From ab98d6a19df0ee34b4f5664bad6506c15cdf42af Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 09:51:36 -0300 Subject: [PATCH 28/46] Update src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs Co-authored-by: Ankit Jain --- src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs index e3145cd205895..795faceab9420 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs @@ -21,7 +21,7 @@ internal class InspectorClient : DevToolsClient protected Func onEvent; protected int next_cmd_id; - public SessionId CurrentSessionId { get; set; } = new SessionId(null); + public SessionId CurrentSessionId { get; set; } = SessionId.Null; public InspectorClient(ILogger logger) : base(logger) { } From e46bf4d43568cc12067e9487bcf129ca3751128e Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 13:07:13 -0300 Subject: [PATCH 29/46] Dictionary with the scriptId also uses sessionId. --- .../DebuggerTestSuite/BreakpointTests.cs | 24 +++++++++---------- .../DebuggerTestSuite/DebuggerTestBase.cs | 9 ++----- .../debugger/DebuggerTestSuite/Inspector.cs | 2 ++ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index 2e7a904280ca0..93d3d25363ef9 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -219,25 +219,23 @@ await EvaluateAndCheck( } [ConditionalTheory(nameof(RunningOnChrome))] - [InlineData("c == 15", 79, 3, 79, 11, "dotnet.worker.js")] - [InlineData("c == 17", 79, 3, 80, 11, "debugger-driver.html")] - [InlineData("g == 17", 79, 3, 80, 11, "debugger-driver.html")] - [InlineData("true", 79, 3, 79, 11, "dotnet.worker.js")] - [InlineData("\"false\"", 79, 3, 79, 11, "dotnet.worker.js")] - [InlineData("\"true\"", 79, 3, 79, 11, "dotnet.worker.js")] - [InlineData("5", 79, 3, 79, 11, "dotnet.worker.js")] - [InlineData("p", 79, 3, 80, 11, "debugger-driver.html")] - [InlineData("0.0", 79, 3, 80, 11, "debugger-driver.html")] - public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected, string file_name) + [InlineData("c == 15", 79, 3, 79, 11)] + [InlineData("c == 17", 79, 3, 80, 11)] + [InlineData("g == 17", 79, 3, 80, 11)] + [InlineData("true", 79, 3, 79, 11)] + [InlineData("\"false\"", 79, 3, 79, 11)] + [InlineData("\"true\"", 79, 3, 79, 11)] + [InlineData("5", 79, 3, 79, 11)] + [InlineData("p", 79, 3, 80, 11)] + [InlineData("0.0", 79, 3, 80, 11)] + public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected) { await SetBreakpoint("/debugger-driver.html", line_bp, column_bp, condition: condition); await SetBreakpoint("/debugger-driver.html", 80, 11); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { conditional_breakpoint_test(5, 10, null); }, 1);", - "", -1, -1, "conditional_breakpoint_test"); - - CheckLocationLineColumn(pause_location["callFrames"]?[0]["location"], line_expected, column_expected); + "debugger-driver.html", line_expected, column_expected, "conditional_breakpoint_test"); } [Theory] diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index ce457d849391a..e36834ac179b9 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -182,6 +182,7 @@ protected Task DefaultScriptParsedHandler(JObject ar { var script_id = args?["scriptId"]?.Value(); var url = args["url"]?.Value(); + script_id += args["sessionId"]?.Value(); if (script_id.StartsWith("dotnet://")) { var dbgUrl = args["dotNetUrl"]?.Value(); @@ -322,7 +323,7 @@ internal async Task CheckInspectLocalsAtBreakpointSite(string type, string metho internal virtual void CheckLocation(string script_loc, int line, int column, Dictionary scripts, JToken location) { - var loc_str = $"{ scripts[location["scriptId"].Value()] }" + + var loc_str = $"{ scripts[location["scriptId"].Value()+cli.CurrentSessionId.sessionId] }" + $"#{ location["lineNumber"].Value() }" + $"#{ location["columnNumber"].Value() }"; @@ -335,12 +336,6 @@ internal virtual void CheckLocationLine(JToken location, int line) Assert.Equal(location["lineNumber"].Value(), line); } - internal virtual void CheckLocationLineColumn(JToken location, int line, int col) - { - CheckLocationLine(location, line); - Assert.Equal(location["columnNumber"].Value(), col); - } - internal void CheckNumber(JToken locals, string name, T value) { foreach (var l in locals) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index b82cd6b5e3b65..1fd077891705b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -286,6 +286,8 @@ async Task OnMessage(string sessionId, string method, JObject args, Cancellation if (eventListeners.TryGetValue(method, out Func>? listener) && listener != null) { + if (sessionId != "") + args.Add("sessionId", sessionId); ProtocolEventHandlerReturn result = await listener(args, token).ConfigureAwait(false); if (result is ProtocolEventHandlerReturn.RemoveHandler) eventListeners.Remove(method, out _); From b194f06c943b7eeb3966743a6445539d69cfbb57 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 13:45:30 -0300 Subject: [PATCH 30/46] Addressing @radical review. --- src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index e36834ac179b9..bafb756541da5 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -306,7 +306,7 @@ internal async Task CheckInspectLocalsAtBreakpointSite(string type, string metho Assert.Equal(bp_function_name, pause_location["callFrames"]?[0]?["functionName"]?.Value()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value()); - + var top_frame = pause_location!["callFrames"]?[0]; var scope = top_frame?["scopeChain"]?[0]; From 1d6e5f86ca6324fa617836230d016b9749b3a01b Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 13:50:35 -0300 Subject: [PATCH 31/46] Apply suggestions from code review Co-authored-by: Ankit Jain --- src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index bafb756541da5..0a33d5c488870 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -154,7 +154,7 @@ public virtual async Task InitializeAsync() getInitCmdFn("Debugger.enable", null), getInitCmdFn("Runtime.runIfWaitingForDebugger", null), getInitCmdFn("Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32 })), - getInitCmdFn("Target.setAutoAttach", JObject.FromObject(new { autoAttach = true, waitForDebuggerOnStart = true, flatten = true})) + getInitCmdFn("Target.setAutoAttach", JObject.FromObject(new { autoAttach = true, waitForDebuggerOnStart = true, flatten = true })) //getInitCmdFn("ServiceWorker.enable", null) }; return init_cmds; From f87289b1bcc15d4b5bd9654a410a110437bdcead Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 16:38:27 -0300 Subject: [PATCH 32/46] Avoiding getting this error: Cannot transition thread 0x2a15360 from STATE_BLOCKING with DO_BLOCKING. In the transport_send we don't save the thread context, we save it before the send function. --- src/mono/mono/component/debugger-agent.c | 1 + src/mono/mono/component/mini-wasm-debugger.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index fa27e01cd8b9b..aa591c30ff6ab 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -3754,6 +3754,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx #ifdef TARGET_WASM PRINT_DEBUG_MSG (1, "[%p] Sent %d events %s(%d), suspend=%d.\n", (gpointer) (gsize) mono_native_thread_id_get (), nevents, event_to_string (event), ecount, suspend_policy); + mono_wasm_save_thread_context(); #endif send_success = send_packet (CMD_SET_EVENT, CMD_COMPOSITE, &buf); diff --git a/src/mono/mono/component/mini-wasm-debugger.c b/src/mono/mono/component/mini-wasm-debugger.c index 3ebdce2886b1d..e016ce810d548 100644 --- a/src/mono/mono/component/mini-wasm-debugger.c +++ b/src/mono/mono/component/mini-wasm-debugger.c @@ -454,7 +454,6 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, static gboolean receive_debugger_agent_message (void *data, int len) { - mono_wasm_save_thread_context(); mono_wasm_fire_debugger_agent_message_with_data ((const char*)data, len); return FALSE; } From 5db7881ee2363b829477cec4371cda5c1c9da060 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 21 Oct 2022 16:43:53 -0300 Subject: [PATCH 33/46] Addressing @radical comments. --- .../debugger/DebuggerTestSuite/DebuggerTestBase.cs | 12 ++---------- .../DebuggerTestSuite/EnvironmentVariables.cs | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index 0a33d5c488870..c98619115df28 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -38,16 +38,8 @@ public static WasmHost RunningOn => WasmHost.Firefox; #endif - public static bool WasmMultiThreaded - { - get - { - var envVar = Environment.GetEnvironmentVariable("WASM_TESTS_USING_VARIANT"); - if (envVar == "multithreaded") - return true; - return false; - } - } + public static bool WasmMultiThreaded => EnvironmentVariables.WasmTestsUsingVariant == "multithreaded"; + public static bool WasmSingleThreaded => !WasmMultiThreaded; public static bool RunningOnChrome => RunningOn == WasmHost.Chrome; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EnvironmentVariables.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EnvironmentVariables.cs index 1e52ee8397573..21ddfe8bbd08e 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EnvironmentVariables.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EnvironmentVariables.cs @@ -11,4 +11,5 @@ internal static class EnvironmentVariables { public static readonly string? DebuggerTestPath = Environment.GetEnvironmentVariable("DEBUGGER_TEST_PATH"); public static readonly string? TestLogPath = Environment.GetEnvironmentVariable("TEST_LOG_PATH"); + public static readonly string? WasmTestsUsingVariant = Environment.GetEnvironmentVariable("WASM_TESTS_USING_VARIANT"); } From 76c17319538f950ac87cdb5649fb4446ebd0f4b5 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 25 Oct 2022 12:27:03 -0300 Subject: [PATCH 34/46] Using more threads in unit test. --- src/mono/mono/component/mini-wasm-debugger.c | 11 ++++++++--- src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs | 10 ++++++++++ .../debugger/tests/debugger-test/debugger-test.cs | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/component/mini-wasm-debugger.c b/src/mono/mono/component/mini-wasm-debugger.c index e016ce810d548..f9071eafef1bf 100644 --- a/src/mono/mono/component/mini-wasm-debugger.c +++ b/src/mono/mono/component/mini-wasm-debugger.c @@ -382,7 +382,7 @@ mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, i goto done; } MdbgProtBuffer bufWithParms; - buffer_init (&bufWithParms, 128); + m_dbgprot_buffer_init (&bufWithParms, 128); m_dbgprot_buffer_add_data (&bufWithParms, data, size); if (!write_value_to_buffer(&bufWithParms, valtype, newvalue)) { mono_wasm_add_dbg_command_received(0, id, 0, 0); @@ -410,11 +410,11 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, } ss_calculate_framecount (NULL, NULL, TRUE, NULL, NULL); MdbgProtBuffer buf; - buffer_init (&buf, 128); gboolean no_reply; MdbgProtErrorCode error = 0; if (command_set == MDBGPROT_CMD_SET_VM && command == MDBGPROT_CMD_VM_INVOKE_METHOD ) { + m_dbgprot_buffer_init (&buf, 128); DebuggerTlsData* tls = mono_wasm_get_tls (); InvokeData invoke_data; memset (&invoke_data, 0, sizeof (InvokeData)); @@ -426,6 +426,7 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, char* assembly_name = m_dbgprot_decode_string (data, &data, data + size); if (assembly_name == NULL) { + m_dbgprot_buffer_init (&buf, 128); m_dbgprot_buffer_add_int (&buf, 0); m_dbgprot_buffer_add_int (&buf, 0); } @@ -435,16 +436,20 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, int symfile_size = 0; const unsigned char* assembly_bytes = mono_wasm_get_assembly_bytes (assembly_name, &assembly_size); const unsigned char* pdb_bytes = mono_get_symfile_bytes_from_bundle (assembly_name, &symfile_size); + m_dbgprot_buffer_init (&buf, assembly_size + symfile_size); m_dbgprot_buffer_add_byte_array (&buf, (uint8_t *) assembly_bytes, assembly_size); m_dbgprot_buffer_add_byte_array (&buf, (uint8_t *) pdb_bytes, symfile_size); } } else + { + m_dbgprot_buffer_init (&buf, 128); error = mono_process_dbg_packet (id, command_set, command, &no_reply, data, data + size, &buf); + } mono_wasm_add_dbg_command_received (error == MDBGPROT_ERR_NONE, id, buf.buf, buf.p-buf.buf); - buffer_free (&buf); + m_dbgprot_buffer_free (&buf); result = TRUE; done: MONO_EXIT_GC_UNSAFE; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index b933d9a055a68..48d90d51166e1 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -1154,6 +1154,16 @@ public async Task TestDebugUsingMultiThreadedRuntime() locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); Assert.Equal(locals[1]["value"]["type"], "number"); Assert.Equal(locals[1]["name"], "currentThread"); + + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); + locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); + + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); + locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(locals[1]["value"]["type"], "number"); + Assert.Equal(locals[1]["name"], "currentThread"); } } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs index 741fb786161bb..0a400f0116dc7 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs @@ -1512,7 +1512,7 @@ public class MultiThreadedTest public static void Run() { System.Collections.Generic.List myThreads = new(); - for (int i = 0 ; i < 3; i++) + for (int i = 0 ; i < 5; i++) { var t = new System.Threading.Thread (() => Write("y")); myThreads.Add(t); From 7af49998a7bbe1feec33b694bba9b00687023d8e Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 25 Oct 2022 17:49:45 -0300 Subject: [PATCH 35/46] Apply suggestions from code review Co-authored-by: Ankit Jain --- src/mono/mono/component/debugger-agent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index aa591c30ff6ab..8229ff8b29d54 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -1647,7 +1647,7 @@ mono_init_debugger_agent_for_wasm (int log_level_parm, MonoProfilerHandle *prof) agent_config.enabled = TRUE; - mono_init_debugger_agent_common (prof); + mono_init_debugger_agent_common (prof); } void @@ -2845,9 +2845,9 @@ is_suspended (void) { #ifdef HOST_WASM return true; -#else +#else return count_threads_to_wait_for () == 0; -#endif +#endif } static void @@ -3905,7 +3905,7 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) */ #ifndef HOST_WASM suspend_current_func (); -#endif +#endif } static void From a9d746856d283067e877169c88e80ca8d23fd3b7 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Tue, 25 Oct 2022 18:04:58 -0300 Subject: [PATCH 36/46] Addressing @radical comments, and trying to fix ci. --- src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs | 2 +- src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs | 10 ---------- .../wasm/debugger/tests/debugger-test/debugger-test.cs | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index 1fd077891705b..dd9597d20f56a 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -26,7 +26,7 @@ class Inspector ConcurrentDictionary> notifications = new (); ConcurrentDictionary>> eventListeners = new (); - ConcurrentQueue nextNotifications = new (); + ConcurrentQueue nextNotifications = new (); //in a multithreaded runtime we can receive more than one pause at same time public const string PAUSE = "pause"; public const string APP_READY = "app-ready"; public CancellationToken Token { get; } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index 48d90d51166e1..b933d9a055a68 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -1154,16 +1154,6 @@ public async Task TestDebugUsingMultiThreadedRuntime() locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); Assert.Equal(locals[1]["value"]["type"], "number"); Assert.Equal(locals[1]["name"], "currentThread"); - - pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); - locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); - Assert.Equal(locals[1]["value"]["type"], "number"); - Assert.Equal(locals[1]["name"], "currentThread"); - - pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1529, 8, "MultiThreadedTest.Write"); - locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); - Assert.Equal(locals[1]["value"]["type"], "number"); - Assert.Equal(locals[1]["name"], "currentThread"); } } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs index 0a400f0116dc7..741fb786161bb 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs @@ -1512,7 +1512,7 @@ public class MultiThreadedTest public static void Run() { System.Collections.Generic.List myThreads = new(); - for (int i = 0 ; i < 5; i++) + for (int i = 0 ; i < 3; i++) { var t = new System.Threading.Thread (() => Write("y")); myThreads.Add(t); From 391b94c6047e12b6b9fcf7dd34f78546f17da677 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 27 Jan 2023 10:16:21 -0300 Subject: [PATCH 37/46] Removing unnecessary changes. --- src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs | 4 ++++ src/mono/wasm/runtime/es6/dotnet.es6.lib.js | 2 -- src/mono/wasm/runtime/exports-linker.ts | 5 +---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs index 5123d4156c83b..9dca7f3208a1b 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs @@ -1588,6 +1588,10 @@ public static void Run() myThreads.Add(t); t.Start(); } + foreach (System.Threading.Thread curThread in myThreads) + { + curThread.Join(); + } } static void Write(string input) { diff --git a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js index fd287b3f6fdce..cb87a7a7e4d2b 100644 --- a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js @@ -115,8 +115,6 @@ const linked_functions = [ "mono_wasm_diagnostic_server_on_server_thread_created", "mono_wasm_diagnostic_server_on_runtime_server_init", "mono_wasm_diagnostic_server_stream_signal_work_available", - // mini-wasm-debugger.c - "mono_wasm_fire_debugger_agent_message_with_data", #endif ]; diff --git a/src/mono/wasm/runtime/exports-linker.ts b/src/mono/wasm/runtime/exports-linker.ts index 02521baa9ecad..6cbe9dd73ddd0 100644 --- a/src/mono/wasm/runtime/exports-linker.ts +++ b/src/mono/wasm/runtime/exports-linker.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import MonoWasmThreads from "consts:monoWasmThreads"; -import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; +import { mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; import { mono_wasm_release_cs_owned_object } from "./gc-handles"; import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu"; @@ -37,8 +37,6 @@ const mono_wasm_threads_exports = !MonoWasmThreads ? undefined : { mono_wasm_diagnostic_server_on_server_thread_created, mono_wasm_diagnostic_server_on_runtime_server_init, mono_wasm_diagnostic_server_stream_signal_work_available, - // mini-wasm-debugger.c - mono_wasm_fire_debugger_agent_message_with_data }; // the methods would be visible to EMCC linker @@ -51,7 +49,6 @@ export function export_linker(): any { // mini-wasm-debugger.c mono_wasm_asm_loaded, - mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, From 1e7f725291c850f6b3a5aa7073418edb29b6a293 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 27 Jan 2023 15:13:52 -0300 Subject: [PATCH 38/46] Export function used on mini-wasm-debugger. --- src/mono/wasm/runtime/exports-linker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/runtime/exports-linker.ts b/src/mono/wasm/runtime/exports-linker.ts index 6cbe9dd73ddd0..b19f36ef61a02 100644 --- a/src/mono/wasm/runtime/exports-linker.ts +++ b/src/mono/wasm/runtime/exports-linker.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import MonoWasmThreads from "consts:monoWasmThreads"; -import { mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; +import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; import { mono_wasm_release_cs_owned_object } from "./gc-handles"; import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu"; @@ -51,7 +51,7 @@ export function export_linker(): any { mono_wasm_asm_loaded, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, - + mono_wasm_fire_debugger_agent_message_with_data, // mono-threads-wasm.c schedule_background_exec, From e7779e801c8e965bb9d7c15a17080ecb630f84af Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Fri, 27 Jan 2023 15:34:47 -0300 Subject: [PATCH 39/46] Fixing line number. --- src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs index c7eb235fad7d6..fed9b6abb8d8e 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs @@ -1157,19 +1157,19 @@ public async Task TestDebugUsingMultiThreadedRuntime() var pause_location = await EvaluateAndCheck( "window.setTimeout(function() {" + expression + "; }, 1);", - "dotnet://debugger-test.dll/debugger-test.cs", 1599, 8, + "dotnet://debugger-test.dll/debugger-test.cs", 1598, 8, "MultiThreadedTest.Write"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); Assert.Equal(locals[1]["value"]["type"], "number"); Assert.Equal(locals[1]["name"], "currentThread"); - pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1599, 8, "MultiThreadedTest.Write"); + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1598, 8, "MultiThreadedTest.Write"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); Assert.Equal(locals[1]["value"]["type"], "number"); Assert.Equal(locals[1]["name"], "currentThread"); - pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1599, 8, "MultiThreadedTest.Write"); + pause_location = await StepAndCheck(StepKind.Resume, "dotnet://debugger-test.dll/debugger-test.cs", 1598, 8, "MultiThreadedTest.Write"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); Assert.Equal(locals[1]["value"]["type"], "number"); Assert.Equal(locals[1]["name"], "currentThread"); From 4e52809143fb27fa68cd446d58f7eefe35201475 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 30 Jan 2023 11:46:22 -0300 Subject: [PATCH 40/46] Fix run tests on release. --- src/mono/wasm/runtime/exports-linker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/runtime/exports-linker.ts b/src/mono/wasm/runtime/exports-linker.ts index b19f36ef61a02..733bdd952c310 100644 --- a/src/mono/wasm/runtime/exports-linker.ts +++ b/src/mono/wasm/runtime/exports-linker.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import MonoWasmThreads from "consts:monoWasmThreads"; -import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; +import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_fire_debugger_agent_message_with_data_to_pause, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug"; import { mono_wasm_release_cs_owned_object } from "./gc-handles"; import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu"; @@ -52,6 +52,7 @@ export function export_linker(): any { mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_fire_debugger_agent_message_with_data, + mono_wasm_fire_debugger_agent_message_with_data_to_pause, // mono-threads-wasm.c schedule_background_exec, From a28845a339f2be3b09dfdd5feb6eb2e7440591c3 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 30 Jan 2023 13:33:36 -0300 Subject: [PATCH 41/46] fix compilation for multithread runtime --- .../extra-platforms/runtime-extra-platforms-wasm.yml | 4 ++-- eng/pipelines/runtime-wasm-dbgtests.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 4ac774f64cf46..535e84feadb1b 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -100,7 +100,7 @@ jobs: - WasmTestOnBrowser - WasmTestOnNodeJS - # Library tests with full threading + # Library tests with full threading - template: /eng/pipelines/common/templates/wasm-library-tests.yml parameters: platforms: @@ -218,7 +218,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true + extraBuildArgs: /p:MonoWasmBuildVariant=multithread nameSuffix: DebuggerTests_MultiThreaded alwaysRun: true # always run when invoked manually isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} diff --git a/eng/pipelines/runtime-wasm-dbgtests.yml b/eng/pipelines/runtime-wasm-dbgtests.yml index ad6ec7ca566a8..77b064525cb9c 100644 --- a/eng/pipelines/runtime-wasm-dbgtests.yml +++ b/eng/pipelines/runtime-wasm-dbgtests.yml @@ -24,7 +24,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:WasmEnableThreads=true + extraBuildArgs: /p:MonoWasmBuildVariant=multithread nameSuffix: DebuggerTests_MultiThreaded isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} From 0034d64c1a32b4dd7b3ce93bbd347010168645d8 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 30 Jan 2023 14:54:02 -0300 Subject: [PATCH 42/46] trying to fix multithread debugger tests on ci --- .../debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj index 0f060cd413af9..c25f3d181c897 100644 --- a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj +++ b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj @@ -66,7 +66,7 @@ <_DotnetCommand Condition="'$(OS)' == 'Windows_NT'">dotnet.exe $(_DotnetCommand) test DebuggerTestSuite/DebuggerTestSuite.dll - $(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded + $(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded /e:WasmEnableThreads=true $(RunScriptCommand) "-l:trx%3BLogFileName=testResults.trx" $(RunScriptCommand) "-l:console%3BVerbosity=normal" From 2635990d1b08c4052432373dab2719141be04a6a Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 30 Jan 2023 16:32:19 -0300 Subject: [PATCH 43/46] trying to fix debugger tests on ci --- eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml | 2 +- eng/pipelines/runtime-wasm-dbgtests.yml | 2 +- .../debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 535e84feadb1b..b074cd666144d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -218,7 +218,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:MonoWasmBuildVariant=multithread + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded alwaysRun: true # always run when invoked manually isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} diff --git a/eng/pipelines/runtime-wasm-dbgtests.yml b/eng/pipelines/runtime-wasm-dbgtests.yml index 77b064525cb9c..85e66692f648a 100644 --- a/eng/pipelines/runtime-wasm-dbgtests.yml +++ b/eng/pipelines/runtime-wasm-dbgtests.yml @@ -24,7 +24,7 @@ jobs: platforms: - Browser_wasm - Browser_wasm_win - extraBuildArgs: /p:MonoWasmBuildVariant=multithread + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} diff --git a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj index c25f3d181c897..5d237210903dd 100644 --- a/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj +++ b/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj @@ -66,7 +66,7 @@ <_DotnetCommand Condition="'$(OS)' == 'Windows_NT'">dotnet.exe $(_DotnetCommand) test DebuggerTestSuite/DebuggerTestSuite.dll - $(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded /e:WasmEnableThreads=true + $(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded $(RunScriptCommand) "-l:trx%3BLogFileName=testResults.trx" $(RunScriptCommand) "-l:console%3BVerbosity=normal" From 33b648588c219f5578de4e8f5669a3987cca2110 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 30 Jan 2023 21:54:33 -0300 Subject: [PATCH 44/46] disabling tests on multithreaded runtime --- src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs | 4 ++-- .../debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs index 96dc8f25c07f9..ec2aa8a200f9c 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs @@ -22,7 +22,7 @@ public AsyncTests(ITestOutputHelper testOutput) : base(testOutput) // FIXME: check object properties.. //FIXME: function name - [ConditionalTheory(nameof(RunningOnChrome))] + [ConditionalTheory(nameof(WasmSingleThreaded), nameof(RunningOnChrome))] [InlineData("ContinueWithStaticAsync", "DebuggerTests.AsyncTests.ContinueWithTests.ContinueWithStaticAsync.AnonymousMethod__3_0")] [InlineData("ContinueWithInstanceAsync", "DebuggerTests.AsyncTests.ContinueWithTests.ContinueWithInstanceAsync.AnonymousMethod__5_0")] public async Task AsyncLocalsInContinueWith(string method_name, string expected_method_name) => await CheckInspectLocalsAtBreakpointSite( @@ -82,7 +82,7 @@ public async Task AsyncLocalsInNestedContinueWithStaticBlock() => await CheckIns }, "locals"); }); - [Theory] + [ConditionalTheory(nameof(WasmSingleThreaded), nameof(RunningOnChrome))] [InlineData("Run", 246, 16, 252, 16, "RunCSharpScope")] [InlineData("RunContinueWith", 277, 20, 283, 20, "RunContinueWithSameVariableName")] [InlineData("RunNestedContinueWith", 309, 24, 315, 24, "RunNestedContinueWithSameVariableName.AnonymousMethod__1")] diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs index a03dced95ef70..e43a9f3e0974a 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs @@ -205,7 +205,7 @@ public async Task EvaluateStaticClassInvalidField() => await CheckInspectLocalsA AssertEqual("Failed to resolve member access for DebuggerTests.InvalidEvaluateStaticClass.StaticProperty2", res.Error["result"]?["description"]?.Value(), "wrong error message"); }); - [ConditionalFact(nameof(RunningOnChrome))] + [ConditionalFact(nameof(WasmSingleThreaded), nameof(RunningOnChrome))] public async Task AsyncLocalsInContinueWithBlock() => await CheckInspectLocalsAtBreakpointSite( "DebuggerTests.AsyncTests.ContinueWithTests", "ContinueWithStaticAsync", 4, "DebuggerTests.AsyncTests.ContinueWithTests.ContinueWithStaticAsync.AnonymousMethod__3_0", "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerTests.AsyncTests.ContinueWithTests:RunAsync'); })", From 4cd3536cc1f845fcc4afdc69790b9f06590c22d4 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Wed, 1 Feb 2023 15:51:54 -0300 Subject: [PATCH 45/46] Update eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml Co-authored-by: Ankit Jain --- eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index b074cd666144d..39c5544258d03 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -220,7 +220,7 @@ jobs: - Browser_wasm_win extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true nameSuffix: DebuggerTests_MultiThreaded - alwaysRun: true # always run when invoked manually + alwaysRun: ${{ parameters.isWasmOnlyBuild }} isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} From c78ec41ac428a9ae4ebe5794c00f5788f872b6e3 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Wed, 1 Feb 2023 17:01:45 -0300 Subject: [PATCH 46/46] Throwing an exception if the "what" is not the one that is being get from the nextNotificationQueue. --- .../wasm/debugger/DebuggerTestSuite/Inspector.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs index da26dd1d9e2ff..b86838431448b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs @@ -26,7 +26,7 @@ class Inspector ConcurrentDictionary> notifications = new (); ConcurrentDictionary>> eventListeners = new (); - ConcurrentQueue nextNotifications = new (); //in a multithreaded runtime we can receive more than one pause at same time + ConcurrentQueue<(string, JObject)> nextNotifications = new (); //in a multithreaded runtime we can receive more than one pause at same time public const string PAUSE = "pause"; public const string APP_READY = "app-ready"; public CancellationToken Token { get; } @@ -88,11 +88,13 @@ public Task WaitFor(string what) throw new Exception($"Invalid internal state, waiting for {what} while another wait is already setup"); } - else if (nextNotifications.TryDequeue(out var notification)) + else if (nextNotifications.TryDequeue(out (string what, JObject args) notification)) { var n = new TaskCompletionSource(); - Client.CurrentSessionId = new SessionId(notification["sessionId"]?.Value()); - n.SetResult(notification); + Client.CurrentSessionId = new SessionId(notification.args["sessionId"]?.Value()); + if (what != notification.what) + throw new Exception($"Unexpected different notification type"); + n.SetResult(notification.args); return n.Task; } else @@ -115,7 +117,7 @@ void NotifyOf(string what, JObject args) { if (tcs.Task.IsCompleted) { - nextNotifications.Enqueue(args); + nextNotifications.Enqueue((what, args)); return; //throw new Exception($"Invalid internal state. Notifying for {what} again, but the previous one hasn't been read."); }