Commit Graph

373 Commits

Author SHA1 Message Date
Danny Tuppeny 5b9d75ff20 [dds/dap] Use ID Zones for evaluation requests and invalidate them on resume
Fixes https://github.com/dart-lang/sdk/issues/56794

Change-Id: Ied408503d22c4abb2c4f996f6c9b7847b8ad82be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389960
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-10-30 18:41:13 +00:00
Danny Tuppeny 97ab888201 Remove spawning of DDS from DAP and let the spawned dart run/dart test do it
Fixes https://github.com/dart-lang/sdk/issues/56733

Change-Id: I23acd9ba4cd48dd7fe5e23fc388d143db8779754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386500
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-10-24 20:44:34 +00:00
Derek Xu da9d9f254b Reland "[DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address"
This is a reland of commit 4391ca6643

I have verified that internal CL 687283510 will permit this change to
land without issue.

Original change's description:
> [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/56557
> Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Ib7536f61d49526e67d449ca0a475f379ad4bd362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390760
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-10-18 14:38:07 +00:00
Derek Xu cec29f1306 Revert "[DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address"
This reverts commit 4391ca6643.

Reason for revert: breaks internal tests

Original change's description:
> [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/56557
> Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I02709235d32abab122b5269a5d80f12c4085988b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390542
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-10-16 22:15:28 +00:00
Derek Xu 4391ca6643 [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address
TEST=CI

Fixes: https://github.com/dart-lang/sdk/issues/56557
Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-10 19:22:50 +00:00
Derek Xu bfbbe5c6b6 [VM/Service] Delete all the Service ID zones created by a client when it disconnects
TEST=pkg/vm_service/test/id_zone_deletion_on_client_disconnect_with_dds_test.dart,
pkg/vm_service/test/id_zone_deletion_on_client_disconnect_without_dds_test.dart,
CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/client.dart and
sdk/lib/vmservice/running_isolates.dart.
Change-Id: I32a72ade89b858519c61b5124adbeafb835c3d61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-02 15:46:31 +00:00
Derek Xu c4a77dce65 [DDS] Make runDartDevelopmentServiceFromCLI pass the specified bind address directly into startDartDevelopmentService
Resolving the bind addres before passing it into startDartDevelopmentService was causing some problems with debugging web applications in g3.

TEST=patched these changes into g3 and confirmed that they restore the ability to debug the hello_flutter sample

Change-Id: I2e10be1e2e73245e00d2c3936697b736029a7d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387280
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-01 14:32:29 +00:00
Danny Tuppeny 2cf6ba2d55 [dds/dap] Handle VM Service shutdown exceptions when resuming
This will hopefully fix the flaky tests noted in https://github.com/dart-lang/sdk/issues/55313. I believe when we resume from pause-on-exit, the VM might shut down fast enough that the response is not handled and throws "Service connection disposed" (see https://github.com/dart-lang/sdk/issues/55313#issuecomment-2376593906).

This change will discard any known shutdown errors while sending the request instead.

Change-Id: I7c10aa3eddd6e651114ddba948b0a17688352720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386806
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-26 15:56:42 +00:00
Danny Tuppeny 560adc7dc6 [dds/devtools] Switch to always using a relative base href in DevTools pages
This avoids the server needing to know the exact URL path being used on the client, so proxies that rewrite the path (such as code-server) can still work.

See https://github.com/flutter/devtools/issues/8067#issuecomment-2236419703

Change-Id: I5b131d84232c63f5495ccbb533da727cce514de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376682
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-26 15:19:54 +00:00
Derek Xu 6121c396ee [VM/Service] Expose Service ID zone APIs in service.md and package:vm_service
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Id63180fd08a88865064435b056fa3269835cd476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-09-25 17:28:44 +00:00
Chingjun Lau 2483d300f9 Change the type of google3WorkspaceRoot to String.
This is a followup to https://dart-review.googlesource.com/c/sdk/+/383901

Remove the temporary backward compatibility now that users of this
function has all been migrated.

Bug: b/364942683
Change-Id: I8f951c6eb143497fb9edbf1465417d121a1cbf72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384827
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-13 14:27:11 +00:00
Ben Konyi a5cd16c0cb [ DDS ] Fix failing tests
Fixes failing tests introduced by
https://dart-review.googlesource.com/c/sdk/+/383780.

Change-Id: I700543f4dc6481dd905ffdc44177b009612565d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384880
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-09-11 21:43:08 +00:00
Danny Tuppeny f50975e3b5 [dds] Bump DDS to 5.0.0, use devtools_shared 11.0.0, and support a second DTD URI for web editors
devtools_shared 11.0.0 updates some signatures to use a new DTDInfo class to support both a local + exposed URI for DTD. A new CLI flag `--dtd-exposed-uri` for `devtools server` allows passing this second URI.

The DevTools server will use `--dtd-uri` to connect to DTD itself, but serve `--dtd-exposed-uri` to the frontend.

`--dtd-exposed-uri` is entirely optional and if not supplied, the value from `--dtd-uri` will be used in its place.

Change-Id: I5ab052ff9c4e7b2b186c1592f1ba2d63b7711113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-09-11 17:05:09 +00:00
Chingjun Lau 1850fbbb3a Change the type of google3WorkspaceRoot to Uri | String.
A subsequent CL will be sent to change this to String, after
flutter_tools is migrated to pass a String instead of a Uri.

BazelUriConverter treats google3WorkspaceRoot as a String. Passing a Uri
causes the debug adapter to pass `--google3-workspace-root=file:///`
when launching DDS, making it fail to resolve the uris.

Bug: b/364942683
Change-Id: I46f366bb2308a107a68e63445138e071432e45de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383901
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-06 16:07:00 +00:00
Danny Tuppeny e099a00ee2 [dds] [vm_service] Add a new RPC error code for "Service Disposed" errors
This is not currently used for errors but just adds constants to allow clients to write code to handle these kinds of errors so we can use them in future (instead of generic error codes with string messages).

DAP is also updated ready to handle this error code.

See https://github.com/flutter/flutter/issues/153471

Change-Id: I6ad030d0317e9a70d9e28578787edec75554daad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381501
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-03 14:54:18 +00:00
Derek Xu 6b978a8339 [VM/Service] Add secret _idZoneId parameters to all Service methods
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Ib8af3f073f6db9172df90a5ea221269411f72156
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379545
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Ben Konyi 13285dc8f8 [ DDS ] Prefer IPv6 addresses if the VM service is using IPv6
Fixes https://github.com/dart-lang/sdk/issues/56557

Change-Id: I6c18f31a49e6e0d924a467b4b8c1f9d5709d47d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382020
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-23 15:33:54 +00:00
Ben Konyi e0d140c01e [ DAP ] Migrate DAP to launch DDS with DartDevelopmentServiceLauncher
Part of the process to remove uses of
DartDevelopmentService.startDartDevelopmentService in favor of launching
with `dart development-service`.

Change-Id: I857aee932c0b2fc6ae2172eb106b78c76d536295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380760
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-22 19:46:11 +00:00
Srujan Gaddam ac038f7e84 [dds] Roll chrome_tag, browser_launcher_rev, and add --use-mock-keychain flag to dds
With this roll, Chrome now triggers a dialog on MacOS requesting
credentials. This results in timeouts for
pkg/dds/test/devtools_server/remote_control_test. To avoid user
input, we use a mock keychain instead. The same change has gone
into browser_launcher_rev, and so we include that commit here.

Bug: https://github.com/dart-lang/sdk/issues/56519
Change-Id: I0e0733b658eb09b0775178e617e5ceb42e184ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381705
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-22 18:17:51 +00:00
Danny Tuppeny 212e49fda6 [dds/dap] Treat "Service Connection Disposed" the same as "Client closed with pending request"
Should fix https://github.com/flutter/flutter/issues/153473

Change-Id: I77bcf2da01d340412c3dc709a74cc8ed2d80a43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381181
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-08-19 18:12:14 +00:00
Devon Carew 89532d54ed [deps] rev package:lints to capture the unnecessary_library_name addition
Change-Id: I6ca4b0cef189248eac4d0898e8549424f2d889bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380180
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-08-13 17:04:13 +00:00
Ben Konyi 37c16d095c [ DDS ] Revert removal of --google3-workspace-root option
This option is still needed for Flutter in Google3, which uses DDS from
the external SDK rather than the custom Google3 DDS entrypoint.

Change-Id: I982238a63adde1a80f7226a7f2713cd5d610553f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-08-08 00:09:41 +00:00
Ben Konyi dbe6d5852a Fix bad pattern matching in DDS exception parsing
Nullable types for values in map patterns require the key to be present. Since the 'uri' key is not always present in DDS exception responses, this was causing us to fall back to throwing a StateError.

Related issue: https://github.com/flutter/flutter/issues/152684

Change-Id: I929e1e880c4fc6f740ee595e6e852f23fa247b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378600
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-01 20:03:34 +00:00
Ben Konyi 7eef09cd6e [ package:dds ] Add DartDevelopmentServiceLauncher class
Provides shared logic for launching DDS using `dart
development-service`.

Change-Id: I934c777ada23206b498731ffb0611ed3bd383f1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378320
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-01 14:29:59 +00:00
Danny Tuppeny 8ab91cd9db [dds/dap] Ensure formatting applies to values of type_data lists
When formatting numbers as hex, this should apply to values decoded from typed_data lists too.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5199

Change-Id: I02f3437fa202e5227e9fe0c8df621de846bc3edc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377423
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-07-30 14:55:06 +00:00
Danny Tuppeny ef0e0ee2b6 [dds/dap] Allow sending verbose logs to DAP client to be toggled during a debug session
Capturing debug logs that includes VM Service traffic is useful for debugging. Previously with the new DAPs, this could only be enabled at session start which meant users would have to capture very large log files.

This adds the ability to enable/disable this logging while a debug session is already running. A related change in Dart-Code will send this request when you use the "Capture Debugging Logs" command, so you can start a debug session, get to the point of reproducing an issue, and then just capture the relevant logs (VM Service traffic included).

Fixes https://github.com/Dart-Code/Dart-Code/issues/5197

Change-Id: I7e766e57bd80819eb5da164e544903fae23927ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377222
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-07-24 16:51:33 +00:00
Ben Konyi 3761bc22b4 [ DDS ] Update comment for DevTools URI getter
Change-Id: I92ff9ff1e69a8e7b31a943d0ef7179cbfcb758e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377262
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-07-23 22:47:11 +00:00
Ben Konyi 6864b90126 [ DDS ] Fix DevTools URI not including a trailing '/' before query parameters
This could prevent DevTools from loading correctly as it expects assets
to be located at '<DDS_URI>/devtools/'

Fixes https://github.com/dart-lang/sdk/issues/56294

Change-Id: I0e976a42a9fb1b4896d238674d2c8c8ec99ce7ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376762
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-07-19 22:22:25 +00:00
Danny Tuppeny ae6ed09fc1 [dds] Add cross-origin-resource-policy to DevTools server to enable WASM when embedded
See https://github.com/flutter/devtools/issues/7856#issuecomment-2147440081

Change-Id: If9d19eef8f8475e3dddb70db55e6b72e0ceb6f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374945
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-07-11 15:59:15 +00:00
Elliott Brooks e4e06c6cbd Read the showToUser field on DebugAdapterException to determine whether or not to show DAP errors to the user.
Currently, we are only showing errors to the user if they occur as part of the attach or launch workflows.

Note: The `showToUser` field was added in https://dart-review.googlesource.com/c/sdk/+/369720

Bug: https://github.com/dart-lang/sdk/issues/55789
Change-Id: Idd6bc233fd2f1d5420292095517fd050715e1311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368523
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-07-08 17:31:42 +00:00
Ben Konyi 56416078a0 [ DDS ] Remove extra stderr.close()
Change-Id: Ice61586e2a60d039987b1e3b5f5f328cc46fb41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371880
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-06-17 14:44:22 +00:00
Ben Konyi 9304826679 [ DDS ] Refactor DDS entrypoint to allow for overriding behavior in google3
This moves the CLI logic into lib/src/dds_cli_entrypoint.dart so it can
be invoked by a custom google3 entrypoint (bin/dds.dart can't be
imported using a package: URI).

Since google3 will be able to perform some custom configuration of DDS,
google3 related logic (e.g., `BazelUriConverter`) is also removed. This
is technically a breaking change, but should be safe as this
functionality isn't currently being used.

Change-Id: I54d8a9927ff2df70e013ca5c8bc1d510b0b95f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371520
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 20:27:22 +00:00
Danny Tuppeny b8cb98d0bb [dds/dap] Prevent duplicate values showing in variables views when a class has both a field and a getter with the same name
When a class contains both a field and getter with the same name, we'd include both in the `variables` response. In most cases these are the same value (although it's not guaranteed).

I've chosen to just hide the field in this case and always show the result from evaluating the getter (since I think that's what the user would expect, even in the case where they happen to have different values). Another option could be to show both (but change the name so that fields/getters are shown differently), however in that would change the display (for example adding `get ` in front of all getters) we should probably only do that if it's clear there is demand for it.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5128

Change-Id: I9e23d22a844ee22c38988456b1f275422c5c9e04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-06-11 14:43:15 +00:00
Kenzie Schmoll 0b6aff760b Add headers to the DevTools server to enable serving DevTools with wasm.
Bug: https://github.com/flutter/devtools/issues/7856
Change-Id: I854fbaad9c1e477c3218bd159cd1a6db1aae8e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369100
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-05 17:26:23 +00:00
Helin Shiah 70988840f2 Add type Event ot postEvent
IntelliJ expects a "type" field for events; otherwise the JSON will not be parsed correctly. This came up as part of making the widget rebuild table in DevTools clickable (https://github.com/flutter/devtools/issues/4564)

I'm not totally sure this is the change I need, as I don't know how to test this out end-to-end (build Dart SDK and put into Flutter SDK, then run an app with these changes in DDS?). I think it's right because I'm modifying a spot that was first added in https://dart-review.googlesource.com/c/sdk/+/304981, which added `postEvent` in dds_service_extension.

Change-Id: I9a78903dca7855896b6a9b9c3f9e1d62dcb7099e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368202
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-05-29 17:49:34 +00:00
Danny Tuppeny 6549a66a50 [dds/dap] Remove unnecessary runZonedGuarded when started DDS
Now that https://github.com/dart-lang/sdk/issues/55731 is fixed, this zone is not required to handle failures connecting to DDS.

Change-Id: I4d309e6ef0f555be39744d1509584fafe13ceb78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368567
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-05-29 16:23:52 +00:00
Derek Xu b2a27cbf90 [DDS] Add missing await of WebSocketChannel.ready
TEST=pkg/dds/test/unawaited_web_socket_channel_ready_regression_test

Fixes: https://github.com/dart-lang/sdk/issues/55731
Change-Id: I4629618f74ca42927cd3291cb04a63aa4e938b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368001
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-23 18:52:23 +00:00
Danny Tuppeny 3ca4243818 [dds/dap] Handle errors during VM Service connection/initialization and ensure they're reported to the user
Sometimes we see unhandled exceptions during this setup work, see:

- https://github.com/flutter/flutter/issues/148346
- https://github.com/flutter/flutter/issues/148348

Currently these are unhandled and bring the debug adapter down. In VS Code, the error (send to stderr) is not visible to the user so they just see a silent crash which makes it very difficult to report (and the Flutter crash reports don't have any context).

This change will send the exception to the client and then cleanly terminate, which should give the user more information to open a good bug report (assuming the issue wasn't just something like them terminating the app as it was starting).

Change-Id: I4aefbc278e6a0708924c6fa41c5179d581117689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-05-16 19:39:57 +00:00
Elliott Brooks 93556aeee3 [DAP] Set requirePermissionToResume and requireUserPermissionToResume for onPauseStart and onPauseExit so that DDS waits for DAP's permission before resuming the isolate.
Bug: https://github.com/dart-lang/sdk/issues/54843
Change-Id: I12686d6c683983b7af5a3148681410ff9c684343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350649
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-05-06 17:36:23 +00:00
Danny Tuppeny 6cb80c2e0c [dds/dap] Handle Sentinels in invoke toString()/getObject and return error to clients
getObject and invoke would `throw` if the response was a sentinel and that wasn't handled correctly, which meant sometimes an entire variables request would fail instead of only the individual values (eg. in a map/list) being shown as erroring.

This improves https://github.com/dart-lang/sdk/issues/54897 (you'll no longer see the entire request fail), but it still needs paging adding too.

Change-Id: Ic3ed3bee7c1dd647ebae843007bd30b0e1fda590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364860
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-30 17:23:55 +00:00
Danny Tuppeny 5ed21576fe [dds/dap] Replace use of VM breakpoint IDs with a composite of isolate + breakpoint IDs
Breakpoint IDs were used in a few places here assuming they were globally unique, however they are per-isolate. If all isolates were given the same breakpoints this would work out fine, but when isolates were created/destroyed (eg. during hot reload) we could end up sending back the wrong resolution info to the client, resulting in breakpoints jumping to other locations (even though they were actually set in the correct locations).

Fixes at least some of the issues noted in https://github.com/dart-lang/sdk/issues/55268

Change-Id: I7acf93b99885c87ee0edd9ac1876f895c8943c51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-04-30 17:12:19 +00:00
Kenzie Schmoll adfbcc7657 Update DevTools rev to e15c47243362b160646f03df9b1ad8d41e9a2d30
Change-Id: I8def4dca26b200a9f03cfbd2ef8e66edb0f6bac3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-04-26 21:31:31 +00:00
Danny Tuppeny 2f2564c99f [dds/dap] Don't untruncate toString() values in debug views
Generally we don't untrucate values in the debugger in places where there might be lots of data (such as calling `toString()` on all variables) because it can cause performance issues if the variables are huge.

If you use the "Copy value" ("clipboard") or Debug Console evaluation ("repl") we _do_ always untruncate the values.

However, this code was always untruncating when we called `toString()` on custom classes. This changes it to no longer do so, making long string values consistent between what you see as the values of fields, and the `toString()` results against a class.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4986

Change-Id: Ica3c5ecfed9492ab76fbfa83d161765b3b24eb22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363320
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-04-24 15:54:24 +00:00
Danny Tuppeny f7451f7a3f [dds/dap] Don't include empty output events when output ends with \n
Empty output events are harmless but unnecessary. The stack frame parsing code would always send one with the output ended with \n which until recently was only for stderr, but recently was enabled for stdout.

The extra events broke some Flutter tests that were not expecting them.

See https://github.com/flutter/flutter/pull/147250#issuecomment-2075128834

Change-Id: I13624f763d57a089d6b2d2c9e794cafb6a2f0023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364340
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-04-24 15:37:21 +00:00
Danny Tuppeny 717aa6396c [dds/dap] Parse all output events for stack frames instead of online stderr
The legacy debug adapters would scan all output for stack frames but when building the new adapters I only parsed stderr (because the stack frame parsing captures quite a lot and it seemed unnecessary). It turned out many users appreciated the IDE linking up stack traces in stdout too (because their exception logging framework may handle exceptions and print them this way, or they might have helpers to print the current stack trace to aid debugging).

This marks `parseStackFrames` as deprecated from `sendOutput` and scans all output for frames, while filtering out things that don't look like Dart URIs before calling `lookupResolvedUris` to try and avoid making general output async/slow.

If Flutter considers deprecations a bot failure, this will need to be rolled in manually.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5072

Change-Id: I8857281fb79ca69328074d6ad6a0c0a505e5c193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362804
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-04-16 16:35:41 +00:00
Ben Konyi 2f5a53c89d [ DDS ] Add --devtools-server-address to support external DevTools servers
This allows for DDS to redirect requests for DevTools assets directly to
external DevTools instances served by IDEs.

Change-Id: I6a4730267144ef5e924b69800a53392a97e574f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362401
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-04-11 18:11:43 +00:00
Kenzie Schmoll 27648f6b3a Upgrade DDS dependency on devtools_shared to ^9.0.1.
This upgrade requires adapting to breaking changes for the unified_analytics and DevTools extensions logic in `devtools_shared`.

unified_analytics:
- remove the `unified_analytics` dependency from DDS. The DevTools server handler no longer interacts with this package.

DevTools extensions:
- Serve DevTools extensions from their absolute location in the pub cache.

Bug: https://github.com/flutter/devtools/issues/7547
Change-Id: I13e08c48c5335cccbddecebe907ff9dcc337c461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362062
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-04-11 16:02:48 +00:00
Ben Konyi c1dc26ab8d Reapply "[ DDS ] Add support for google3 URI conversion"
This reverts commit e34cd08cf0.

Change-Id: I2ab2d344b048bdb5abc4978fa0c05b0322b28f92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-04-09 15:20:29 +00:00
Elliott Brooks 9382e58fc9 Set requireUserPermissionsToResume based on pause-isolates-on-start and pause-isolates-on-exit flags
Bug: https://github.com/flutter/devtools/issues/7231
Change-Id: I4665cce72ad9b505cbf513ea151698d5de4eb3f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360441
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-08 18:54:26 +00:00
Ben Konyi 585ecd72a3 [ CLI ] Add support for --cached-user-tags to dart development-service
Change-Id: Id0af4b41f4d1053b48ed0934eb75ecf7ce12b356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361441
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-04-08 15:30:09 +00:00