Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Misc debugger improvements #68988

Merged
merged 23 commits into from
May 13, 2022
Merged

Conversation

radical
Copy link
Member

@radical radical commented May 6, 2022

  • 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
Copy link

ghost commented May 6, 2022

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
Copy link
Member Author

radical commented May 9, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical radical requested review from thaystg and lewing 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
Copy link
Member Author

radical commented May 10, 2022

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

@radical
Copy link
Member Author

radical commented May 10, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member Author

radical commented May 10, 2022

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

@radical
Copy link
Member Author

radical commented May 10, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

@thaystg thaystg left a comment

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
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
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
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
Copy link
Member Author

radical commented May 12, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member Author

radical commented May 13, 2022

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