Skip to content

Improve debugging #186

@elringus

Description

@elringus

Currently, even in debug builds, when an exception occurs in the managed C# code, the error information is very limited:

marshal-to-js.ts:420 Uncaught ManagedError: How low hello!
an @ marshal-to-js.ts:420
gn @ managed-exports.ts:316
(anonymous) @ invoke-cs.ts:148
setSkipMode @ index.mjs:358
(anonymous) @ playback.tsx:29
(anonymous) @ playback.tsx:104
(anonymous) @ button.tsx:41

We are copying the debug artifacts to the output directory:

<!-- Publish debug symbols and maps when aggressive trimming is disabled. -->
<ItemGroup>
<BootsharpMaps Include="$(BootsharpBuildDirectory)/*.map"/>
<BootsharpSymbols Include="$(BootsharpBuildDirectory)/*.symbols"/>
<BootsharpPdbs Include="$(BootsharpBuildDirectory)/*.pdb"/>
</ItemGroup>
<Copy Condition="'$(BootsharpAggressiveTrimming)' != 'true' And '$(BootsharpEmbedBinaries)' != 'true'"
SourceFiles="@(BootsharpMaps)" DestinationFolder="$(BootsharpBinariesDirectory)"/>
<Copy Condition="'$(BootsharpAggressiveTrimming)' != 'true' And '$(BootsharpEmbedBinaries)' != 'true'"
SourceFiles="@(BootsharpSymbols)" DestinationFolder="$(BootsharpBinariesDirectory)"/>
<Copy Condition="'$(BootsharpAggressiveTrimming)' != 'true' And '$(BootsharpEmbedBinaries)' != 'true'"
SourceFiles="@(BootsharpPdbs)" DestinationFolder="$(BootsharpBinariesDirectory)"/>

— but it looks like they are not being used, even when explicitly setting <DebugType>full</DebugType>.

Ideally, we'd like to make the JS debugger work with Bootsharp, but at the very least, we need to find a way to make the errors contain legible stack traces.

If anyone is interested in working on this or has ideas on how to tackle the issue — please share them here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or enhancementhelp wantedCommunity assistance is most appreciated

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions