1. 01 7月, 2022 2 次提交
  2. 09 6月, 2022 1 次提交
  3. 08 6月, 2022 1 次提交
    • I
      [wasm][debugger] Implement support for null-conditional operators in simple expressions (#69307) · 2c110b62
      Ilona Tomkowicz 提交于
      * Basic testcase.
      
      * Fixed non-null access to proxy-hidden members.
      
      * Fixing the issue and adding more tests.
      
      * Fixed a failing test: let CompileAndRunTheExpression throw.
      
      * Blocked failing tests on firefox.
      
      * Applied @radical's suggestions.
      
      * Reverted indexing to fix tests.
      
      * Reverted LastOrDefault instead of indexing + corrected names.
      
      * Changed to throw when root name empty.
      
      * Removing null suppression that does not change the evaluation result but fails without this change.
      
      * Applied @radical's comments.
      
      * Change exception on string property evaluation.
      
      * Added @radical's suggestions.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      2c110b62
  4. 07 6月, 2022 1 次提交
    • T
      [wasm][debugger] Support new hot reload features (#70097) · da573d14
      Thays Grazia 提交于
      * Implementing support new method on enc
      
      * HotReload - Support new static method
      
      * - Fix adding a new static field in an class not initialized
      - Returning the number of the fields in the class including the ones added by hotreload.
      
      * Fix GetStringAfterEnc.
      Add a test with 2 enc adding classes in both of them.
      Adding in the dump changes typedef added.
      
      * Fix space between function and (
      
      * Removing try catch.
      
      * Fix compilation
      
      * Remove unnecessary if.
      
      * Adressing @lambdageek comments and adding a test for it.
      
      * Addressing @radical comments.
      
      * Renaming method.
      
      * Counting row indices per-kind.
      
      * Addressing @radical comments.
      
      * Apply suggestions from code review
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Addressing @radical comments.
      
      * Fix methodDebugInformation.Document.IsNil.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      da573d14
  5. 06 6月, 2022 1 次提交
  6. 27 5月, 2022 1 次提交
    • I
      Display parents' members on GetProperties. (#68907) · 84513a2a
      Ilona Tomkowicz 提交于
      * Prepared tests with the same members as in Console App.
      
      * Adding parents' members to match the expected result in tests.
      
      * Increasing the timeout because some EvaluateOnCallFrameTests tests take up to 63 sec.
      
      * Reverting timeout editions.
      
      * Applied refactoring suggestions from @radical and @thaystg.
      
      * Added new text cases with addnotation which fields are displayed incorrectly and should be fixed.
      
      * More detailed error message for count mismatch.
      
      * Reorganising tests with order: grouping similar members.
      
      * Fixing override/new problem.
      
      * Fixing test to reflect ConsoleApp behavior.
      
      * Wrong name - it should be tested with the new class: 2.
      
      * Applied @radical's suggestion about backingField.
      
      * @radical's changes - refactor + one new test case.
      
      * Checking Getter vals; AssertEqual(cnt) not needed.
      
      * New test cases, some to be fixed in the follow-up issue.
      
      * Added @radical's suggestions.
      
      * Different DataTimes for each property.
      84513a2a
  7. 26 5月, 2022 2 次提交
    • I
      Add EvaluationResult Scheme for arrays. (#67095) · 4e9ac49e
      Ilona Tomkowicz 提交于
      * Test expanding the properties of a result returned by a method evaluated on a primitive type.
      
      * Enable caching evaluationResult in scopeCache.
      
      * Cache arrays that are returned as a method evaluation result.
      
      * Enable getting evaluationResults from cache on request.
      
      * Fixed Firefox test.
      4e9ac49e
    • A
      [wasm] First attempt at a wasm app host (#68696) · 6b3ea401
      Ankit Jain 提交于
      First attempt at implementing a wasm app host
      
      Regular dotnet apps can be run with `dotnet run`. But this is not the case for
      wasm apps. We use `xharness` to run the test apps that we generate for library
      tests.
      
      Templates for browser, and console wasm projects were added recently, but they
      have to be run manually by either invoking a v8 script, or running a
      `http-server` in the bundle directory. Though to use a debugger with this
      requires starting the debug proxy separately, and connecting few bits.
      
      # WasmAppHost
      
      This PR adds a new `WasmAppHost`, which can be used through `dotnet run`:
      
      - it can run "wasm app" from it's `AppBundle` directory, using various hosts
        like `v8`, `node`, or a browser. An example use:
      
          ```
          $ dotnet new wasmconsole
          $ dotnet run
          WasmAppHost --runtime-config /tmp/c0/bin/Debug/net7.0/browser-wasm/AppBundle//c0.runtimeconfig.json
          [02:26:40] info: host[0] Running: node main.cjs
          [02:26:40] dbug: host[0] Using working directory: /tmp/c0/bin/Debug/net7.0/browser-wasm/AppBundle
          Incoming arguments:
          Application arguments:
          Debugger.Debug: DEBUGGING ENABLED
      
          mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
          Could not find symbols file dotnet.js.symbols. Ignoring.
          Initializing.....
          Hello, Console!
          ```
      
          The console template project is run with `node` by default.
      
      - it supports a `--debug` parameter, which (for the browser case) would startup
        a webserver, and the debug proxy for Chrome, and firefox.
      
      ```
      $ dotnet new wasmbrowser
      
      $ dotnet run --debug
      WasmAppHost --runtime-config /workspaces/test/br0/bin/Debug/net7.0/browser-wasm/AppBundle//br0.runtimeconfig.json --debug --forward-console
      Debug proxy for chrome now listening on http://127.0.0.1:9300/. And expecting chrome at http://localhost:9222/
      Hosting environment: Production
      Content root path: /workspaces/test/br0/bin/Debug/net7.0/browser-wasm/AppBundle
      Now listening on: http://127.0.0.1:9300
      Debug proxy for firefox now listening on tcp://127.0.0.1:6300. And expecting firefox at port 6000 .
      
      App url: http://127.0.0.1:9000/index.html
      App url: https://127.0.0.1:38331/index.html
      ```
      
      - This enables using `dotnet run` with wasm samples, and library tests too.
      
      ## How do I try this out?
      
      You'll need a dotnet with the updated packs. For now, you can use:
      
      ```
      $ ./dotnet.sh build -p:TargetOS=Browser -p:TargetArchitecture=wasm -p:Configuration=Release src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj /t:InstallWorkloadUsingArtifacts
      ```
      
      .. which would install a sdk in `artifacts/bin/dotnet-workload` with all the packs installed.
      
      - Use that dotnet to create console, or browser wasm apps from templates, for example `dotnet new wasmconsole`, or `dotnet new wasmbrowser`.
      
      ### Debugging library tests
      
      ```
      runtime$ ./artifacts/bin/dotnet-workload/dotnet run -f net7.0 -r browser-wasm -c $YourRuntimeConfig --project src/libraries/System.Buffers/tests/System.Buffers.Tests.csproj -p:DebuggerSupport=true --debug --host browser
      ```
      
      - If the runtime was built in `Release` config, then you need to add `-p:DebuggerSupport=true`, so the pdbs would get deployed
      - And use `--debug` to start the debugger
      
      - Opening the url will show a `Run tests` button, which you can click after connecting with the IDE, to start running the tests
      
      ## Notes, and TODO
      
      - `WasmAppHost`, along with the debug proxy are bundled in the `WebAssembly.Sdk` pack right now.
        - This might be changed in the future to use the dotnet app host pack pattern, and with
          additional support adding in the Sdk.
        - This would also allow using `launchSettings.json`, similar to blazor
      
      - `WasmAppHost` depends on host config in `runtimeconfig.json`, which can be
        controlled by a `runtimeconfig.template.json` in the project directory.
      
      - Needs more tests, cleanup, `--help` for command line arguments
      - `app-support.*js` in templates, and `test-main.js` need more work to share the code
      
      Fixes https://github.com/dotnet/runtime/issues/67236
      6b3ea401
  8. 20 5月, 2022 1 次提交
  9. 18 5月, 2022 2 次提交
  10. 16 5月, 2022 1 次提交
  11. 13 5月, 2022 2 次提交
    • I
      Methods on primitives 65707 (#66654) · d395c6b3
      Ilona Tomkowicz 提交于
      * Prepared tests for calling method on primitive types.
      
      * Added support for most methods on primitives.
      
      * Corrected other tests - TBool is supported.
      
      * Corrected test to match current exception texts.
      
      * Fixed evaluation with enums.
      
      * Fixed another error message to match.
      
      * Fixed firefox test on EvaluateMethodsOnPrimitiveTypesReturningPrimitives.
      
      * Revert moving ContinueWith() out of the try block.
      
      * Removed comment that is not longer true after 2fef3c218b5bca5494797e1134da64e62d433418.
      
      * Applied radical's suggestions.
      d395c6b3
    • A
      [wasm] Misc debugger improvements (#68988) · c26475cd
      Ankit Jain 提交于
      * [wasm] Move the browser provisioning stuff to a new targets file
      
      .. from `DebuggerTestSuite.csproj`. This will allow other projects to
      use this too.
      
      * [wasm][debugger] Handle failure to connect to the browser
      
      * [wasm] Improve the browser path lookup
      
      so it can be used outside the debugger tests project too. For example,
      with Wasm.Build.Tests+playwright .
      
      * [wasm][debugger] Throw exceptions from tasks correctly
      
      .. using `ExceptionDispatchInfo.Capture` so we get the original stack
      trace.
      
      * [wasm][debugger] General improvements in debug proxy
      
      - like logging
      - updated API to make it easier to use by other projects, like the
        upcoming wasm-app-host .
      
      * [wasm][debugger] 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`.
      
      Implemented by @thaystg .
      
      * [wasm][debugger] Add support for wait_for_debugger
      
      If requested, then it will cause invocation of `main` to be delayed till
      a debugger is attached.
      
      Implemented by @thaystg
      
      * [wasm] Cleanup in Wasm.Build.Tests
      
      .. in the lead up to wasm-app-host tests.
      
      * [wasm] Update the default paths used to trigger builds on CI
      
      .. to include templates, and provisioning props.
      
      * disable non-wasm builds
      
      * [wasm][debugger] Fix path to artifacts dir
      
      * [wasm] Emit message with bundle path
      
      * [wasm][templates] Make the project use the target dir's name as the
      
      .. project name, instead of always creating `browser.dll`, and
      `console.dll`.
      
      * [wasm][debugger] Use a single static instance of HttpClient
      
      .. as recommended by the documentation.
      
      * Revert "disable non-wasm builds"
      
      This reverts commit 7b8b60d58c886e7e66cf2fea910f1feb4d6374f1.
      
      * Address review feedback, and improve the autogenerated bpid
      c26475cd
  12. 10 5月, 2022 1 次提交
    • A
      [wasm][debugger][tests] Fix crash in `EvaluateOnCallFrameTests` on CI (#69073) · f7306578
      Ankit Jain 提交于
      * Clean up debug messages
      
      * [wasm][debugger][tests] Allow MonoProxy instances to get gc'ed
      
      In `TestHarnessProxy`, we recently started adding proxy instances to a
      static table, to enable getting the correct exit state from the client.
      But the instances were not removed from the table, which prevented the
      GC from collecting them.
      
      This manifests as the test process crashing on systems with 8GB of
      memory, when running `EvaluateOnCallFrameTests`. It would end up getting
      to a resident size of 2.2-2.7G, and then crash after about 30 tests. With these changes, the
      proxy gets collected, and the resident memory hovers around 500M.
      
      Future work: this will change once we start using the upcoming app host
      work, and thus moving the proxy to a separate process via `dotnet run
      --debug`.
      f7306578
  13. 05 5月, 2022 1 次提交
    • I
      [wasm][debugger] Refactor of getProperties mechanism (#68486) · 418fb2d1
      Ilona Tomkowicz 提交于
      * Merge main with @radical's refactoring.
      
      * Fixed most tests.
      
      * Added more Browsable tests: null + valuetype.
      
      * Fixed trailing spaces and exposed the test.
      
      * Fixed all GetPropertiesTests.
      
      * Fixing RunOnCFOValueTypeResult.
      
      * Fixed cloning to be deep.
      
      * Reverted comments in test.
      
      * Fixed browsable root hidden tests.
      
      * Extended Browsable tests with a structure.
      
      * Fixed TestSetValueOnObject.
      
      * Add class testcase to browsable root hidden.
      
      * All existing tests are passing.
      
      * Cleanup, removing unused code.
      
      * Added Browsable tests for nonstatic structures.
      
      * Removed unnecessary comment.
      
      * Removed whitespaces.
      
      * Blocked tests failing/timeouting on Firefox.
      418fb2d1
  14. 28 4月, 2022 2 次提交
  15. 27 4月, 2022 2 次提交
    • T
      [wasm][debugger] Rebind invalid breakpoints after receiving an update in that source file (#64462) · a4dcffc2
      Thays Grazia 提交于
      * Addressing what was discussed with @lewing offline.
      
      * Addressing comments from code review and fixing merge.
      
      * Fix merge
      
      * Fixing merge
      
      * Fix merge
      a4dcffc2
    • T
      [wasm][debugger] Debug on firefox (#61776) · a970720f
      Thays Grazia 提交于
      * First compiling and working version just proxying messages.
      
      * almost working, already showing the cs files
      
      * Working on firefox.
      
      * Use internal e not public.
      
      * Debugging on firefox working.
      
      * Working after the merge
      
      * Keep the TcpListener open and use a random port.
      
      * Show null value.
      
      * - Show JS Callstack
      - Skip properties
      - Get array value from evaluateAsyncJS and not use the preview value.
      
      * Fix compilation
      
      * Infrastructure to run debugger tests.
      
      * fix merge
      
      * run test.
      
      * Skipping tests that are not passing on Firefox.
      
      * Skipping tests that are not passing on Firefox.
      
      * Passing 13 steppingtests.
      
      * Passing 13 steppingtests.
      
      * Passing 13 steppingtests.
      
      * Failed:     0, Passed:    39, Skipped:   203, Total:   242, Duration: 5 m 6 s - DebuggerTestSuite.dll (net6.0)
      
      * Failed:     0, Passed:    66, Skipped:   195, Total:   261, Duration: 9 m 29 s - DebuggerTestSuite.dll (net6.0)
      
      * Using ConditionalTheory and ConditionalFact implemented by @radical.
      
      * Fixing side effect.
      
      * Implemented conditional breakpoints.
      Failed:     0, Passed:    74, Skipped:   189, Total:   263, Duration: 8 m 41 s - DebuggerTestSuite.dll (net6.0)
      
      * Fix special characters and pointers.
      
      Failed:     0, Passed:   116, Skipped:   177, Total:   293
      
      * Fix merge
      
      * Run debugger-tests on firefox using codespace
      
      * Starting firefox correctly not stopping in the breakpoint yet.
      
      * Remove unnecessary change
      
      * Fix pause behavior (now showing correctly, pause on breakpoint, pause while stepping)
      Start implementing evaluate expressions, working correctly on VSCode.
      
      * Fix local tests.
      
      * Fix missing )
      
      * Passing 190 tests, evaluate expressions working.
      
      * Remove Task.Delays.
      Move some attributes from FirefoxMonoProxy to FirefoxExecutionContext.
      
      * Fix container creation
      
      * Trying to run firefox tests on CI.
      
      * Moving file to the right place.
      
      * Trying to run debugger-tests using firefox on CI.
      
      * fixing path
      
      * Missing url to download firefox on helix.
      
      * On run the tests only on linux.
      
      * Trying to download firefox on helix.
      
      * fix error on helix-wasm.targets.
      
      * trying to fix ci
      
      * trying to install firefox on helix.
      
      * Fixing firefox path
      
      * Fix debugger tests on firefox
      
      * fixing profile path
      
      * Install libdbus-glib-1-2 on docker and on codespace
      
      * Trying to run using firefox on CI
      
      * update docker image
      
      * Adding more messages to see errors on CI
      
      * Trying to make it work on CI
      
      * Real test on CI
      
      * Trying to use the firefox machine only to run firefox tests
      Retrying connection to Proxy
      Remove extra messages added to help to fix CI
      
      * Fix CI
      
      * Fix CI
      
      * Fix CI.
      
      * Remove unnecessary changes.
      
      * Using machine with sudo installed
      
      * Addressing @lewing comments
      
      * Fix run tests on codespace
      Using image with python3
      
      * Use default image to build and new image only to run firefox tests
      
      * Fix unrelated change
      
      * Fix ci
      
      * check python version
      
      * Print python versions
      
      * Using image with PIP installed
      
      * Using image with pip updated
      
      * Remove unrelated changes
      Increase time to wait for firefox to be ready
      
      * Trying to fix evaluate tests.
      
      * Fix evaluateoncallframe tests
      
      * Trying to fix evaluation tests.
      
      * trying to fix evaluateoncallframetests
      
      * fiz evaluateoncallframetests
      
      * Trying to kill firefox to avoid errors.
      
      * Trying to fix EvaluateOnCallFrameTests
      
      * Fix CI
      
      * Remove failing test
      
      * Fix misctests
      
      * Fix other build errors.
      
      * Trying to fix CI.
      
      * Fix CI
      
      * Remove unecessary message.
      
      * Update src/tests/BuildWasmApps/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Addressing @radical comments
      
      * Merge error while accept @radical suggestion
      
      * Merge error while accept @radical suggestion
      
      * Update src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Apply suggestions from code review
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Addressing @radical comments
      
      * Abort the tcp connection if the proxy throws an exception
      
      * Refactor a bit
      
      * Use more compile time checks for chrome vs firefox
      
      * fix pipeline
      
      * Make debugger job names unique by including the browser
      
      * fix runtime-wasm pipeline
      
      * fix firefox ci job
      
      * split into more files
      
      * cleanup
      
      * Add support for running chrome, and firefox tests in the same job
      
      * fix yml
      
      * fix build
      
      * fix build
      
      * fix windows build
      
      * Don't delete profile folder nor pkill firefox
      
      * Delete and create a new profile folder for each execution
      
      * fix helix command line
      
      * [wasm][debugger] Fix tests broken on 'main'
      
      This test broke because it was checking for the number of members on
      `System.TimeSpan`, and that changed with
      https://github.com/dotnet/runtime/pull/67666 , which added new members
      like `TotalNanoseconds`.
      
      The test shouldn't depend on this number anyway, so remove that.
      
      ```
        Failed DebuggerTests.MiscTests.InspectLocalsForToStringDescriptions(line: 137, col: 12, method_name: "MethodWithLocalsForToStringTest", call_other: False, invoke_async: False) [758 ms]
        Error Message:
         [ts_props] Number of fields don't match, Expected: 12, Actual: 16
      Expected: True
      Actual:   False
        Stack Trace:
           at DebuggerTests.DebuggerTestBase.CheckProps(JToken actual, Object exp_o, String label, Int32 num_fields) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 800
         at DebuggerTests.DebuggerTestBase.CompareObjectPropertiesFor(JToken locals, String name, Object o, String label, Int32 num_fields) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 908
         at DebuggerTests.MiscTests.InspectLocalsForToStringDescriptions(Int32 line, Int32 col, String method_name, Boolean call_other, Boolean invoke_async) in /_/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs:line 559
      ```
      
      * wip
      
      * big refactor
      
      * chrome runs
      
      * ff runs
      
      * ff runs
      
      * cleanup
      
      * cleanup
      
      * cleanup
      
      * change console verbosity to info, for proxy
      
      * More refactoring
      
      * More refactoring, and fix some issues with connections, and other
      cleanup
      
      * some cleanup
      
      * fix file name
      
      * Improve cleanup after tests
      
      * some refactoring, fixing some hangs, faster failures etc
      
      * Fix BrowserCrash test for chrome
      
      * fix up logging
      
      * Improve error handling for the proxy running independently
      
      * fix debugging from vscode
      
      * proxy host: add --log-path for logs
      
      * support canceling for the proxy host too, and distinguish different instances of the proxy
      
      * Fix debugger after refreshing the debugged page.
      
      * Fixing chrome debugging.
      
      * Fix startup to work on chrome and also on firefox.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      a970720f
  16. 23 4月, 2022 1 次提交
    • A
      [wasm][debugger] Fix a randomly failing JS test (#67945) · 857f54b1
      Ankit Jain 提交于
      * [wasm][debugger] Fix a randomly failing JS test
      
      `DebuggerTests.ExceptionTests.JSExceptionTestAll` can some times fail
      with:
      
      ```
      [xUnit.net 00:01:08.51]     DebuggerTests.ExceptionTests.JSExceptionTestAll [FAIL]
        Failed DebuggerTests.ExceptionTests.JSExceptionTestAll [105 ms]
        Error Message:
         [{
        "callFrameId": "-2618252572970282349.1.0",
        "functionName": "lookup",
      
      ...
      
      Expected: exception_caught_test
      Actual:   lookup
        Stack Trace:
           at DebuggerTests.DebuggerTestBase.AssertEqual(Object expected, Object actual, String label) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 1119
         at DebuggerTests.DebuggerTestBase.SendCommandAndCheck(JObject args, String method, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn, String waitForEvent) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 562
         at DebuggerTests.DebuggerTestBase.EvaluateAndCheck(String expression, String script_loc, Int32 line, Int32 column, String function_name, Func`2 wait_for_event_fn, Func`2 locals_fn) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 542
         at DebuggerTests.ExceptionTests.JSExceptionTestAll() in /_/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs:line 70
      ```
      
      This test is set to pause on every exception thrown, but the test
      assumes that the first exception that it gets will be the expected one.
      But we can get other JS exceptions before that. So, wait for the correct
      one, while ignoring any *js* ones.
      
      * cleanup
      857f54b1
  17. 15 4月, 2022 1 次提交
    • A
      [wasm][debugger] Fix tests broken on 'main' (#68054) · 895715e9
      Ankit Jain 提交于
      This test broke because it was checking for the number of members on
      `System.TimeSpan`, and that changed with
      https://github.com/dotnet/runtime/pull/67666 , which added new members
      like `TotalNanoseconds`.
      
      The test shouldn't depend on this number anyway, so remove that.
      
      ```
        Failed DebuggerTests.MiscTests.InspectLocalsForToStringDescriptions(line: 137, col: 12, method_name: "MethodWithLocalsForToStringTest", call_other: False, invoke_async: False) [758 ms]
        Error Message:
         [ts_props] Number of fields don't match, Expected: 12, Actual: 16
      Expected: True
      Actual:   False
        Stack Trace:
           at DebuggerTests.DebuggerTestBase.CheckProps(JToken actual, Object exp_o, String label, Int32 num_fields) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 800
         at DebuggerTests.DebuggerTestBase.CompareObjectPropertiesFor(JToken locals, String name, Object o, String label, Int32 num_fields) in /_/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs:line 908
         at DebuggerTests.MiscTests.InspectLocalsForToStringDescriptions(Int32 line, Int32 col, String method_name, Boolean call_other, Boolean invoke_async) in /_/src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs:line 559
      ```
      895715e9
  18. 13 4月, 2022 1 次提交
  19. 05 4月, 2022 1 次提交
    • A
      [wasm][debugger] Some test fixes (#67373) · 4f602117
      Ankit Jain 提交于
      * [wasm] Bump timeout for debugger tests to 30mins, to accomodate EvaluateOnCallFrameTests
      
      * [wasm][debugger] statically init App.static_method_table
      
      `debugger-driver.html` has a `App.init` function (called from `onDotnetReady`)
      that init's `App.static_method_table`. But this function can
      race with a test, which might call `invoke_static_method`, and that
      would fail because `App.static_method_table` is not defined yet.
      
      * Improve logging slightly to help debug random failures
      
      * Update line numbers in tests
      4f602117
  20. 30 3月, 2022 1 次提交
    • I
      [wasm][debugger] Debuger tests refactor 63667 (#63730) · cbf3f9c4
      Ilona Tomkowicz 提交于
      * Removed a dedicated StructGetter class.
      
      * Used DerivedClass in protection level tests + fixed InvokeMethod + reverted StructureGetters removal.
      
      * Exchange ElementType in DotnetObjectId for bool.
      
      * Applied @radical's suggestion to log whole call stack instead of message.
      
      * Applied @lewing's suggestions.
      
      * Merge errors fixed.
      cbf3f9c4
  21. 29 3月, 2022 1 次提交
    • A
      [wasm] Improved error handling in debug proxy (#65828) · 83e2529d
      Ankit Jain 提交于
      * [wasm] Mark result as Error if it has 'exceptionDetails' field
      
      * [wasm] Don't swallow errors from methods that enumerate properties
      
      .. like for getting locals. Instead, surface the original errors which
      have details of the actual failure, to the point before we send a
      response.
      
      This helps debugging a lot, so instead of `Unable to evaluate dotnet:scope:1`,
      we get more detailed errors.
      
      * [wasm] Throw an exception when a debugger agent command fails
      
      We are checking `HasError` property on the binary reader in very few
      places. Other places just try to use the reader which then fails with
      errors in reading, or base64 conversion etc, and we don't get any info
      about what command failed.
      
      Instead, throw an exception on error by default. But the existing
      locations that do check `HasError`, don't throw for them.
      
      * [wasm] Fix evaluating expression calling a non-existant method
      
      Issue: https://github.com/dotnet/runtime/issues/65744
      
      The test doesn't fail because it is expecting an error, and it gets
      that.
      
      But the log shows an assertion:
      
      `console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class-accessors.c:71, condition `<disabled>' not met`
      
      1. This is because the debugger-agent does not check that the `klass`
      argument is NULL, which is fixed by adding that check.
      
      2. But the reason why this got called with `klass==NULL`, is because
      `MemberReferenceResolver.Resolve` tries first to find the non-existant
      method on the type itself. Then it tries to find the method on
      `System.Linq.Enumerable`, but fails to find a typeid for that.
        - but continues to send a command to get the methods on that
        `linqTypeId==0`.
      
      * [wasm] Add some missing exception logging in the proxy
      
      * cleaup
      
      * [wasm] GetMethodIdByName: throw on invalid type ids
      
      * [wasm] Improve error handling in expression evaluation
      
      * Cleanup
      
      * Disable failing test - https://github.com/dotnet/runtime/issues/65881
      
      * Add missed files
      
      * Address @ilonatommy's feedback
      83e2529d
  22. 18 3月, 2022 1 次提交
  23. 02 3月, 2022 1 次提交
    • I
      [wasm][debugger] Support "on frame evaluation" of functions returning char (#65842) · b11689b6
      Ilona Tomkowicz 提交于
      * Optional parameter fix.
      
      * Working version of optional parameter support, requires refactoring.
      
      * Refactored.
      
      * Fixed failing tests.
      
      * Add support to functions returning char, add test to an existing case.
      
      * Simplified tests.
      
      * Merged with optional params, uncommented char test
      
      * Remove spaces.
      
      * Applied @radical's suggestions.
      
      * Removed indentation.
      
      * Another indentation.
      
      * Removed comment.
      
      * Reverted type=char, as @radical suggested.
      
      * Applied @radical's suggestions. No need for escaping + reverting original name.
      b11689b6
  24. 25 2月, 2022 1 次提交
    • I
      [wasm][debugger] Run debugger test in codespace (#64746) · ef785f5d
      Ilona Tomkowicz 提交于
      * Tmp change for debugging.
      
      * Added chromium, needed for running debugger tests.
      
      * Corrected line breaking, removed suso.
      
      * Removed update duplicate.
      
      * Prevent regex on null.
      
      * Set special env variable only for containers.
      
      * Locally docker build crashes without it.
      
      * Applied @eerhardt suggestion.
      
      * Moved env assignment to a place that is executed by onCreateCommand.sh
      
      * Revert accidential new line removal.
      
      * Upgrade is unnecessary, works without it.
      
      * Moved all logic to C# code.
      
      * Remove duplicated line.
      
      * Applied @thays's and @lewing's comments.
      
      * Enabling @radical approach for chromium installation.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      ef785f5d
  25. 24 2月, 2022 3 次提交
    • I
      [wasm][debugger] Optional param fix 56251 (#64970) · b710dc21
      Ilona Tomkowicz 提交于
      * Optional parameter fix.
      
      * Working version of optional parameter support, requires refactoring.
      
      * Refactored.
      
      * Fixed failing tests.
      
      * Simplified tests.
      
      * @radical's parenthesis refactor.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Add nullable tests, rename mixed params function.
      
      * Applied @radical suggestions + fixed tests failing because of double separator.
      
      * Capitalised params first letter, removed explicit getters.
      
      * Applied @radical's and @lewing's comments where it was possible.
      
      * Applied @radical's suggestions.
      
      * Handle Linq with ParamsCnt = methodParamsCnt. OptionalParamsCnt not used anymore.
      
      * Fix: previos commit worked only in tests, not in browser.
      
      * Applied @radical's approach.
      
      * Fixed ParamsInfo so that it will be loaded on demand only.
      
      * Update src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      b710dc21
    • A
      [wasm] Misc Debugger improvements (including tests) (#65752) · 67d8b96d
      Ankit Jain 提交于
      * [wasm][debugger] Fail test if an assertion is detected
      
      * [wasm][debugger] Make DevToolsProxy's `pending_ops` thread-safe
      
      Currently, `pending_ops` can get written by different threads at the
      same time, and also read in parallel. This causes tests to randomly fail
      with:
      
      ```
      DevToolsProxy::Run: Exception System.ArgumentException: The tasks argument included a null value. (Parameter 'tasks')
          at System.Threading.Tasks.Task.WhenAny(Task[] tasks)
          at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket) in /_/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs:line 269
      ```
      
      Instead, we use `Channel<T>` to add the ops, and then read those in
      the main loop, and add to the *local* `pending_ops` list.
      
      * [wasm] Install chrome for debugger tests
      
      - controlled by `$(InstallChromeForDebuggerTests)` which defaults to
      `true` for non-CI docker containers
      - Useful for using the correct chrome version when testing locally, or
      on codespaces
      
      - Also, add support for detecting, and defaulting to such an
      installation
      
      * [wasm][debugger] Disable tests failing with runtime assertions
      
      `DebuggerTests.EvaluateOnCallFrameTests.EvaluateSimpleMethodCallsError`: https://github.com/dotnet/runtime/issues/65744
      `DebuggerTests.ArrayTests.InvalidArrayId`: https://github.com/dotnet/runtime/issues/65742
      
      * [wasm][debugger] Fix NRE with `"null"` condition for a breakpoint
      
      `ConditionalBreakpoint` test fails.
      The test with condition=`"null"` failed with a NRE, instead of correctly
      handling it as a condition that returns null.
      
      ```
      Unable evaluate conditional breakpoint: System.Exception: Internal Error: Unable to run (null ),
          error: Object reference not set to an instance of an object..
          ---> System.NullReferenceException: Object reference not set to an instance of an object.
                  at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 399
                  --- End of inner exception stack trace ---
                  at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 407
                  at Microsoft.WebAssembly.Diagnostics.MonoProxy.EvaluateCondition(SessionId sessionId, ExecutionContext context, Frame mono_frame, Breakpoint bp, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 801 condition:null
      ```
      
      * [wasm] Improve default message for ReturnAsErrorException,
      
      .. since we seem to be not catching them as intended in many places.
      
      * [wasm] Better log, and surface errors in evaluation conditional
      
      .. breakpoints.
      Catch the proper exception `ReturnAsErrorException`, so we can get the
      actual error message. And log that as an error for the user too.
      
      * [wasm][debugger] Allow setting proxy port for BrowserDebugHost
      
      .. with `--proxy-port=<port>`.
      
      Fixes https://github.com/dotnet/runtime/issues/65209 .
      
      * [wasm][debugger] Handle errors in getting value for locals
      
      Essentially, catch, and skip.
      
      * message cleanup
      
      * remove trailing space
      67d8b96d
    • A
      [wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy messages (#63564) · cf14a837
      Ankit Jain 提交于
      * [wasm][debugger] Add test ids, and log test output, and proxy messages
      
      .. to files.
      
      * log level cleanup
      
      * [wasm][debugger] Allow setting proxy port for BrowserDebugHost
      
      .. with `--proxy-port=<port>`.
      
      Fixes https://github.com/dotnet/runtime/issues/65209 .
      cf14a837
  26. 23 2月, 2022 1 次提交
  27. 17 2月, 2022 1 次提交
  28. 10 2月, 2022 1 次提交
    • I
      [wasm][debugger] Fixed debugger attachment to a project with special... · b536fefd
      Ilona Tomkowicz 提交于
      [wasm][debugger] Fixed debugger attachment to a project with special characters in the path. (#64527)
      
      * Fixed special path.
      
      * Prevent tests from failing.
      
      * Fix for related but not loaded assemblies with special characters.
      
      * Refactor - changing slash direction is not necessary.
      
      * Undo unnecessary refactoring.
      
      * Added test for setting breakpoint in a source with path with special characters.
      
      * dummy commit
      
      * Adressed @radical's suggestions.
      
      * Add more logged info for failing tests.
      
      * Direct string comparison is not a good idea - locally they are coded and on CI they are not.
      
      * avoid calling pdb2pdb.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      Co-authored-by: NDESKTOP-GEPIA6N\Thays <thaystg@gmail.com>
      b536fefd
  29. 04 2月, 2022 1 次提交
    • A
      [wasm][debugger] Fix some racy tests (#64712) · 1af7e5d8
      Ankit Jain 提交于
      * re-enable some tests
      
      * [wasm][debugger] Fix racy test - ExceptionTestAllWithReload
      
      This test is set up to pause on all exceptions. So, it has some code to
      hit `Debugger.resume` 100 times, hoping to skip all the non-user code
      exceptions. But this can sometimes not be enough, and you might have
      more exceptions which breaks rest of the test.
      
      Instead, we try to resume till we won't get paused for a period of
      10secs. And after that, we can call the user code, and execute rest of
      the test.
      
      Fixes https://github.com/dotnet/runtime/issues/62666 .
      
      * [wasm][debugger] Fix racy tests that use late loaded assemblies
      
      `DebuggerTests.MiscTests.DebugLazyLoadedAssemblyWithEmbeddedPdb`
      `DebuggerTests.BreakpointTests.BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded`
      
      These tests load assemblies dynamically, and depend on breakpoints in
      those assemblies being resolved. But the tests don't wait for that to
      happen. So, they can some times fail when the managed method is invoked
      before the breakpoint being resolved.
      
      Fixes https://github.com/dotnet/runtime/issues/62823
      Fixes https://github.com/dotnet/runtime/issues/62667
      1af7e5d8
  30. 03 2月, 2022 3 次提交
    • A
      [wasm][debugger] Fix racy page reload test (#64695) · d21e8639
      Ankit Jain 提交于
      * [wasm][debugger] Fix racy page reload test
      
      `BreakpointTests.CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAndHitAgain`
      
      1. the test loads the regular app page
      2. then it reloads the page by calling `load_wasm_page_without_assets()`
         a. then waits for 1 sec
      3. then it reloads again by calling `reload_wasm_page()`
         a. then `insp.WaitFor(Inspector.READY)`
      
      the READY notification after the second reload is never read. Instead,
      it tries to wait for the notification after the third reload, but that
      immediately returns because of the second one, instead of waiting for a
      new one.
      
      Fix is to correctly wait for a READY after the second reload.
      
      Another way to do this might be to clear the notifications when a new
      page gets loaded (`executionContextCreated`?), but that would be a bit
      magical, and isn't needed by any test right now.
      
      Fixes https://github.com/dotnet/runtime/issues/64585
      
      * [wasm][debugger] Fix racy test - ExceptionTestAllWithReload
      
      This test is set up to pause on all exceptions. So, it has some code to
      hit `Debugger.resume` 100 times, hoping to skip all the non-user code
      exceptions. But this can sometimes not be enough, and you might have
      more exceptions which breaks rest of the test.
      
      Instead, we try to resume till we won't get paused for a period of
      10secs. And after that, we can call the user code, and execute rest of
      the test.
      
      Fixes https://github.com/dotnet/runtime/issues/62666 .
      
      * Revert "[wasm][debugger] Fix racy test - ExceptionTestAllWithReload"
      
      This reverts commit 10d40720dec3410bc9944d159d374223a53f7d67.
      d21e8639
    • A
      [wasm][debugger] Fix some flaky tests (#64652) · 3a77a6d9
      Ankit Jain 提交于
      3a77a6d9
    • T
      [wasm][debugger] Implement support to Set Next Instruction Pointer. (#64114) · e696cbae
      Thays Grazia 提交于
      * Implement Set Next Instruction Pointer.
      
      * Addressing @radical comments.
      
      * Checking if the line number is inside the same function.
      Adding test for it.
      Adding test for moving the IP to a line that has already a breakpoint.
      
      * Creating tests in async function and lambda as suggested by @radical
      
      * Addressing @radical comments.
      
      * Addressing @radical comments offline
      
      * Adding comment to explain dual invocations.
      
      * Removing unnecessary code.
      
      * Addressing @radical comments.
      
      * Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Addressing @radical comments.
      
      * Apply suggestions from code review
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Removing unnecessary code.Addressing @radical comments.
      
      * Addressing @radical comments.
      
      * Added test as suggested offline by @radical
      
      * Creating tests as suggested by @radical.
      
      * Adding test as suggested by @radical.
      Fixing behavior of this new test: moving IP to a nested function.
      
      * Changing order in test.
      
      * Creating new test suggested by @radical.
      
      * Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      
      * Addressing @radical comments.
      
      * Addressing @radical comments.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      e696cbae