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>
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>
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>
"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>
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>
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>
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>
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>
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>
+ 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>
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>
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>
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>
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>
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>
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>
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>
We shouldn't fail ("Future already completed") if the timing allows multiple errors from the bad input to arrive during the test run.
Change-Id: I358b8401b865c22d5808c22e463dea0e6416f6ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261602
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This adds the ability to send DAP progress notifications to the client. In this change, the CLI adapter sends them when connecting to the debugger, although the main motivation is to provide feedback when Hot Reload/Hot Restart is in progress (which will be handled in the Flutter adapter once this rolls in).
Additionally, a flag allows sending custom notifications because VS Code's standard handling of notifications (which delays showing them for 500ms) does not work well for Flutter hot reload/hot restart (which can often complete in less time than that) so sending custom events allows the Dart extension to show the progress immediately instead.
Change-Id: I1c91da6dc023b3d2d6cf3c6e8b8bbb53ee5167d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261102
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>