Commit graph

353 commits

Author SHA1 Message Date
Derek Xu
d0114ec0a2 [dart:developer] Add static Service.getObjectId method
TEST=pkg/vm_service/test/developer_service_get_object_id_test.dart

Fixes: https://github.com/dart-lang/sdk/issues/53012
Change-Id: I4b4dd49363ff2d91361e9054631516ea1520d3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317160
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-08-04 14:18:38 +00:00
Derek Xu
0d16e25c6c [dart:developer] Deprecate Service.getIsolateID in favour of Service.getIsolateId
TEST=CI

CoreLibraryReviewExempt: This CL just marks Service.getIsolateID as
deprecated in favour of Service.getIsolateId, which is identical in all
aspects other than the name. We agreed that the new name was better here:
https://dart-review.googlesource.com/c/sdk/+/317160/comment/032739dd_b5e6abc1/
Change-Id: I1464ff3ce7430f01dfeeaf95f56ec980561efd21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317220
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-04 14:18:38 +00:00
Martin Kustermann
587e6308bf [vm] Fix expression evaluation in context of closures
When evaluating an expressino at a breakpoint that's inside a closure,
the closure may refer to anything it closes over. That includes the
`this` from an enclosing method.

So depending on whether a closure's parent chain is an instance method
or a static method, the expression evaluation function is going to be an
instance method or a static method.

=> We walk up the parent chain to determine the correct enclosing class.
=> This avoids making a Type object with a cid from a top-level class (see [0])

Handling this correctly will now try to get the `this` when invoking an
eval function that has an enclosing instance method. Though we may often
have "<optimized out>" the `this` (e.g. due to not capturing it in
closure context chain).

=> We still allow running the expression evaluation function in this
case, but only if the expression being evaluated doesn't access `this`.

A similar issue occurs when trying to use variables in the eval
expression that the closure didn't capture. This results in a confusing
CFE compile-time error. This is a separate issue and tracked in [1].

=> We update the test to distinuish the cases that this CL makes passing
and those that are failing due to [1].

Fixes [0] https://github.com/dart-lang/sdk/issues/53061
See also [1] https://github.com/dart-lang/sdk/issues/53087

TEST=Fixes part of service/evaluate_activation_test failures

Change-Id: I3bb24e7338c7b2f12d5340311d944cb59a455641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-04 11:07:46 +00:00
Derek Xu
17d59bf657 [package:vm_service] Update generator to always include required parent class fields in constructors
Change-Id: I3c37668788721735fac58c28e3b9ad15ef364fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317980
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-03 15:54:36 +00:00
Ryan Macnak
5e49ea5ad8 [vm, service] Fix discrepancy between VM generating kind _TypeParameters and service.md claiming the existence of kind TypeParameters.
Fix the service type `TypeParameters` to recognize it is a heap object.

Exhaustively test that the service client libraries can handle inflating all types produced by the VM. Compare vm/cc/PrintJSON, which exhaustively tests the VM can generate any type.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52893
Change-Id: Id1f080656ef6e999e69f2ebb5b9961fa3b461e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316862
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-01 20:34:21 +00:00
Derek Xu
0ba8d4ef77 [VM/Debugger] Fix the behaviour of setting inline breakpoints in uncompiled functions
TEST=pkg/vm_service/test/column_breakpoint_test.dart, other debugger
tests in tryjobs

Fixes: https://github.com/dart-lang/sdk/issues/51563
Change-Id: I87ef7e52cfc7e922904b267b7eb74fc783214b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316440
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-07-26 17:15:36 +00:00
Alexander Thomas
a3d48885e7 [release] Bump version on main to 3.2
Tested: CQ
Change-Id: I16210697b47dd85aec8743b457e773b044cab81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316200
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-07-25 15:12:49 +00:00
Martin Kustermann
11d820890e Use utf8.encode() instead of longer const Utf8Encoder.convert()
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

As the checked-in SDK has been rolled to include [0] we can now rely on
the better return type.

[0] https://github.com/dart-lang/sdk/issues/52801

TEST=ci

CoreLibraryReviewExempt: Minor cleanup.
Change-Id: I2c0144023e03b2c265582d83a7fb9469b02f1570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313563
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-24 09:28:38 +00:00
Derek Xu
4083853fd0 [package:vm_service] Prepare to publish v11.8.0
Change-Id: I1f3eb5ff1177ff020a053e76637e58a1c48dbbe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313643
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-07-17 15:01:21 +00:00
Derek Xu
24e65bee37 [VM/Service] Add isGetter and isSetter properties to @Function and Function
TEST=pkg/vm_service/test/get_object_rpc_test.dart and
vm/cc/PrintJSONPrimitives

Fixes: https://github.com/dart-lang/sdk/issues/52920
Change-Id: Id3786e48c8827911e7c49af6ab2f0bf0cd97279f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313642
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-17 15:01:21 +00:00
Derek Xu
ce5210bac9 [package:vm_service] Make generator generate abstract classes for enums in service.md
Change-Id: Idd7542daadcecdd8f71eebafdae3a8e7eecb7e9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313641
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-17 15:01:21 +00:00
Derek Xu
f5080bedb3 [VM/Debugger] Fix behaviour of ActivationFrame::EvaluateCompiledExpression when paused inside a closure
TEST=pkg/vm_service/test/evaluate_inside_closures_test.dart, pkg tryjob

Fixes: https://github.com/dart-lang/sdk/issues/52430
Change-Id: I72b755d31614c7c56c504130656c3668d8b7e72b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313001
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-11 18:41:04 +00:00
Vyacheslav Egorov
a52f2b9617 [vm] Rework awaiter stack unwinding.
The main contribution of this CL is unification of disparate
handling of various functions like `Future.timeout`,
`Future.wait`, `_SuspendState.createAsyncCallbacks` and
`_SuspendState._createAsyncStarCallback` into a single
`@pragma('vm:awaiter-link')` which allows Dart developers
to specify where awaiter unwinder should look for the next
awaiter.

For example this allows unwinding to succeed for the code like this:

    Future<int> outer(Future<int> inner) {
      @pragma('vm:awaiter-link')
      final completer = Completer<int>();

      inner.then((v) => completer.complete(v));

      return completer.future;
   }

This refactoring also ensures that we preserve information
(including Function & Code objects) required for awaiter
unwinding across all modes (JIT, AOT and AOT with DWARF stack
traces). This guarantees users will get the same information
no matter which mode they are running in. Previously
we have been disabling awaiter_stacks tests in some AOT
modes - which led to regressions in the quality of produced
stacks.

This CL also cleans up relationship between debugger and awaiter
stack returned by StackTrace.current - which makes stack trace
displayed by debugger (used for stepping out and determinining
whether exception is caught or not) and `StackTrace.current`
consistent.

Finally we make one user visible change to the stack trace:
awaiter stack will no always include intermediate listeners
created through `Future.then`. Previously we would sometimes
include these listeners at the tail of the stack trace,
which was inconsistent.

Ultimately this means that code like this:

    Future<int> inner() async {
      await null;  // asynchronous gap
      print(StackTrace.current); // (*)
      return 0;
    }

    Future<int> outer() async {
      int process(int v) {
        return v + 1;
      }

      return await inner().then(process);
    }

    void main() async {
      await outer();
    }

Produces stack trace like this:

    inner
    <asynchronous suspension>
    outer.process
    <asynchronous suspension>
    outer
    <asynchronous suspension>
    main
    <asynchronous suspension>

And when stepping out of `inner` execution will stop at `outer.process`
first and the next step out will bring execution to `outer` next.

Fixes https://github.com/dart-lang/sdk/issues/52797
Fixes https://github.com/dart-lang/sdk/issues/52203
Issue https://github.com/dart-lang/sdk/issues/47985

TEST=ci

Bug: b/279929839
CoreLibraryReviewExempt: CL just adds @pragma to facilitate unwinding
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-dwarf-linux-product-x64-try
Change-Id: If377d5329d6a11c86effb9369dc603a7ae616fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-30 14:03:03 +00:00
Vyacheslav Egorov
8d5dbbdf69 [vm/debugger] Rename "causal" to "awaiter" internally
The name is more accurately reflects what this stack trace
contains: despite what causal implies it does *not* actually
reflect the stack which initiated the async operation. Instead
it contains the chain of listeners which will run when
the async operation completes - its awaiters.

TEST=ci

Change-Id: Ie7309c9b1c39246e0fd4c14f7b9c515bcdfbbe10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311384
Reviewed-by: Derek Xu <derekx@google.com>
2023-06-27 07:47:39 +00:00
Vyacheslav Egorov
4a6f9328a2 [vm/debugger] Simplify async breakpoints implementation
We no longer rewrite suspendable function into closures nested
inside the original function, so the whole synthetic async breakpoint
machinery is not needed.

Refactor `Breakpoint` class to make one-shot and per-closure
separate properties of breakpoint, which allows creating
one-shot-per-closure breakpoints.

TEST=existing service tests

Change-Id: I208afe13f36efa40f5746e44867bd24684cf5f03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310601
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-26 22:45:10 +00:00
Alexander Aprelev
b892ccdb19 [gardening] Fix 'debugger()' line expectations in tests.
Follow-up to bbdf87d277.
TEST=ci

Change-Id: I3198698cd6df8a917fa676b6ff42b72cb645949e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311141
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-06-23 17:46:57 +00:00
Alexander Aprelev
bbdf87d277 [vm/debugger] Have debug step check point after debugger() call.
Fixes https://github.com/dart-lang/sdk/issues/46006
TEST=ci

Change-Id: I89a7ad248b75204d1754668cfb23c8d98f554b28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310779
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-06-23 16:53:48 +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
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
Elliott Brooks
70af4a9db0 Add constructor to RPCErrorKind enum
Follow up to https://dart-review.googlesource.com/c/sdk/+/307970

Learned from Kenzie this was possible :) https://github.com/flutter/devtools/pull/5917#discussion_r1231368050

Bug: https://github.com/dart-lang/sdk/issues/52636
Change-Id: Ic244765a6258c000c4171ece35273609c7ee5929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309831
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-20 18:33:50 +00:00
Derek Xu
be125afc18 [VM/Service] Create package:vm_service_protos for distributing code for working with Perfetto protos
TEST=get_perfetto_vm_timeline_rpc_test and
get_perfetto_cpu_samples_rpc_test

Change-Id: I4a001ec634b939a258e337630633ce826e0f8b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303022
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-06-15 19:01:00 +00:00
Derek Xu
ed943203b9 [VM/Service] Update package:vm_service's pubspec and CHANGELOG to v11.7.1
v11.7.0 has to be skipped because it was retracted.

Change-Id: Ia51a1b0ec261e671d2007a03c5089ff590e1313e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308723
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-06-14 18:42:36 +00:00
Derek Xu
caab0835bc [VM/Service] Prepare to publish package:vm_service 11.7.0
Change-Id: Iad580b651371ae4f2ae8ef0e51ea12b093241dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308722
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-12 19:20:56 +00:00
Elliott Brooks
66ded0cdd9 Copy rpc error codes from dds to vm_service
Bug: https://github.com/dart-lang/sdk/issues/52636
Change-Id: Icdf66a3499562a2aba50e7f27879497a7b34ab98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307970
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2023-06-09 18:13:18 +00:00
Derek Xu
63f9cd722a [VM/Service] Add isolateGroup property to Event
TEST=reload_sources_rpc_triggers_isolate_reload_event_test.dart
Change-Id: I0669d09461f147226f1dd2a598896e9a6b44d9b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308221
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-09 17:57:12 +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
Derek Xu
6ca0693c28 Revert "[VM/Service] Add code for working with Perfetto protos to package:vm_service"
This reverts commit 6c3c34560e.

Reason for revert: We will put the proto bindings in a separate package to prevent introducing new transitive dependencies into package:flutter.

Original change's description:
> [VM/Service] Add code for working with Perfetto protos to package:vm_service
>
> TEST=get_perfetto_vm_timeline_rpc_test and
> get_perfetto_cpu_samples_rpc_test
>
> Change-Id: I23a30629f1d7a8cd7e2c9daad2d02fae4decb338
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302421
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I3bd9ce8a09e131271f76fe46ca92288f888d6147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307968
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-06-07 21:28:00 +00:00
Chingjun Lau
9304a8dfd1 Add a new getIsolatePauseEvent method in the VM service.
In Flutter hot reload, the flutter_tools are calling the `getIsolate`
to read the pause state of the isolate, which returns a full list of
libraries loaded in the isolate. The size of the return object grow
linearly to the number of Dart files, which can take ~500ms to transfer
for a large app.

This change adds a new method to only read what is needed.

TEST=pkg/vm_service/test/get_isolate_pause_event_rpc_test.dart

Change-Id: If19910cb3ff5d5057932551ac738afd3c3136fac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305362
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-25 21:55:21 +00:00
Derek Xu
6c3c34560e [VM/Service] Add code for working with Perfetto protos to package:vm_service
TEST=get_perfetto_vm_timeline_rpc_test and
get_perfetto_cpu_samples_rpc_test

Change-Id: I23a30629f1d7a8cd7e2c9daad2d02fae4decb338
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302421
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-10 19:06:10 +00:00
Vyacheslav Egorov
54be4bc80e [vm/service] Remove Stack.awaiterFrames
This field was supposed[1] to replace Stack.asyncCausalFrames but IDEs
and other service protocol users never adopted it.

The mechanism for collecting awaiterFrames and asyncCausalFrames
was originally considerably different, but we have since unified
both[2] after we switched to lazy async stack traces[3].

Today the only differences between the two are:

- asyncCausalFrames represens async gaps explicitly, while
  awaiterFrames does not;
- when asynchronous function is running its synchronous part
  before the first suspension awaiterFrames will still represent
  the corresponding frame as an asynchronous activation, while
  asyncCausalFrames will treat the same frame as regular frame.

Consequently having this field does not add any value.

This CL removes it from the response and updates all tests to
test against asyncCausalFrames.

[1]: https://codereview.chromium.org/2692803006/
[2]: https://dart-review.googlesource.com/c/sdk/+/167561
[3]: https://github.com/dart-lang/sdk/issues/37668

Tested: pkg/vm_service, service, service_2
Bug: https://github.com/dart-lang/sdk/issues/51763
Change-Id: If2b035a8840047423b8ed8ce3b5d81155e9f38d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301062
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-05-09 13:46:56 +00:00
Derek Xu
cd83aa8494 [VM/Service] Prepare to publish package:vm_service 11.5.0
TEST=`dart pub publish --dry-run`

Change-Id: I6ef1c8175f39a086716be859068518d124124718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301540
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-05-04 20:20:58 +00:00
Alexander Markov
c1f9930f5b [vm] Restore InstanceKind.TypeRef in the VM-service API for backwards compatibility
TEST=doc/comment change
Change-Id: I0fcb9d418a9c95e6ce57a03eb693aefb9e245d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301501
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-05-04 18:04:13 +00:00
Derek Xu
1dd644f595 [VM/Service] Add getPerfettoCpuSamples RPC
TEST=Checked that Observatory's timeline view was still able to load CPU
samples correctly, and ensured that samples retrived using
getPerfettoCpuSamples were the same as the ones shown in Observatory.

Change-Id: I9b58cd32bc9a1c08848718f25f10db9fa6d4d241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297760
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-05-03 19:17:11 +00:00
Derek Xu
e36a587298 [VM/Service] Prepare to publish package:vm_service 11.4.0
Change-Id: I5ffbe166a0c13135c3fe356f46f8d355240585cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-04-21 18:59:37 +00:00
Derek Xu
32c595ea89 [VM/Timeline] Add getPerfettoVMTimeline Service RPC
TEST=Loaded the response from a getPerfettoVMTimeline request in the
Perfetto trace viewer and made sure everything looked correct.

Change-Id: I8d4bc35fb36601701976c28653db92b2161e4724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288066
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu
4b2f4c6977 [VM/Timeline] Update CLI options to make it clearer that the Perfetto file recorder records to a file
TEST=Manually verified that the modified CLI options worked as expected, CI

Change-Id: Ibaa308e5c9c3b96c939e2007ee2eaaca30eae280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288063
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
William Hesse
7bac8ed687 [Release] Bump minor version of main to version 3.1.
Change-Id: Icf489686d790be195e37db37727782227d2f3704
TEST=Version bump autogenerated by scripts
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294600
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-04-12 16:36:20 +00:00
Derek Xu
1a519f6c8c Revert "[ package:vm_service ] Add type check to VmServiceConnection to make runtime failures debuggable"
This reverts commit 23661e431f.

Reason for revert: broke google3

Original change's description:
> [ package:vm_service ] Add type check to VmServiceConnection to make runtime failures debuggable
>
> Fixes https://github.com/dart-lang/sdk/issues/49590
>
> Change-Id: I09c83ce34db06326459f18a51ae05a38c6459250
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293480
> Reviewed-by: Derek Xu <derekx@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: I2a4e0ff84f67dfb4cbb8983c75129752db4c36d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293760
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-04-05 16:51:17 +00:00
Ben Konyi
23661e431f [ package:vm_service ] Add type check to VmServiceConnection to make runtime failures debuggable
Fixes https://github.com/dart-lang/sdk/issues/49590

Change-Id: I09c83ce34db06326459f18a51ae05a38c6459250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293480
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-04-05 15:56:11 +00:00
Johnni Winther
5f35413cfa [cfe] Avoid step debugging on intermediate variables in lowering
Closes #51812

Change-Id: Id6bef901ac639fbd1aace4ddf9ed770495efff23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292783
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-04-04 13:55:57 +00:00
Alexander Markov
71b0bb3473 [vm] Allow breakpoints on record assignments
TEST=pkg/vm_service/test/breakpoint_on_record_assignment_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51909

Change-Id: I9a57b0f8374056af5928ab2e4b8bf02fc6d1e171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292802
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 17:55:30 +00:00
Derek Xu
d947cd69ef [VM/Service] Add test that steps through an inline class method call with the debugger
TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/49746
Change-Id: I2637efeb53856466a47611b28a91d5d6828ecdc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292380
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 14:59:00 +00:00
Johnni Winther
6a4947acb3 [cfe] Preserve offsets for uncached expression
The changes the MatchingCache to always create a new CacheExpression.
When the expression is cached the first CacheExpression is used
(the current behavior) but when the expression is not cached, each
individual CacheExpression is used. This ensures the file offsets match
the source location for the uncached expression.

In the updated VM test this shows up as the is-tests using all for
lines in the switch case and not just the first two.

In response to https://github.com/dart-lang/sdk/issues/51812

Change-Id: I2d7bdb54e11f212cd809899a50d827284c4f6657
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292082
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-04-01 21:11:58 +00:00
Alexander Markov
103a098d64 [vm,debugger] Do not stop at hoisted variable declarations when stepping through patterns
TEST=pkg/vm_service/test/step_through_patterns_test.dart
Issue: https://github.com/dart-lang/sdk/issues/51812
Issue: https://github.com/dart-lang/sdk/issues/49755

Change-Id: Ieb2e6f49c613c7543e7e76119cefbc4d8f9ae3de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291840
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-30 18:42:48 +00:00
Derek Xu
b505549a56 [VM/Service] Add test that steps through patterns with the debugger
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/49765
Change-Id: I3d2407fa414b0fce2216c65e0ba1f2be21ee6846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290240
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-28 21:04:59 +00:00
Derek Xu
a6a040658c [VM/Service] Remove sealed and final mixin tests from get_object_rpc_test
sealed and final are being changed so that they cannot be applied to
mixins. See https://dart-review.googlesource.com/c/sdk/+/290614.

Change-Id: I738961f153f86e417db4520a02ab401af7563aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291001
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-24 00:45:46 +00:00
Ben Konyi
15de818977 [ Service ] Add new InstanceKind "UserTag"
Also adds a new "label" property to @Instance

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I746d56909a55e0158896e1034665147c469109bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290920
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-23 17:51:03 +00:00
Derek Xu
d7a26dc078 [VM/Service] Prevent VmServerConnection from converting SentinelExceptions into RPCErrors
TEST=CI, ran `flutter run -d chrome --debug` with the changes in this CL
applied to the vm_service directory in the pub cache and ensured that
this if-statement was entered
8679aeb235/packages/flutter_tools/lib/src/vmservice.dart (L1020-L1024)

Fixes: https://github.com/dart-lang/sdk/issues/51752
Change-Id: I2cec21bbb065b697fa34bd37c80b38f5eb9f493f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-20 20:03:48 +00:00
Alexander Markov
9703692a85 [vm] Hide local variables synthesized in the front-end from debugger
TEST=pkg/vm_service/test/patterns_local_vars_test.dart

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

Change-Id: I5a59d454b005740427610fab46892d63df1310dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288262
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-13 20:37:03 +00:00