Commit graph

395 commits

Author SHA1 Message Date
Kenzie Schmoll caedf8214d Bump DevTools to 2.26.2 and devtools_shared to 3.0.0 in DDS
Change-Id: I8601b54fffa34d2c3dba678b3bc6d86f68223ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-21 19:43:52 +00:00
Danny Tuppeny 45d06f2302 [dds/dap] Include Isolate IDs in Threads when used over DDS
See https://github.com/dart-lang/sdk/issues/53086

Change-Id: I380744f9e0d604168f026684b31fe689bb8947c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317701
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-21 14:17:40 +00:00
Danny Tuppeny eda6963e4d [dds/dap] Revert using Isolate numbers for DAP threadIds
This reverts 95e6f1e110 (minus the changelog/version, which have been updated accordingly).

Fixes https://github.com/dart-lang/sdk/issues/53086 although a replacement for mapping threads/isolates needs to be implemented.

Change-Id: I5e4d71f3b4683a04cabec6bda9e6d23caa7901d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317700
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-21 14:17:26 +00:00
pq 42db97d721 bump linter
This is the candidate for the HEAD of the linter SDK sub-tree.

Change-Id: If81b785cb53eed154d1376ebd42b3f0459800361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-14 23:59:48 +00:00
Ben Konyi 5ef423d55c [ DDS ] Prepare for 2.9.4 release
Change-Id: I393ce964bce316592f78c0ea1de45ac1b34ddefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317620
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-01 22:59:17 +00:00
Kenzie Schmoll c96ea516f7 Serve devtools extension assets from devtools_server.
This change cannot be landed until a new version of devtools_shared is published and rolled into the SDK so that it can be depended upon here.

Change-Id: Ia7196fb8c12e980220ee2c2749a979f6359452a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305043
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-01 22:30:34 +00:00
Kenzie Schmoll d792438829 Roll DevTools 2.26.1 into the SDK
Change-Id: I5206ced2deab27841f49c4f1272b0266ed14487b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317445
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-01 21:03:16 +00:00
Danny Tuppeny f191f235df [dds/dap] Fix some races in termination of test runs in DAP tests
It's not guaranteed that a "terminate" request will get a response so this changes the helper to accept a "terminated" event as acknowledgement of termination too.

It also fixes some issues running individual tests that didn't set a CWD (by setting a default for tests, since we can't "dart run test:test" without a cwd), and also updates a breakpoint test to not send breakpoints on invalid lines (something that had been fixed in the CLI test, but not the Test test).

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

Change-Id: I19dd60eb2b6d56035bb4d5b02d8e90713a8ce42d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315823
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-24 14:41:40 +00:00
Ben Konyi d3e5252c01 [ DDS ] Update changelog
Change-Id: I079ee42634988d15b6e042fc67df26602fae8761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314120
Reviewed-by: Derek Xu <derekx@google.com>
2023-07-17 15:33:50 +00:00
Danny Tuppeny 98b63e1dcf [dds/dap] Fix ConcurrentModificationError when sending breakpoints
See https://github.com/dart-lang/sdk/issues/52932.

Change-Id: Iebfc335a44e3a8767341f678cf8af1627c21e50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313782
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-17 14:35:57 +00:00
Danny Tuppeny c4105d35db [dds/dap] Support translating VM Instance IDs -> DAP variablesReferences and back for DAP-over-DDS
This adds two custom requests to the DAP-over-DDS handler to translate between VM/DAP instance IDs:

- $/createVariableForInstance (String isolateId, String instanceId)
- $/getVariablesInstanceId (int variablesReference)

Because DAP's variables request only fetches _child_ variables (eg. fields) but we'd likely want to align the top-level string display of a variable, the wrapped variable will first be returned as a single variable named "value", which contains both the string display value and also a variablesReference to then get the child variables (usually invoked when expanded).

These methods currently live directly in the DDS DAP adapter since I figure they're only useful for clients using the VM Service, but we can move them to the base adapter if in future this turns out to not be the case.

Change-Id: I60f28edd86c3468cc592175cb665557a1fc85056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312987
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-12 15:04:20 +00:00
Danny Tuppeny 80a6670d5d [dds/dap] Add some basic global evaluation support
This provides support for basic global evaluation matching the legacy DAPs. The first available thread is used (because there's currently no way for the user to select a thread) and we look up a library from a file URI provided in the `context` field.

In future I hope there's a standard DAP way of getting a file from the client (see https://github.com/microsoft/vscode/issues/134452).

See https://github.com/dart-lang/sdk/issues/52574
See https://github.com/Dart-Code/Dart-Code/issues/4636

Change-Id: I7bfa466001142e7e39ebb270ce65f4746a9affcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312980
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-11 15:12:41 +00:00
Helin Shiah 2094a733aa Add URI converter method that can be overridden
This is for an internal debug adapter to extend the test debug adapter and provide a custom URI converter to provide internal local paths during breakpoints.

Change-Id: I3b61b70fe07e14f08ff37443ef87facc523bf7fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-07-10 21:30:51 +00:00
Danny Tuppeny 95e6f1e110 [dds/dap] Use Isolate numbers as DAP thread IDs
We used to generate our own thread ID starting at 1 and counting up. There was always a 1:1 mapping from a DAP thread to a VM Isolate. With this change, we always use the Isolate number as the thread ID which makes it easier for tools using both VM Service and DAP at the same time.

Change-Id: Id8d82f6fd5134987f2ecfeaa761765d55999405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312906
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-10 20:14:58 +00:00
Ben Konyi ea1a6a66b8 [ DDS ] Set minimum SDK bound to 3.0.0
Allows for use of new language features.

Change-Id: Ic66cb6d2e8bfbf5ff505cc72c0a23deb32026bbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312601
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-07-06 15:39:35 +00:00
Danny Tuppeny 7c2ee2222f [dds/dap] Improve stack frame rendering + fix bad paths in tests
This fixes a bug where we'd produce the wrong absolute path for stack frames that had absolute paths (because `package:stack_trace` uses `path.absolute()` on them).

It also adds support for making stack frames in printed stack traces faded if they are not part of the users own code. This is something the legacy DAPs did. I've also made it possible to perform this stack parsing on non-error events because I'd like to use it on Flutter structured errors (again, something we supported in legacy adapters and was missing here).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4573,

Change-Id: I6c1c3ab69915eca9a1eeef5dcba7f1eb558086de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311842
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-06 15:01:21 +00:00
Danny Tuppeny 4d1b418230 [dds/dap] Fix breakpoint resolution races when there are multiple isolates
When there are multiple isolates, we may get breakpoint responses/events like this:

- Request/Response to add breakpoint to Isolate 1
- Request/Response to add breakpoint to Isolate 2
- BreakpointAdded for Isolate 1
- BreakpointResolved for Isolate 1
- BreakpointAdded for Isolate 2

Because Isolate 2 did not load the script, the last breakpoint was never resolved. However because the breakpoint ID matched, we would forward this event to the client and un-resolve the previously resolved breakpoint. This would result in odd behaviour in VS Code.

Additionally, the VM may return the same BM breakpoint ID for what the client thinks are two breakpoints (they are on different lines, but resolve to the same location) so when we get a resolved breakpoint, we need to handle both:

- Client breakpoints that have already been transmitted
- Future client breakpoints that may resolve to this same VM breakpoint

The previous code assumed that a BreakpointResolved event could be handled just once. Either for an existing breakpoint, or a future one.

This change swaps from storing queued events to storing the resolution information for each breakpoint, and it does this even if there was an existing breakpoint (in case the breakpoint is reused in future).

Fixes at least some of https://github.com/Dart-Code/Dart-Code/issues/4598

Change-Id: I53b92debfaa0c8f538dc8d67966854bb89634708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-27 14:54:10 +00:00
Danny Tuppeny 06ade88478 [dds/dap] Update test to not set breakpoints on invalid lines
Fixes https://github.com/dart-lang/sdk/issues/51928.

Change-Id: Ifdffd1a90fa8d9a07f34742874064b2192d0005c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310880
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-27 14:46:05 +00:00
Helin Shiah 5b3f7990e8 Revert "Revert "Send DAP events through DDS"" - only check for event handler when DDS URI is also set.
Original change reverted due to test failure: https://github.com/dart-lang/sdk/issues/43743#issuecomment-1601278402

This reverts commit 02b10e1321.

Change-Id: Idb2cbffe18342c76d0cc062e5855c10a6df0e8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310780
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-06-22 21:43:22 +00:00
Danny Tuppeny 194767e452 [dds/dap] Add 'showGettersInDebugViews' which includes getters but lazily
The existing 'evaluateGettersInDebugViews' evaluates getters eagerly which can have side-effects. This adds a setting that allows showing getters in a way that can be shown lazily instead.

I added a new setting (instead of just making evaluateGettersInDebugViews=false be lazy) to preserve the ability to have getters not shown at all (since some users are using that today and might prefer this over lots of lazy getters showing up).

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

Change-Id: I56c2a7c8f85aa8c4cc85cfb3120a8cfec6b54c70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310164
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-22 16:42:52 +00:00
Danny Tuppeny c2a4f8e7eb [dds/dap] Ensure breakpoint modifications do not drop resolution events
When adding new breakpoints, DAP clients send a full new set of breakpoints which results in us removing and re-adding all breakpoints (for a file).

When we re-add a breakpoint that already existed, we would sometimes get the BreakpointAdded event _before_ the addBreakpointWithScriptUri request completed. We couldn't process the event because without the original request completing we could not map the VM breakpoint back to the clients breakpoint to generate the event.

This could result in resolution events being lost, and breakpoints becoming unresolved when you modified them (depending on timing).

This change collects queues and replays any BreakpointAdded/BreakpointResolved events that arrived when the breakpoint ID is unknown, and when `addBreakpointWithScriptUri` completes, it immediately processes any items in this queue.

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

Change-Id: I11daaf99b786ab94f1cc93f9fd38a4f1e241320f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310620
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-22 16:36:55 +00:00
Danny Tuppeny 0a691e3647 [dds/dap] Fix a bug that could result in test failures
This logic was inverted and could result in duplicate terminate requests being sent. Depending on timing, this request might be sent but not responded to (because the DA was already shutting down), causing a "Application terminated with pending terminate request" error.

Change-Id: If89f002792878f8a5ce12341536be70ee01cde11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310380
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-22 15:26:39 +00:00
Danny Tuppeny eafa748a4b [dds/dap] Make hot reload test not flaky on Windows
On my Windows PC, this test often fails because the new content is never hot reloaded because the modification is made too soon after the app starts.

This change does what some Flutter tests do, which is to write a future modified stamp to ensure the file is considered updated when the reload is issued.

Change-Id: If52086fb279897d3e572162dc3a32436fbdb27c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-21 22:46:24 +00:00
Helin Shiah 02b10e1321 Revert "Send DAP events through DDS"
This reverts commit 5292ee8839.

Reason for revert: Causes failure on `sse_smoke_test` because it needs to set up an event handler.

Original change's description:
> Send DAP events through DDS
>
> Change-Id: Ib40306b8e47d74b02b6cbf348c2b5833cfb31a9d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309080
> Commit-Queue: Helin Shiah <helinx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: I62b12de8e2478441d9a7a4177ed1090aa845467f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310740
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-06-21 18:17:16 +00:00
Helin Shiah 5292ee8839 Send DAP events through DDS
Change-Id: Ib40306b8e47d74b02b6cbf348c2b5833cfb31a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309080
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-21 15:51:24 +00:00
Danny Tuppeny 421ac46702 [dds/dap] Implement missing "pause" request
Fixes https://github.com/Dart-Code/Dart-Code/issues/4597

Change-Id: Id21baa8428f80f5c9e80840caf836dc05c4f7209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310343
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-20 18:29:26 +00:00
Danny Tuppeny 01c02d6afd [dds/dap] Clear stored thread data on resume
When an isolate is paused, we store some data for things like variables, stack frames, etc. to round-trip an identifier to the client that it can ask about later.

Previously we never cleared these, so over time in a long debug session they could build up. The DAP spec says these references become invalid when execution is resumed:

> To simplify the management of object references in debug adapters, their lifetime is limited to the current suspended state. Once execution resumes, object references become invalid and DAP clients must not use them.

Because it's possible to resume one thread without another, I'm clearing up only the specific thread (isolate)s data when it resumes, rather than all of it.

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

Change-Id: I2ba7d9cd3f23b5a628d9e279e49edf2bee5afd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310342
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-20 16:41:49 +00:00
Derek Xu b8b89ac0d8 [DDS] Stop IsolateManager from trying to access the isolate field of IsolateReload events
Fixes: https://github.com/dart-lang/sdk/issues/49491
Change-Id: I64b663dc1348aa02f46fae73e693e401567f5c2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308220
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-09 17:57:12 +00:00
Danny Tuppeny aa51ed6bca [dds/dap] Fix typos in DAP readme
Change-Id: Ib2d7b3ce14d3b337a7612eb1c1b1da4a76a7fef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308100
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-08 14:54:14 +00:00
Danny Tuppeny 565379aaec [dds/dap] Respond to DAP launch request before sending runInTerminalRequest
Currently when the user configures a Dart CLI program to be run in the terminal, we ask VS Code to launch it in the terminal before we respond to the launch request. This (depending on settings) can cause VS Code to show the terminal and then switch to the Debug Console (which is both confusing and frustrating for users that opt-in to do this to access stdin of the terminal process).

This change reverses the order when using `runInTerminal` so that `launch` is responded to first.

See https://github.com/microsoft/vscode/issues/168295

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

Change-Id: If9a221361cc3329fb86fb17ba532043266b3438c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307481
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-07 17:31:03 +00:00
Danny Tuppeny 30b9ac9f87 [dds/dap] Don't show skipped tests as passes in debug adapter output
Fixes https://github.com/Dart-Code/Dart-Code/issues/4505

Change-Id: Ic57e5f05b62cc09194c3444437b5303f4ca54830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-06 19:49:32 +00:00
Dan Chevalier 46d9f76f7e Add postEvent to dds client.
This will allow for communication to custom streams through a connection to DDS. The primary use case for this is so Dart DevTools can communicate to the running app's custom streams, and by extension VSCode.

Bug: https://github.com/flutter/devtools/issues/5819
Change-Id: Ib22181a55a15baa4a85f49fb20d86d1ca8f0e5e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304981
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-06-02 19:07:39 +00:00
Alexander Aprelev 17781dbc36 [frontend/dds] Enable frontend server and dds to pass through types, method and class information for expression evaluation.
This information is needed for correct expression compilation.
Method name, for example, introduced in 48d8225b17 is needed for the compiler to confirm extension method context.

For flutter https://github.com/flutter/flutter/pull/128084 will be needed.

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

Change-Id: I32e53a953ebfb51afb462f4e2169fac0bcee0a7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306908
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-06-02 16:27:28 +00:00
Helin Shiah 2cc17f4718 Export dap package from DDS for flutter tools
Reland "Reland "Use dap package in dds, dds_service_extensions""

This is a reland of commit a48d2cf02c

This was failing in g3 because it seemed dependencies weren't added to the g3 files. There's now a fix in g3.

Original change's description:
> Reland "Use dap package in dds, dds_service_extensions"
>
> This is a reland of commit 59bb1fce82
>
> Original change's description:
> > Use dap package in dds, dds_service_extensions
> >
> > Change-Id: I678c810e02a5989ee1b4edebaf9d741e2fc7d026
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302849
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
> > Commit-Queue: Helin Shiah <helinx@google.com>
>
> Change-Id: Ib5b9cad1d0c19dac79c73e65c5de8721d1768285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304105
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Helin Shiah <helinx@google.com>

Change-Id: Ie6618c761ce57b33c36260b52076f6335da2a102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304326
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-05-23 19:23:35 +00:00
Derek Xu 3af9eb58af Revert "Reland "Use dap package in dds, dds_service_extensions""
This reverts commit a48d2cf02c.

Reason for revert: breaks g3 (https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/google/39297/overview)

Original change's description:
> Reland "Use dap package in dds, dds_service_extensions"
>
> This is a reland of commit 59bb1fce82
>
> Original change's description:
> > Use dap package in dds, dds_service_extensions
> >
> > Change-Id: I678c810e02a5989ee1b4edebaf9d741e2fc7d026
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302849
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
> > Commit-Queue: Helin Shiah <helinx@google.com>
>
> Change-Id: Ib5b9cad1d0c19dac79c73e65c5de8721d1768285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304105
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Helin Shiah <helinx@google.com>

Change-Id: I5eee0e7ed9c721d576e1fa59c666c03e4ddb63af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304363
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-18 20:25:17 +00:00
Helin Shiah a48d2cf02c Reland "Use dap package in dds, dds_service_extensions"
This is a reland of commit 59bb1fce82

Original change's description:
> Use dap package in dds, dds_service_extensions
>
> Change-Id: I678c810e02a5989ee1b4edebaf9d741e2fc7d026
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302849
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Helin Shiah <helinx@google.com>

Change-Id: Ib5b9cad1d0c19dac79c73e65c5de8721d1768285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304105
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-05-18 19:25:28 +00:00
Daco Harkes 987c7a7c35 Revert "Use dap package in dds, dds_service_extensions"
This reverts commit 59bb1fce82.

Reason for revert: Breaks arm64 bot with
`Couldn't resolve the package 'dap' in 'package:dap/dap.dart'.`


Original change's description:
> Use dap package in dds, dds_service_extensions
>
> Change-Id: I678c810e02a5989ee1b4edebaf9d741e2fc7d026
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302849
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Helin Shiah <helinx@google.com>

Change-Id: Ie5895dc958ee6bad798007d380bc7e75a67b8926
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304000
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2023-05-17 07:50:07 +00:00
Helin Shiah 59bb1fce82 Use dap package in dds, dds_service_extensions
Change-Id: I678c810e02a5989ee1b4edebaf9d741e2fc7d026
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302849
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-05-17 03:26:57 +00:00
Danny Tuppeny 84f528d26d [dds/dap] Handle "Service has disappeared" errors for in-flight requests when app may be shutting down
Fixes https://github.com/flutter/flutter/issues/116235.

Change-Id: Ibfd24bce45519116e350a7f409609f19ca502ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303580
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-05-16 14:44:23 +00:00
Helin Shiah aa9a219266 Add handling for DAP errors with full body
Change-Id: I214d8247bf1115c982912dd3331add5acdcddc3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302850
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-05-12 19:35:51 +00:00
Derek Xu 8ccece520f [DDS] Prepare to publish package:dds 2.8.1
Fixes: https://github.com/dart-lang/sdk/issues/52270
Change-Id: I08ef372653adfd04eab9d45da225a5bfda74531c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-08 15:14:44 +00:00
Derek Xu 33ab02b064 [DDS] Add getPerfettoVMTimelineWithCpuSamples RPC
Change-Id: I3d8e5c48f5482e787ab9d561692d416c50f37a8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301541
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-04 20:23:09 +00:00
Danny Tuppeny 7a6352a9b1 [dds/dap] Ensure DAP always responds to initialize() before sending initializedEvent
Changes to support DAP in DDS introduced a subtle bug where we could send the `InitializedEvent` before the response to the `Initialize` request because `sendResponse` used a `Completer` and would delay adding the response to the stream until the next iteration of the task queue.

Although there were comments stating this order must be preserved, there were no tests that verified this and it breaks VS Code (https://github.com/dart-lang/sdk/issues/52222).

I've added tests for this, and changed how this works slightly so instead of using a `Completer` we pass in a "responseWriter" function that must write the response to the stream synchronously.

Since the DDS path isn't using events yet and it would require a little more refactoring, I've used a Completer there and added a TODO.

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

Change-Id: I1832126f5015b466c721dbda192da4b8a5d83b62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300601
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-05-02 18:35:26 +00:00
Danny Tuppeny 14ab84ebb3 [dds/dap] Don't throw if isolates exit while trying to resume them
There are two cases where we might be trying to resume an exited isolate:

1. Another debugger resumed the isolate and it exited before we got here
2. We were starting to resume an isolate but then the app was shut down so the isolate exited

Because of async code, we can never guarantee the isolate hasn't exited before we send this event, so the exception we throw should only ever be because the ID was invalid.

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

Change-Id: If3500d5d1adf3ba9179e6a571130256783b23c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299640
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-05-01 14:43:51 +00:00
Helin Shiah 5ef021b116 Add debug adapter to DAP
Change-Id: I5bacd460175a5b2e86326f7501d7f250bbe3ab0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-04-27 01:19:57 +00:00
Danny Tuppeny facfcf0f92 [dds/dap] Handle some additional error causes when resuming isolates
Fixes https://github.com/flutter/flutter/issues/125064.

Change-Id: I521fe29d0f269694dc6c2b993d1e400c495b0605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296560
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-04-20 14:55:23 +00:00
Danny Tuppeny 363a61d72b [dds/dap] Ignore SentinelExceptions while configuring isolates
I'm unable to reproduce this, but there are probably many reasons an isolate could go away while we're doing this async work (such as the app shutting down or a restart). If it does, we should never throw because the results of configuring an isolate are not important if the isolate has gone.

Fixes https://github.com/flutter/flutter/issues/125064

Change-Id: Idb8972a5e77109783799fed70dd8b64e3f702bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296201
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-19 14:10:57 +00:00
Danny Tuppeny 6176f17f0d [dds/dap] Fix flaky DAP test
There were two issues here:

1. During shutdown, when trying to unpause and resume all threads we could get "Service has Disappeared" responses if the app was already shutting down. These need ignoring. This is fixed with `_withErrorHandling` in preventBreakingAndResume.

2. The test teardown would always try to send a terminate request even if the test had already sent it, which could result in a second terminate request not being responded to (because the app shutdown before it could respond, because it had already had a terminate request). This is fixed by the teardown code only sending terminate() if it hadn't already been sent.

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

Change-Id: I1baa857eb4bb7e5616fccdb193fe9213cd9452f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294020
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-11 16:37:57 +00:00
Danny Tuppeny c723515931 [dds/dap] Print any stderr events when the app being tested terminates to help catch VM crashes
See https://github.com/dart-lang/sdk/issues/51928.

Change-Id: I32edbae5433d003ca0295d95fc834b8cd3b8fa5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292784
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-05 16:13:38 +00:00
Danny Tuppeny 57ba99c2d3 [dds/dap] Handle sentinel values in Scopes and Variables requests
Fixes https://github.com/dart-lang/sdk/issues/51916.

Change-Id: I72f02c640084059af5e2b761554ee6ec706f5f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 14:50:12 +00:00
Danny Tuppeny b984c308be [dds/dap] Don't sent breakpoint changed events until after the response to setBreakpoints.
In the response to setBreakpoints we provide IDs for each breakpoint and it's important the client gets these before we sent any "breakpoint resolved" events.

Change-Id: I776304b67b12d8e090480ea2a25a849ad4c1ac5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291763
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-29 18:20:17 +00:00
Danny Tuppeny 11129423b9 [dds/dap] Don't call setLibraryDebuggable unnecessarily
Fixes https://github.com/Dart-Code/Dart-Code/issues/4464.

TEST=DAP tests included, VM changes are only a comment
Change-Id: I5ee44fda5b954d371bd00345815c24515eb14f61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291282
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-29 15:54:02 +00:00
Danny Tuppeny f927a2544e [dds/dap] Update test expectations for test_api/matcher change
The `expect` function was moved from test_api to matcher in cc0598b2c3.

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

Change-Id: I6fdc51ffd92880aba0cfc0a68105beac02a74d91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290962
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-03-23 22:39:46 +00:00
Danny Tuppeny 53319cf221 [dds/dap] Remove breakpoints and resume when trying to terminate test runs
Fixes https://github.com/Dart-Code/Dart-Code/issues/4447.

Change-Id: I9c18fccde101596135d3ea7324bbbd24fb5330c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289825
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 18:21:50 +00:00
Devon Carew baff2375c3 [dds] updates to the dart devtools app size cli flags
Change-Id: I049a98452ec5f8e4e322e2cb9687aaa702819937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289449
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:33:46 +00:00
Elliott Brooks 4ac70a3696 Add 'cache-control: no-store' header to DevTools server
Bug: https://github.com/flutter/devtools/issues/3896
Change-Id: I5cfc2e92716517a044a848339426feb827bb64cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286100
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-01 01:13:40 +00:00
Danny Tuppeny 2d1373bc56 Add missing changelog entry for breakpoint changes
Change-Id: I6fd6683c728226c8885256ba0e2511858931adc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285910
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 17:16:49 +00:00
Danny Tuppeny 6bce1b1e7c [dds/dap] Add global variables to scopes/variables requests
Fixes https://github.com/Dart-Code/Dart-Code/issues/4408.

Change-Id: I8a6f7e15f1db247424db23518e53c821d519f1e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285904
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-28 17:16:49 +00:00
Danny Tuppeny 55cb3ce24b [dds/dap] Add support for breakpoint resolution
Previously we just always sent verified:true for all breakpoints and never handled resolution. This meant breakpoints always appeared verified in VS Code, and did not update to their correct locations when resolved.

This change sends verified:false initially, and then uses the BreakpointAdded/BreakpointResolved events to send verified:true and an updated location as the events arrive.

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

Change-Id: I5b008bef802bb1c31219175a03498f5015ec4a04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285909
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 15:52:31 +00:00
Derek Xu c0c523122b Reland "[VM/Service] Start indexing positional record fields at 1"
This is a reland of commit 1be893c507

Patchset 2 fixes the failure that was in
pkg/dds/test/dap/integration/debug_variables_test.

TEST=CI

Original change's description:
> [VM/Service] Start indexing positional record fields at 1
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/51451
> Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I4cdee610646b3389d7d02ee6d905a66ae6e0329d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284862
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 17:04:10 +00:00
Danny Tuppeny 3d39175f5d [dds/dap] Improve display of errors calling toString() in debug views
Fixes https://github.com/Dart-Code/Dart-Code/issues/4400.

Change-Id: I46b36bcacdd0f8a33f296569fbc2e4ebece9d0f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-22 17:11:12 +00:00
Devon Carew 2d15cad9e5 [pkg/dds] use package:lints/recommended.yaml
Change-Id: I05eb1af5dd985ee9f752b8ea409cabc785740472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283964
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 18:30:23 +00:00
Danny Tuppeny 43e26f18cc [dds/dap] Add support for showing inspect() variables in the debug console
This adds functionality that exists in the legacy VS Code DAP but was not reproduced here.

Calling `inspect(var)` (from `dart:developer`) would print the inspected variable to the Debug Console where the user can expand and review it (similar to using the Watch window).

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

Change-Id: Ic63e6b6eb9f149dc8d80c4efdf622fb1c05bd580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284183
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 15:57:28 +00:00
Danny Tuppeny 9356df41a0 [dds/dap] Ensure variable evaluateNames are stored for all lists/fields/getters
"evaluateNames" are returned to the client along with any variables, so the client can provide the user an expression that evaluates to that variable (used by "copy expression" or "add to watch".

DAP doesn't round-trip these as you expand variables, so we have to track them ourselves, but we were only doing so for map values. This fixes that to handle lists, getters, fields correctly too.

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

Change-Id: Id57e46a1cecf8bd22473911340b649ac05da65fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284223
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-21 15:56:58 +00:00
Dan Chevalier 7599222465 Update to vm_service:11.0.0 in dds
Changing the vm_service version to allow 11.0.0.

Change-Id: I78c5cdc474228e2d280e62ff408a12ea05df1ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-02-13 15:12:55 +00:00
Ben Konyi c14cc6d75b [ package:dds ] Fix TypeError when attempting to debug DevTools requests
TEST=Manual

Change-Id: I043d52fe8863e2ea159300990db48dd05b7bc199
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280051
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-01 16:01:29 +00:00
Danny Tuppeny 72cb7dd238 [dds/dap] Map fileUri/uri fields in ToolEvents before sending to client
This handles cases where the running app/VM was unable to provide a file:/// URI (such as google3) by calling the VM Service to translate the URIs before providing them to the client (which likely only understands file URIs).

Change-Id: Ib0b5d554a21e14e04fac6c05e489f5cc03b8301c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280107
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-01 15:04:19 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Ahmed Ashour 63180b95ed Remove superfluous words.
Fixes #51095

TEST=ci

CoreLibraryReviewExempt: There are no API changes, just removal of superfluous words in the comments.
Change-Id: Ib1020c62fe6baed5ca68f0074323f025cc90e9f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279500
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-01-30 15:58:38 +00:00
Danny Tuppeny 16ede0e1d3 [dds] Bump version and update changelog to reflect published 2.7.3
Change-Id: I4a0f75fdf6ebf5cb3a2ba88996127096af0b9d56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280090
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-30 14:42:44 +00:00
Danny Tuppeny b1c44bf87d [dds/dap] Support format.hex in DAP evaluateRequest + variablesRequest
This adds support for hex formatting that is part of the DAP protocol.

VS Code does not support this natively, so it will require some custom client work. Part of that requires the ability to invalidate the variables view when formatting options change, but this can only be done by the server over DAP, so this also includes a small custom ("private") request "_invalidateAreas" that lets the client bounce this request through the server when it knows the formatting config has changed.

Change-Id: Ic005e9cdf13069b848047cf0a7ac1b8bb39da48f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279963
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-26 18:33:57 +00:00
Danny Tuppeny 1ff357f0f7 [dds/dap] Tidy up variables formatting and allow "format specifiers" in evaluation expressions
This adds some new classes to support different formatting of values in expression evaluation/watch/variables panes.

Some existing code that passed a flag around to suppress quotes has been converted to this use, and in addition, we support some C#-inspired "format specifiers" that allow you to influence the formatting of returned values by adding a suffix to a watch/evaluation expression:

https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/e514eeby(v=vs.100)?redirectedfrom=MSDN

So if you add "foo" and "foo,nq" to your watch window, the latter will format the string without quotes. If you add "a" and "a,h" then the latter will format a in hex.

Format specifiers are carried down, so you can add ",h" to a class or list variable, and each value down the tree will be formatted that way.

Partly fixes https://github.com/Dart-Code/Dart-Code/issues/3940.

Change-Id: I78001bd046ee2586bd828752f9ea08da01e7180c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279961
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-26 17:16:36 +00:00
Sam Rawlins bb78e4f288 [dds] Replace @alwaysThrows with Never
Bug: https://github.com/dart-lang/sdk/issues/49583
Change-Id: I247e8c81c010e37a85b938f9b8dfc6a1765bbf85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279741
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-01-25 11:13:49 +00:00
Danny Tuppeny 589876ba6a [dds/dap] Don't try to send invalid URIs to VM Service _lookupResolvedPackageUris
Fixes https://github.com/Dart-Code/Dart-Code/issues/4358.

Change-Id: I70330d8d5dd3bdcb2aa9753212cd56ff46bf4344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279513
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-24 21:46:33 +00:00
Alexander Thomas b9b6511ca6 Spelling sdk
Closes https://github.com/dart-lang/sdk/pull/50918

Co-authored-by: Josh Soref <jsoref@gmail.com>
GitOrigin-RevId: 1fd275051c561b63d374fb47e76a22424c4a12a9
Change-Id: I97790d9c79ff659f2c1fa2d2d46d041fe67957cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278530
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-01-20 12:37:49 +00:00
Danny Tuppeny 0f065ef477 [dds/dap] Support showing Record fields in debugger views
Change-Id: I799d30995dc1d1f8cd0c0bad79bf7305e5dbc1ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279353
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-19 16:38:47 +00:00
Josh Soref 9e4dc755cb Spelling pkg
Closes https://github.com/dart-lang/sdk/pull/50921

GitOrigin-RevId: 6b1ca502b6722b0a987f33ace66f65cbd2c24e23
Change-Id: I74e4ff3c8e759c576036d6b791bd7734ebd215d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278536
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 10:06:29 +00:00
Danny Tuppeny 4fdbe1b47d [dds] Pass existing DDS URI in existingDdsInstance exception
Work towards a better fix for https://github.com/flutter/flutter/issues/118609.

Change-Id: I7db8bd74cc272a2bb1df3a04e6f1d7b82b877ddb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279175
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-18 20:36:07 +00:00
Danny Tuppeny 7734f11b3b [dds/dap] Switch SILENT_OBSERVATORY to SILENT_VM_SERVICE
+ remove some other Observatory references.

Change-Id: I06d1085b2e0cc82f756bf45178b824382283762a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279085
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-16 18:37:25 +00:00
Ben Konyi 0a0c90e37a [DDS] Prepare for 2.7.2 release
Change-Id: Ifb4cac218b2723e52b76936a6b8275fed6a3a3d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279121
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-01-16 16:31:28 +00:00
Ben Konyi 3a77ebda65 [ DDS ] Ignore method no found responses for streamCpuSamplesWithUserTag
DWDS does not implement streamCpuSamplesWithUserTag and DDS can invoke
it without being prompted to by a client. This change gracefully handles
the absence of this RPC.

Related DWDS change: https://github.com/dart-lang/webdev/pull/1889

Change-Id: Ic821f39caefd25044c2c4a8b34a8271879c7bd5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279020
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-13 17:55:01 +00:00
Danny Tuppeny 3949fe9aec [dds/dap] Forward toolEvents on to the DAP client
Progress towards https://github.com/Dart-Code/Dart-Code/issues/4193.

Also related:
- https://github.com/flutter/flutter/pull/118098
- 4981cbffe2

Change-Id: I7b1394a5d5003c24b90733f1898fe368c0485937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278515
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-13 17:49:12 +00:00
Derek Xu ac23909288 [pkg:dds] Update pkg:vm_service dependency to >=9.0.0 <11.0.0
Change-Id: I6525b63c854dff454700425e142dc69a850169ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278946
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-13 15:56:23 +00:00
Ben Konyi ab5b7d7ad1 [ DDS / VM Service ] Simplify DevTools URI construction
DevTools no longer expects a fragment (i.e., '#') in its path, which was
causing issues when attempting to redirect to an external DevTools
instance.

Also removes unnecessary query parameter encoding.

TEST=Existing tests

Change-Id: Ifbeba62c173141a754951527f44ab337318a21d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278669
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-11 21:22:50 +00:00
Derek Xu 9a7d8857ec [pkg:dds, pkg:dds_service_extensions] Update pkg:vm_service dependency to ^10.0.0
Change-Id: I93d0690edf2bc9b21ac39707ed5dceb2488901b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-11 18:01:43 +00:00
Ben Konyi 52f62eaea8 [ package:dds ] Add support for registering external DevTools servers with DDS
External DevTools instances can be registered with DDS at runtime, allowing for DDS
to redirect DevTools requests to the external DevTools server.

TEST=pkg/dds/test/external_devtools_instance_test.dart

Change-Id: I0bed34029b6ea7d935f77a031ff99b73b986b068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278663
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-10 16:03:41 +00:00
Danny Tuppeny 5b50a61918 [dds/dap] Fix handling of errors when fetching full strings
Fixes https://github.com/dart-lang/sdk/issues/50802.

Change-Id: Ia2bda968708f34aa48c6b92b2f19c24c603fb85c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278349
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-06 16:54:03 +00:00
Ben Konyi 112e1213dc [ package:dds ] Prep for 2.6.0 release
Change-Id: I7ffcd1c9cdf23906324ef77521216bb293259c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276620
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-06 15:26:34 +00:00
Danny Tuppeny ec8918c20c [dds/dap] Handle errors parsing/casting launch/attach arguments and provide useful errors
Fixes https://github.com/dart-lang/sdk/issues/50709.

Change-Id: I35a7593ced462ab81d52069db831e5f95a9a4ba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275623
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-14 17:19:05 +00:00
Dan Chevalier fd6fa010ec [ VM Service / DDS ] Add custom service stream support (Revised)
NOTES:
Original CL: https://dart-review.googlesource.com/c/sdk/+/274061
Revert CL: https://dart-review.googlesource.com/c/sdk/+/274802

Regression tests that failed after merging Original CL:
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release/24046/overview
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release-arm64/5999/overview

----------
DESCRIPTION:
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Made sure that regression from original PR could be reproduced, and then resolved by applying this change. Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I2b04a84b4daf11dd9d72f899928b5e1f62a5ae02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275121
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-12-13 16:31:37 +00:00
Dan Chevalier 3ed65601b0 Revert "[ VM Service / DDS ] Add custom service stream support"
This reverts commit 4981cbffe2.

Reason for revert: Mac regression test failed.

Original change's description:
> [ VM Service / DDS ] Add custom service stream support
>
> Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.
>
>
> The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.
>
> TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients
>
> https://github.com/flutter/devtools/issues/4533
>
> Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>

TBR=bkonyi@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,danchevalier@google.com

Change-Id: Ia1dce25444a6329c0553c931c9a6dbbec65ee583
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274802
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2022-12-12 11:24:37 +00:00
Dan Chevalier 4981cbffe2 [ VM Service / DDS ] Add custom service stream support
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2022-12-09 20:18:30 +00:00
Danny Tuppeny c53f70509c [dds/dap] Filter private getters from debug views
These will fail unless the current stack frame happens to be in the library that declares them, which results in a lot of exceptions being shown in variable views.

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

Change-Id: I5919e391f25a08920dcdf1bf648526d175af00f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274040
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-08 15:02:04 +00:00
Devon Carew 99026df0f8 [deps] update package:webdriver
Change-Id: Iaa875c46f1425160063b5cc5f44e87a60c5e61dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273003
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-12-01 17:42:21 +00:00
Danny Tuppeny 4cd0ef7402 [dds/dap] Address code review nits
Change-Id: I7a03650ba1d8df7b0f11db3408f9e55525b61aa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-10-31 17:23:52 +00:00
Sam Rawlins 1739cc6d89 Add BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR hint
This is similar to BODY_MIGHT_COMPLETE_NORMALLY (the static error),
BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE (the Hint for nullable return
types), and RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, combining the
rules from each.

https://github.com/dart-lang/sdk/issues/49215 (but maybe doesn't close,
if the core issue is the VM issue)

Change-Id: I9a010e5a3f0f88abfdab479339e5e76759ae9d92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247863
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-27 18:21:47 +00:00
Danny Tuppeny 37be66028b [dds/dap] Allow debug adapters to register multiple mappings for org-dartland-sdk URIs
Change-Id: Ibcb0f145d64c7cd7712c031737741b2dbc4aaab8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265500
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-26 14:26:01 +00:00
Danny Tuppeny 96294014e3 [dds/dap] Allow debug adapters to override the org-dartlang-sdk URI for the Dart SDK
Change-Id: I74432315d4bfa8e9890e0bd86fa0fa67d591f7fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265322
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-25 14:03:29 +00:00
Danny Tuppeny bc7094dbc1 [dds/dap] Ensure "terminated" event is sent when detaching from processes
Change-Id: I466f97c2d98649b77412396e462bf3ae9c9e7f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264481
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-18 13:26:35 +00:00
Danny Tuppeny ae352fe940 [dds/dap] Improve handling of lists in variables requests
Fixes https://github.com/Dart-Code/Dart-Code/issues/4204.
Fixes https://github.com/Dart-Code/Dart-Code/issues/4213.

Change-Id: Ibd95a149e6f620efb690c24623bb6b9d04a794b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-17 21:51:36 +00:00