未验证 提交 8d102e3f 编写于 作者: A Ankit Jain 提交者: GitHub

[wasm][tests] Enable line numbers in stack traces (#50893)

上级 2ada920c
......@@ -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.
......
......@@ -2,6 +2,7 @@
<!-- We need to set this in order to get extensibility on xunit category traits and other arguments we pass down to xunit via MSBuild properties -->
<PropertyGroup>
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(RunScriptCommand)' == ''">
......@@ -27,7 +28,9 @@
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<DebuggerSupport>false</DebuggerSupport>
<!-- we want to default to what Blazor has, except if we are building in Debug config -->
<DebuggerSupport Condition="'$(Configuration)' != 'Debug'">false</DebuggerSupport>
</PropertyGroup>
<!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
......@@ -62,6 +65,9 @@
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
<WasmNativeStrip>false</WasmNativeStrip>
<WasmNativeDebugSymbols Condition="'$(DebuggerSupport)' == 'true' and '$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
<WasmDebugLevel Condition="'$(DebuggerSupport)' == 'true' and '$(WasmDebugLevel)' == ''">-1</WasmDebugLevel>
</PropertyGroup>
<ItemGroup>
......@@ -79,4 +85,17 @@
<WasmFilesToIncludeInFileSystem Include="@(WasmFilesToIncludeFromPublishDir -> '$(PublishDir)%(Identity)')" />
</ItemGroup>
</Target>
<!-- linker automatically picks up the .pdb files, but they are not added to the publish list.
Add them explicitly here, so they can be used with WasmAppBuilder -->
<Target Name="AddPdbFilesToPublishList" AfterTargets="ILLink" Condition="'$(DebuggerSupport)' == 'true'">
<ItemGroup>
<_PdbFilesToCheck Include="$([System.IO.Path]::ChangeExtension('%(ResolvedFileToPublish.Identity)', '.pdb'))"
Condition="'%(ResolvedFileToPublish.Extension)' == '.dll'" />
<ResolvedFileToPublish Include="@(_PdbFilesToCheck)"
Condition="Exists(%(_PdbFilesToCheck.Identity))"
RelativePath="%(_PdbFilesToCheck.FileName)%(_PdbFilesToCheck.Extension)" />
</ItemGroup>
</Target>
</Project>
......@@ -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.
......
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册