Skip to content

[wasm] Misc debugger improvements - #68988

Merged
radical merged 23 commits into
dotnet:mainfrom
radical:misc-dbg-changes
May 13, 2022
Merged

radical merged 23 commits into
dotnet:mainfrom
radical:misc-dbg-changes

Conversation

@radical

@radical radical commented May 6, 2022 •

Copy link
Copy Markdown
Member
  • Extract browser provisioning from debugger tests, and make it usable more generally
  • Other improvements to the debug proxy, making it more usable from other projects (like the upcoming wasm-app-host)

Extracted from #68696

Added by @thaystg:

  • --wait-for-debugger - If requested, then it will cause invocation of main to be delayed till a debugger is attached.
  • Add support for setting an automatic breakpoint on the first line of the entrypoint method (Main). This will be
    useful for debugging with the upcoming wasm-app-host, along with the use of wait-for-debugger.

radical added 10 commits May 6, 2022 17:41
.. from `DebuggerTestSuite.csproj`. This will allow other projects to
use this too.
so it can be used outside the debugger tests project too. For example,
with Wasm.Build.Tests+playwright .
.. using `ExceptionDispatchInfo.Capture` so we get the original stack
trace.
- like logging
- updated API to make it easier to use by other projects, like the
  upcoming wasm-app-host .
.. on the first line of the entrypoint method (`Main`). This will be
useful for debugging with the upcoming wasm-app-host, along with the use
of `wait-for-debugger`.

Implemented by @thaystg .
If requested, then it will cause invocation of `main` to be delayed till
a debugger is attached.

Implemented by @thaystg
.. in the lead up to wasm-app-host tests.
.. to include templates, and provisioning props.
@radical radical added arch-wasm WebAssembly architecture area-Debugger-mono labels May 6, 2022
@ghost ghost assigned radical May 6, 2022
@ghost

ghost commented May 6, 2022

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Extract browser provisioning from debugger tests, and make it usable more generally
  • Add support for wait_for_debugger, and setting automatic breakpoints on the first line of the entrypoint (- @thaystg)
  • Other improvements to the debug proxy, making it more usable from other projects (like the upcoming wasm-app-host)

Extracted from #68696

Author: radical
Assignees: -
Labels:

arch-wasm, area-Debugger-mono

Milestone: -

@radical

radical commented May 9, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radical
radical requested review from lewing and thaystg May 9, 2022 22:03
@radical
radical marked this pull request as ready for review May 9, 2022 22:03
@radical
radical requested a review from marek-safar as a code owner May 9, 2022 22:03
@radical

radical commented May 10, 2022

Copy link
Copy Markdown
Member Author

cc @radekdoulik I added some minimal sourceName changes to the templates.

@radical

radical commented May 10, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radical

radical commented May 10, 2022

Copy link
Copy Markdown
Member Author

wasm/AOT failure is NRE in linker: dotnet/linker#2789

@radical

radical commented May 10, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radical
radical requested a review from ilonatommy May 10, 2022 15:45

@thaystg thaystg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Comment on lines +1448 to +1449
// FIXME: id
string bpId = "bp://99999";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we do anything specific with the bp id format? If we're making one up can't we do something a little more obvious?

public MethodInfo FindEntryPoint()
{
if (_entryPoint is null)
_entryPoint = assemblies.Where(asm => asm.EntryPoint is not null).Select(asm => asm.EntryPoint).FirstOrDefault();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is assemblies guaranteed to be in the correct order for this to work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assumption here is that there will be only one assembly with an entry point. If not, then yeah, the order would matter.

@radical

radical commented May 12, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radical

radical commented May 13, 2022

Copy link
Copy Markdown
Member Author

Chrome debugger tests are passing.

@radical
radical merged commit c26475c into dotnet:main May 13, 2022
@radical
radical deleted the misc-dbg-changes branch May 13, 2022 02:00
@ghost ghost locked as resolved and limited conversation to collaborators Jun 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Debugger-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants