Skip to content

[wasm][debugger] Debug on firefox #61776

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

Merged
merged 158 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
e10c2dc
First compiling and working version just proxying messages.
thaystg Oct 15, 2021
d598dd8
almost working, already showing the cs files
thaystg Oct 21, 2021
c92571e
Merge branch 'dotnet:main' into debug_on_firefox
thaystg Nov 5, 2021
f7e912f
Working on firefox.
thaystg Nov 5, 2021
09651b6
merge
thaystg Nov 5, 2021
f771c08
Use internal e not public.
thaystg Nov 5, 2021
260f6bb
Merge branch 'dotnet:main' into debug_on_firefox
thaystg Nov 16, 2021
2f864b3
merge
thaystg Nov 16, 2021
79e5287
Debugging on firefox working.
thaystg Nov 18, 2021
45145b0
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Nov 18, 2021
4385ea2
Working after the merge
thaystg Nov 18, 2021
dddb671
Keep the TcpListener open and use a random port.
thaystg Nov 18, 2021
fa407b3
Show null value.
thaystg Nov 18, 2021
9bce161
- Show JS Callstack
thaystg Nov 22, 2021
f0108c5
Merge branch 'main' into debug_on_firefox
thaystg Feb 7, 2022
9702467
Fix compilation
thaystg Feb 7, 2022
e899795
Infrastructure to run debugger tests.
thaystg Feb 17, 2022
4ae5d1f
Merge branch 'main' into debug_on_firefox
thaystg Feb 17, 2022
9941f61
fix merge
thaystg Feb 17, 2022
4747240
run test.
thaystg Feb 17, 2022
f1edaf2
Skipping tests that are not passing on Firefox.
thaystg Feb 18, 2022
aac99db
Skipping tests that are not passing on Firefox.
thaystg Feb 18, 2022
e8643d7
Passing 13 steppingtests.
thaystg Feb 21, 2022
7027682
Passing 13 steppingtests.
thaystg Feb 21, 2022
9f62d55
Passing 13 steppingtests.
thaystg Feb 21, 2022
264ef45
Failed: 0, Passed: 39, Skipped: 203, Total: 242, Duration:…
thaystg Feb 22, 2022
8de94c0
Failed: 0, Passed: 66, Skipped: 195, Total: 261, Duration:…
thaystg Feb 23, 2022
763ee28
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Feb 23, 2022
8d0df7f
Using ConditionalTheory and ConditionalFact implemented by @radical.
thaystg Feb 23, 2022
3fb4485
Fixing side effect.
thaystg Feb 23, 2022
f2fea14
Implemented conditional breakpoints.
thaystg Feb 25, 2022
1d24199
Fix special characters and pointers.
thaystg Feb 25, 2022
c0a7ad8
Merge remote-tracking branch 'origin/main' into HEAD
thaystg Mar 3, 2022
414cf84
Fix merge
thaystg Mar 4, 2022
78ccf7d
Run debugger-tests on firefox using codespace
thaystg Mar 4, 2022
2ba3858
Starting firefox correctly not stopping in the breakpoint yet.
thaystg Mar 4, 2022
bc40911
Remove unnecessary change
thaystg Mar 4, 2022
8e336e6
Fix pause behavior (now showing correctly, pause on breakpoint, pause…
thaystg Mar 10, 2022
a61e054
Merge branch 'debug_on_firefox' of github.com:thaystg/runtime into de…
thaystg Mar 14, 2022
893eb93
Fix local tests.
thaystg Mar 14, 2022
4328f2e
Fix missing )
thaystg Mar 14, 2022
2eb365f
Passing 190 tests, evaluate expressions working.
thaystg Mar 14, 2022
ff32a09
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Mar 15, 2022
2ea4c11
Remove Task.Delays.
thaystg Mar 15, 2022
6e5bbcb
Fix container creation
thaystg Mar 16, 2022
ece9464
Trying to run firefox tests on CI.
thaystg Mar 16, 2022
04709f9
Moving file to the right place.
thaystg Mar 16, 2022
7b56aff
Trying to run debugger-tests using firefox on CI.
thaystg Mar 16, 2022
2c6d5a0
fixing path
thaystg Mar 16, 2022
bd0f5f9
Missing url to download firefox on helix.
thaystg Mar 16, 2022
ef89267
On run the tests only on linux.
thaystg Mar 16, 2022
9cacda0
Trying to download firefox on helix.
thaystg Mar 16, 2022
11e4541
fix error on helix-wasm.targets.
thaystg Mar 16, 2022
3ee2e71
trying to fix ci
thaystg Mar 16, 2022
24c2c3a
trying to install firefox on helix.
thaystg Mar 17, 2022
5e9cb08
Fixing firefox path
thaystg Mar 17, 2022
00cd17b
Fix debugger tests on firefox
thaystg Mar 17, 2022
ad5638f
fixing profile path
thaystg Mar 17, 2022
333eb08
Install libdbus-glib-1-2 on docker and on codespace
thaystg Mar 18, 2022
6c1a192
Merge remote-tracking branch 'thaystg/main' into pr/thaystg/61776
thaystg Mar 22, 2022
a489225
Trying to run using firefox on CI
thaystg Mar 23, 2022
f2e3051
update docker image
thaystg Mar 29, 2022
16f1135
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Mar 29, 2022
b647188
Adding more messages to see errors on CI
thaystg Mar 30, 2022
f8708c0
Trying to make it work on CI
thaystg Mar 30, 2022
313ec7b
Real test on CI
thaystg Apr 5, 2022
54f2350
Trying to use the firefox machine only to run firefox tests
thaystg Apr 5, 2022
cce27bf
Fix CI
thaystg Apr 6, 2022
2e33511
Fix CI
thaystg Apr 6, 2022
b67866d
Fix CI.
thaystg Apr 6, 2022
61a4134
Remove unnecessary changes.
thaystg Apr 6, 2022
69e3f14
Using machine with sudo installed
thaystg Apr 7, 2022
7167698
Addressing @lewing comments
thaystg Apr 7, 2022
4a94caf
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Apr 7, 2022
0e945d7
Fix run tests on codespace
thaystg Apr 7, 2022
62ba428
Use default image to build and new image only to run firefox tests
thaystg Apr 7, 2022
d659c7e
Fix unrelated change
thaystg Apr 7, 2022
139c99b
Fix ci
thaystg Apr 7, 2022
2772881
check python version
thaystg Apr 7, 2022
036cdad
Print python versions
thaystg Apr 7, 2022
7a129d4
Using image with PIP installed
thaystg Apr 8, 2022
7563fc0
Using image with pip updated
thaystg Apr 8, 2022
4808df4
Remove unrelated changes
thaystg Apr 8, 2022
f42996d
Trying to fix evaluate tests.
thaystg Apr 8, 2022
c4f037b
Fix evaluateoncallframe tests
thaystg Apr 9, 2022
9ac40e2
Trying to fix evaluation tests.
thaystg Apr 9, 2022
6556737
trying to fix evaluateoncallframetests
thaystg Apr 9, 2022
5701a1b
fiz evaluateoncallframetests
thaystg Apr 9, 2022
fc8c3a4
Trying to kill firefox to avoid errors.
thaystg Apr 11, 2022
1e53470
Trying to fix EvaluateOnCallFrameTests
thaystg Apr 11, 2022
c82089b
Fix CI
thaystg Apr 11, 2022
1c3422b
Remove failing test
thaystg Apr 11, 2022
81533b9
Fix misctests
thaystg Apr 11, 2022
d285e8a
Fix other build errors.
thaystg Apr 12, 2022
38a447c
Trying to fix CI.
thaystg Apr 12, 2022
97dd69f
Fix CI
thaystg Apr 12, 2022
7849fc8
Remove unecessary message.
thaystg Apr 12, 2022
da325e1
Update src/tests/BuildWasmApps/Wasm.Debugger.Tests/Wasm.Debugger.Test…
thaystg Apr 13, 2022
b40fc28
Addressing @radical comments
thaystg Apr 13, 2022
17c8178
Merge branch 'main' into debug_on_firefox
thaystg Apr 13, 2022
db88f32
Merge error while accept @radical suggestion
thaystg Apr 13, 2022
e07b93d
Merge error while accept @radical suggestion
thaystg Apr 13, 2022
16e2bdb
Update src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
thaystg Apr 13, 2022
047fdd8
Apply suggestions from code review
thaystg Apr 13, 2022
9d5fc91
Addressing @radical comments
thaystg Apr 13, 2022
90378e4
Abort the tcp connection if the proxy throws an exception
radical Apr 13, 2022
c689e35
Refactor a bit
radical Apr 14, 2022
4b759b8
Use more compile time checks for chrome vs firefox
radical Apr 14, 2022
f3f1e12
fix pipeline
radical Apr 14, 2022
ada03eb
Make debugger job names unique by including the browser
radical Apr 14, 2022
0a3cc1b
Merge remote-tracking branch 'origin/main' into debug_on_firefox
radical Apr 14, 2022
603f98d
fix runtime-wasm pipeline
radical Apr 14, 2022
b62bcc3
fix firefox ci job
radical Apr 14, 2022
f1ab005
split into more files
radical Apr 14, 2022
92c6335
Merge remote-tracking branch 'origin/main' into debug_on_firefox
radical Apr 14, 2022
fdf544b
cleanup
radical Apr 14, 2022
69ca9ec
Add support for running chrome, and firefox tests in the same job
radical Apr 14, 2022
53630d9
fix yml
radical Apr 14, 2022
55b1756
fix build
radical Apr 14, 2022
ceee615
fix build
radical Apr 14, 2022
4006e2a
fix windows build
radical Apr 14, 2022
868c0a3
Don't delete profile folder nor pkill firefox
thaystg Apr 14, 2022
24cd9a9
Delete and create a new profile folder for each execution
thaystg Apr 14, 2022
dc557a5
fix helix command line
radical Apr 14, 2022
79c9fde
[wasm][debugger] Fix tests broken on 'main'
radical Apr 14, 2022
d999f29
Merge remote-tracking branch 'origin/main' into debug_on_firefox
radical Apr 14, 2022
ffd95d8
wip
radical Apr 14, 2022
4317edc
big refactor
radical Apr 15, 2022
3292593
chrome runs
radical Apr 15, 2022
923cb58
ff runs
radical Apr 15, 2022
8b0a204
ff runs
radical Apr 15, 2022
f687edd
Merge remote-tracking branch 'origin/main' into debug_on_firefox
radical Apr 15, 2022
adbbe22
cleanup
radical Apr 15, 2022
9442956
cleanup
radical Apr 15, 2022
128ffe1
cleanup
radical Apr 15, 2022
8dadeda
change console verbosity to info, for proxy
radical Apr 15, 2022
b287881
More refactoring
radical Apr 15, 2022
6e56ffb
Merge remote-tracking branch 'origin/main' into thays/debug_on_firefox
radical Apr 18, 2022
73f2923
Merge remote-tracking branch 'origin/main' into thays/debug_on_firefox
radical Apr 19, 2022
5eaad18
More refactoring, and fix some issues with connections, and other
radical Apr 19, 2022
5cb04d1
some cleanup
radical Apr 19, 2022
e73f107
fix file name
radical Apr 19, 2022
3309156
Improve cleanup after tests
radical Apr 19, 2022
4802608
Merge remote-tracking branch 'origin/main' into upstream-debug_on_fir…
radical Apr 21, 2022
6f2e6a4
Merge remote-tracking branch 'origin/main' into upstream-debug_on_fir…
radical Apr 22, 2022
913e877
some refactoring, fixing some hangs, faster failures etc
radical Apr 22, 2022
d4167e3
Merge remote-tracking branch 'origin/main' into thays/debug_on_firefox
radical Apr 22, 2022
d56a9d6
Fix BrowserCrash test for chrome
radical Apr 22, 2022
fcd0953
Merge remote-tracking branch 'origin/main' into thays/debug_on_firefox
radical Apr 22, 2022
09d62d2
fix up logging
radical Apr 22, 2022
4a84b86
Improve error handling for the proxy running independently
radical Apr 22, 2022
d78dc45
fix debugging from vscode
radical Apr 22, 2022
d2e10b2
proxy host: add --log-path for logs
radical Apr 22, 2022
a2ab855
support canceling for the proxy host too, and distinguish different i…
radical Apr 22, 2022
bbfc27f
Merge remote-tracking branch 'origin/main' into debug_on_firefox
thaystg Apr 25, 2022
bb2659e
Fix debugger after refreshing the debugged page.
thaystg Apr 25, 2022
9a3a335
Fixing chrome debugging.
thaystg Apr 25, 2022
96c4197
Fix startup to work on chrome and also on firefox.
thaystg Apr 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ RUN sudo apt-get install libnss3 -y \
&& apt-get install libgbm-dev -y \
&& apt-get install libpango-1.0-0 -y \
&& apt-get install libcairo2 -y \
&& apt-get install libasound2 -y
&& apt-get install libasound2 -y

#install firefox dependecies to run debugger tests:
RUN sudo apt-get install libdbus-glib-1-2 -y \
&& apt-get install libgtk-3-0 -y \
&& apt-get install libx11-xcb-dev -y
24 changes: 24 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,30 @@ jobs:
platforms: ${{ parameters.platforms }}
${{ insert }}: ${{ parameters.jobParameters }}

# WebAssembly Linux Firefox

- ${{ if containsValue(parameters.platforms, 'Browser_wasm_firefox') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: Browser
archType: wasm
targetRid: browser-wasm
platform: Browser_wasm_firefox
container:
image: ubuntu-18.04-webassembly-20220317214646-1ad56e8
registry: mcr
jobParameters:
hostedOs: Linux
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
${{ insert }}: ${{ parameters.jobParameters }}

# WebAssembly on Windows

- ${{ if containsValue(parameters.platforms, 'Browser_wasm_win') }}:
Expand Down
9 changes: 5 additions & 4 deletions eng/pipelines/common/templates/wasm-debugger-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
alwaysRun: false
isExtraPlatformsBuild: false
browser: 'chrome'
platforms: []

jobs:
Expand All @@ -24,8 +25,8 @@ jobs:
jobParameters:
testGroup: innerloop
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
nameSuffix: Mono_DebuggerTests
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs)
nameSuffix: Mono_DebuggerTests_${{ parameters.browser }}
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }}
timeoutInMinutes: 180
condition: >-
or(
Expand All @@ -36,7 +37,7 @@ jobs:
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=$(_hostedOs)
testRunNamePrefixSuffix: Mono_${{ parameters.browser }}_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=$(_hostedOs) /p:_DebuggerHosts=${{ parameters.browser }}
scenarios:
- wasmdebuggertests
4 changes: 4 additions & 0 deletions eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ jobs:
- ${{ if eq(parameters.platform, 'Browser_wasm') }}:
- Ubuntu.1804.Amd64.Open

# WebAssembly Firefox
- ${{ if eq(parameters.platform, 'Browser_wasm_firefox') }}:
- (Ubuntu.1804.Amd64)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20220408155625-5bc1463

# WebAssembly windows
- ${{ if eq(parameters.platform, 'Browser_wasm_win') }}:
- (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly-20220317203903-1ad56e8
Expand Down
7 changes: 7 additions & 0 deletions eng/pipelines/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,10 @@ jobs:
platforms:
- Browser_wasm
alwaysRun: ${{ parameters.isWasmOnlyBuild }}

- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml
parameters:
platforms:
- Browser_wasm_firefox
browser: firefox
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
7 changes: 7 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ jobs:
- Browser_wasm_win
alwaysRun: ${{ variables.isRollingBuild }}

- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml
parameters:
platforms:
- Browser_wasm_firefox
browser: firefox
alwaysRun: ${{ variables.isRollingBuild }}

#
# Build the whole product using Mono and run libraries tests
#
Expand Down
29 changes: 21 additions & 8 deletions src/libraries/sendtohelix-wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<PropertyGroup>
<_workItemTimeout Condition="'$(Scenario)' == 'BuildWasmApps' and '$(_workItemTimeout)' == ''">01:30:00</_workItemTimeout>
<_workItemTimeout Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true'">01:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == 'WasmDebuggerTests'">00:30:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == 'WasmDebuggerTests'">01:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == 'WasmTestOnBrowser' and '$(BrowserHost)' == 'windows'">00:45:00</_workItemTimeout>

<IsWasmDebuggerTests Condition="'$(Scenario)' == 'WasmDebuggerTests'">true</IsWasmDebuggerTests>
<IsRunningLibraryTests Condition="'$(Scenario)' == 'normal' or '$(Scenario)' == 'WasmTestOnBrowser' or '$(Scenario)' == 'WasmTestOnNodeJs'">true</IsRunningLibraryTests>

<BuildHelixWorkItemsDependsOn>$(BuildHelixWorkItemsDependsOn);StageEmSdkForHelix;PrepareForBuildHelixWorkItems_Wasm</BuildHelixWorkItemsDependsOn>
<BuildHelixWorkItemsDependsOn Condition="'$(WindowsShell)' != 'true'">$(BuildHelixWorkItemsDependsOn);DownloadFirefoxToSendToHelix</BuildHelixWorkItemsDependsOn>
<IncludeHelixCorrelationPayload>false</IncludeHelixCorrelationPayload>
<EnableDefaultBuildHelixWorkItems Condition="'$(IsRunningLibraryTests)' != 'true'">false</EnableDefaultBuildHelixWorkItems>

Expand All @@ -18,6 +19,8 @@
<!-- on unix CI has emscripten provisioned in $(EMSDK_PATH) as `/usr/local/emscripten`. -->
<EMSDK_PATH Condition="$([MSBuild]::IsOSPlatform('WINDOWS')) and '$(EMSDK_PATH)' == ''">$(RepoRoot)src\mono\wasm\emsdk\</EMSDK_PATH>
<EmSdkDirForHelixPayload>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDirForHelixPayload>
<FirefoxForHelixPayload>$(TestArchiveRoot)firefox.zip</FirefoxForHelixPayload>
<DebuggerHost Condition="'$(DebuggerHost)' == ''">chrome</DebuggerHost>

<NeedsWorkload Condition="'$(Scenario)' == 'BuildWasmApps'">true</NeedsWorkload>
<NeedsEMSDK Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true' or '$(Scenario)' == 'BuildWasmApps'">true</NeedsEMSDK>
Expand Down Expand Up @@ -47,8 +50,8 @@
<HelixPreCommand Include="export XHARNESS_DISABLE_COLORED_OUTPUT=true" />
<HelixPreCommand Include="export XHARNESS_LOG_WITH_TIMESTAMPS=true" />

<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/$(ChromeDriverDirName):$PATH" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/$(ChromiumDirName):$PATH" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(DebuggerHost)' == 'chrome'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/$(ChromeDriverDirName):$PATH" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(DebuggerHost)' == 'chrome'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/$(ChromiumDirName):$PATH" />
</ItemGroup>

<ItemGroup Condition="'$(WindowsShell)' == 'true'">
Expand All @@ -60,8 +63,8 @@
<HelixPreCommand Include="set XHARNESS_DISABLE_COLORED_OUTPUT=true" />
<HelixPreCommand Include="set XHARNESS_LOG_WITH_TIMESTAMPS=true" />

<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\$(ChromeDriverDirName)%3B%PATH%" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\$(ChromiumDirName)%3B%PATH%" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(DebuggerHost)' == 'chrome'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\$(ChromeDriverDirName)%3B%PATH%" />
<HelixPreCommand Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(DebuggerHost)' == 'chrome'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\$(ChromiumDirName)%3B%PATH%" />
</ItemGroup>

<ItemGroup Condition="'$(NeedsEMSDKNode)' == 'true' and '$(WindowsShell)' != 'true'">
Expand Down Expand Up @@ -127,8 +130,11 @@
</PropertyGroup>

<ItemGroup Condition="'$(NeedsToRunOnBrowser)' == 'true'">
<HelixCorrelationPayload Include="chromium" Uri="$(ChromiumUrl)" />
<HelixCorrelationPayload Include="chromedriver" Uri="$(ChromeDriverUrl)" />
<HelixCorrelationPayload Condition="'$(DebuggerHost)' == 'chrome'" Include="chromium" Uri="$(ChromiumUrl)" />
<HelixCorrelationPayload Condition="'$(DebuggerHost)' == 'chrome'" Include="chromedriver" Uri="$(ChromeDriverUrl)" />

<!--<HelixCorrelationPayload Condition="'$(WindowsShell)' != 'true' and '$(DebuggerHost)' == 'firefox'" Include="firefox" Uri="$(FirefoxUrl)" />-->
<HelixCorrelationPayload Condition="'$(WindowsShell)' != 'true' and '$(DebuggerHost)' == 'firefox'" Include="$(FirefoxForHelixPayload)" />
</ItemGroup>

<ItemGroup Condition="'$(NeedsEMSDK)' == 'true'">
Expand Down Expand Up @@ -198,7 +204,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Scenario)' == 'WasmDebuggerTests'">
<HelixWorkItem Include="@(WasmDebuggerTests_PerJobList)">
<HelixWorkItem Include="@(WasmDebuggerTests_PerJobList -> '$(DebuggerHost)-%(Identity)')">
<PayloadArchive>$(_WasmDebuggerTestsPayloadArchive)</PayloadArchive>

<!-- FIXME: workaround for https://github.com/dotnet/runtime/issues/62660 -->
Expand Down Expand Up @@ -239,4 +245,11 @@

<Copy SourceFiles="@(_EmSdkFiles)" DestinationFolder="$(EmSdkDirForHelixPayload)\%(RecursiveDir)" />
</Target>

<Target Name="DownloadFirefoxToSendToHelix" Condition="!Exists($(FirefoxForHelixPayload)) and '$(DebuggerHost)' == 'firefox'">
<DownloadFile SourceUrl="$(FirefoxUrl)" DestinationFolder="$(TestArchiveRoot)" SkipUnchangedFiles="true">
<Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" />
</DownloadFile>
<Exec Command="tar -xf $(_DownloadedFile) -C $(TestArchiveRoot) &amp;&amp; rm $(_DownloadedFile) &amp;&amp; cd $(TestArchiveRoot) &amp;&amp; zip -q -r firefox.zip firefox"/>
</Target>
</Project>
14 changes: 12 additions & 2 deletions src/libraries/sendtohelix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@
HelixTargetQueues=$(HelixTargetQueues);
BuildTargetFramework=$(BuildTargetFramework)
</_PropertiesToPass>
<_DebuggerHosts Condition="'$(_DebuggerHosts)' == ''">chrome</_DebuggerHosts>
</PropertyGroup>

<Message Condition="'$(_Scenarios)' != ''" Importance="High" Text="Using _Scenarios: $(_Scenarios)" />
<Message Condition="'$(_DebuggerHosts)' != ''" Importance="High" Text="Using _DebuggerHosts: $(_DebuggerHosts)" />
<Message Importance="High" Text="Using Queues: $(HelixTargetQueues)" />
<Message Importance="High" Text="BuildTargetFramework: $(BuildTargetFramework)" />
<Message Importance="High" Text="TestArchiveTestsRoot: $(TestArchiveTestsRoot)" />
Expand All @@ -69,7 +71,7 @@
<_Scenarios Include="$(_Scenarios.Split(','))" />

<!-- MSBuild creates a new instance of the project for each %(_Scenarios.Identity) and can build them in parallel. -->
<_BaseProjectsToBuild Include="$(PerScenarioProjectFile)" Condition="'%(_Scenarios.Identity)' != 'buildwasmapps' and '%(_Scenarios.Identity)' != 'buildiosapps'">
<_BaseProjectsToBuild Include="$(PerScenarioProjectFile)" Condition="'%(_Scenarios.Identity)' != 'buildwasmapps' and '%(_Scenarios.Identity)' != 'buildiosapps' and '%(_Scenarios.Identity)' != 'wasmdebuggertests'">
<AdditionalProperties>$(_PropertiesToPass);Scenario=%(_Scenarios.Identity);TestArchiveRuntimeFile=$(TestArchiveRuntimeFile)</AdditionalProperties>
<AdditionalProperties Condition="'$(NeedsToBuildWasmAppsOnHelix)' != ''">%(_BaseProjectsToBuild.AdditionalProperties);NeedsToBuildWasmAppsOnHelix=$(NeedsToBuildWasmAppsOnHelix)</AdditionalProperties>
</_BaseProjectsToBuild>
Expand All @@ -85,6 +87,14 @@
</_BuildWasmAppsProjectsToBuild>
</ItemGroup>

<ItemGroup Condition="'@(_Scenarios -> AnyHaveMetadataValue('Identity', 'wasmdebuggertests'))' == 'true'">
<_DebuggerHostsItem Include="$(_DebuggerHosts.Split('/'))" />

<_WasmDebuggerTestsProjectsToBuild Include="$(PerScenarioProjectFile)">
<AdditionalProperties>$(_PropertiesToPass);Scenario=WasmDebuggerTests;TestArchiveRuntimeFile=$(TestArchiveRuntimeFile);DebuggerHost=%(_DebuggerHostsItem.Identity)</AdditionalProperties>
</_WasmDebuggerTestsProjectsToBuild>
</ItemGroup>

<!-- For BuildWasmApps we want to build the project twice, with: TestUsingWorkloads=true, and TestUsingWorkloads=false -->
<ItemGroup Condition="'@(_Scenarios -> AnyHaveMetadataValue('Identity', 'buildiosapps'))' == 'true'">
<_TestUsingWorkloadsValues Include="false" />
Expand All @@ -96,7 +106,7 @@
</ItemGroup>

<ItemGroup>
<_ProjectsToBuild Include="@(_BuildWasmAppsProjectsToBuild);@(_BuildiOSAppsProjectsToBuild);@(_BaseProjectsToBuild)" />
<_ProjectsToBuild Include="@(_BuildWasmAppsProjectsToBuild);@(_WasmDebuggerTestsProjectsToBuild);@(_BuildiOSAppsProjectsToBuild);@(_BaseProjectsToBuild)" />
</ItemGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -8997,16 +8997,16 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
start_frame = decode_int (p, &p, end);
length = decode_int (p, &p, end);

if (start_frame != 0 || length != -1)
if (start_frame != 0)
return ERR_NOT_IMPLEMENTED;
GET_TLS_DATA_FROM_THREAD (thread);
if (tls == NULL)
return ERR_UNLOADED;

compute_frame_info (thread, tls, TRUE); //the last parameter is TRUE to force that the frame info that will be send is synchronised with the debugged thread

buffer_add_int (buf, tls->frame_count);
for (i = 0; i < tls->frame_count; ++i) {
buffer_add_int (buf, length != -1 ? (length > tls->frame_count ? tls->frame_count : length) : tls->frame_count);
for (i = 0; i < tls->frame_count && (i < length || length == -1); ++i) {
buffer_add_int (buf, tls->frames [i]->id);
buffer_add_methodid (buf, tls->frames [i]->de.domain, tls->frames [i]->actual_method);
buffer_add_int (buf, tls->frames [i]->il_offset);
Expand Down
3 changes: 3 additions & 0 deletions src/mono/wasm/BrowsersForTesting.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<ChromiumDirName>chrome-linux</ChromiumDirName>
<ChromeDriverDirName>chromedriver_linux64</ChromeDriverDirName>
<ChromiumBinaryName>chrome</ChromiumBinaryName>
<FirefoxRevision>97.0.1</FirefoxRevision>
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(FirefoxRevision)/linux-x86_64/en-US/firefox-$(FirefoxRevision).tar.bz2</FirefoxUrl>
<FirefoxBinaryName>firefox</FirefoxBinaryName>
</PropertyGroup>

<PropertyGroup Condition="'$(BrowserHost)' == 'windows'">
Expand Down
1 change: 1 addition & 0 deletions src/mono/wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ submit-tests-helix:
$(MSBUILD_ARGS)

run-debugger-tests:
rm -f $(TOP)/artifacts/bin/DebuggerTestSuite/x64/Debug/*log; \
if [ ! -z "$(TEST_FILTER)" ]; then \
$(DOTNET) test $(TOP)/src/mono/wasm/debugger/DebuggerTestSuite $(MSBUILD_ARGS) --filter "Category!=failing&FullyQualifiedName~$(TEST_FILTER)" $(TEST_ARGS); \
else \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />

<ProjectReference Include="..\BrowserDebugProxy\BrowserDebugProxy.csproj" />
</ItemGroup>

Expand Down
24 changes: 24 additions & 0 deletions src/mono/wasm/debugger/BrowserDebugHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

#nullable enable

Expand All @@ -26,6 +28,28 @@ public static void Main(string[] args)
int proxyPort = 0;
if (config["proxy-port"] is not null && int.TryParse(config["proxy-port"], out int port))
proxyPort = port;
int firefoxDebugPort = 6000;
if (config["firefox-debug-port"] is not null && int.TryParse(config["firefox-debug-port"], out int ffport))
firefoxDebugPort = ffport;
string? logPath = config["log-path"];


using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddSimpleConsole(options =>
{
options.TimestampFormat = "[HH:mm:ss] ";
})
.AddFilter(null, LogLevel.Debug);

if (!string.IsNullOrEmpty(logPath))
builder.AddFile(Path.Combine(logPath, "proxy.log"),
minimumLevel: LogLevel.Trace,
outputTemplate: "{Timestamp:o} [{Level:u3}] {SourceContext}: {Message}{NewLine}{Exception}");
});

ILogger logger = loggerFactory.CreateLogger("FirefoxMonoProxy");
_ = FirefoxDebuggerProxy.Run(browserPort: firefoxDebugPort, proxyPort: proxyPort, loggerFactory, logger);

IWebHost host = new WebHostBuilder()
.UseSetting("UseIISIntegration", false.ToString())
Expand Down
7 changes: 5 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand Down Expand Up @@ -124,7 +125,6 @@ async Task Copy(HttpContext context)
context.Response.ContentLength = response.Content.Headers.ContentLength;
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
await context.Response.Body.WriteAsync(bytes);

}
}

Expand Down Expand Up @@ -161,6 +161,8 @@ async Task ConnectProxy(HttpContext context)
{
runtimeId = parsedId;
}

CancellationTokenSource cts = new();
try
{
using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
Expand All @@ -177,11 +179,12 @@ async Task ConnectProxy(HttpContext context)

System.Net.WebSockets.WebSocket ideSocket = await context.WebSockets.AcceptWebSocketAsync();

await proxy.Run(endpoint, ideSocket);
await proxy.Run(endpoint, ideSocket, cts);
}
catch (Exception e)
{
Console.WriteLine("got exception {0}", e);
cts.Cancel();
}
}
});
Expand Down
Loading