From 8d102e3fc2d6d3e63044b83f434eb2bb5263c4b2 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Mon, 12 Apr 2021 13:01:25 -0400 Subject: [PATCH] [wasm][tests] Enable line numbers in stack traces (#50893) --- .../testing/libraries/testing-wasm.md | 6 ++++++ eng/testing/tests.wasm.targets | 21 ++++++++++++++++++- src/mono/wasm/build/WasmApp.targets | 5 +++++ src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 4 ++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md index 242e6c9cee4a9..f060a00f9b458 100644 --- a/docs/workflow/testing/libraries/testing-wasm.md +++ b/docs/workflow/testing/libraries/testing-wasm.md @@ -144,6 +144,12 @@ At the moment supported values are: By default, `chrome` browser is used. +## Debugging + +### Getting more information + +- Line numbers: add `/p:DebuggerSupport=true` to the command line, for `Release` builds. It's enabled by default for `Debug` builds. + ## Kicking off outer loop tests from GitHub Interface Add the following to the comment of a PR. diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 505b3a8bde603..09311ffd96ef7 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -2,6 +2,7 @@ $(BundleTestAppTargets);BundleTestWasmApp + true @@ -27,7 +28,9 @@ true false false - false + + + false @@ -62,6 +65,9 @@ $(InvariantGlobalization) true false + + true + -1 @@ -79,4 +85,17 @@ + + + + + <_PdbFilesToCheck Include="$([System.IO.Path]::ChangeExtension('%(ResolvedFileToPublish.Identity)', '.pdb'))" + Condition="'%(ResolvedFileToPublish.Extension)' == '.dll'" /> + + + + diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 7711fdbe27373..0ab461d05d837 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -20,7 +20,12 @@ - $(WasmNativeStrip) - Whenever to strip the native executable. Defaults to true. - $(WasmLinkIcalls) - Whenever to link out unused icalls. Defaults to $(WasmBuildNative). - $(RunAOTCompilation) - Defaults to false. + - $(WasmDebugLevel) + > 0 enables debugging and sets the debug log level to debug_level + == 0 disables debugging and enables interpreter optimizations + < 0 enabled debugging and disables debug logging. + - $(WasmNativeDebugSymbols) - Build with native debug symbols, useful only with `$(RunAOTCompilation)`, or `$(WasmBuildNative)` Defaults to true. - $(WasmDedup) - Whenever to dedup generic instances when using AOT. Defaults to true. diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index de7c0e3741b74..d1cf986b3cccf 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -150,7 +150,7 @@ public override bool Execute () foreach (var assembly in _assemblies) { FileCopyChecked(assembly, Path.Join(asmRootPath, Path.GetFileName(assembly)), "Assemblies"); - if (DebugLevel > 0) + if (DebugLevel != 0) { var pdb = assembly; pdb = Path.ChangeExtension(pdb, ".pdb"); @@ -173,7 +173,7 @@ public override bool Execute () foreach (var assembly in _assemblies) { config.Assets.Add(new AssemblyEntry(Path.GetFileName(assembly))); - if (DebugLevel > 0) { + if (DebugLevel != 0) { var pdb = assembly; pdb = Path.ChangeExtension(pdb, ".pdb"); if (File.Exists(pdb))