diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md
index 242e6c9cee4a90..f060a00f9b4588 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 505b3a8bde603a..09311ffd96ef71 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 7711fdbe273733..0ab461d05d8377 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 de7c0e3741b74b..d1cf986b3cccfb 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))