System isolates should be able to register service extensions with the
exception of a few special isolates:
- Kernel isolate
- Service isolate
- VM isolate
Required to help resolve b/203694081
TEST=CQ
Change-Id: I1f11acd89132636039a817a5dfddb6189817a7fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222032
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
there is no current isolate
Fixes issue #46612
TEST=Existing tests, manual testing
Change-Id: I88e1f7185b0ccaa6dcd73ccae05935af074dcad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
profiler events.
`Event.cpuSamples` is now a `CpuSamplesEvent` rather than a `CpuSamples`
object, where `CpuSamplesEvent` returns `(@Object|NativeFunction)[]` rather
than `(@Func|NativeFunction)[]`, resulting in a smaller JSON payload.
TEST=get_object_rpc_test.dart,get_cached_cpu_samples_test.dart
Change-Id: I1ad5e3df8840b8c41735d10c6c8669f6503e54a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219284
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
events on Developer stream.
Also removes intrinsic implementations for UserTag_makeCurrent to allow
for service events to be sent on UserTag change.
TEST=DartAPI_UserTags,pkg/vm_service/test/user_tag_changed_test.dart
Change-Id: I5dc9ee77c0048590d3c6e33a652eee5bc3bf522a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This change adds a `setBreakpointState` RPC which allows for breakpoints
to be enabled or disabled without needing to remove and recreate
breakpoints.
Fixes https://github.com/dart-lang/sdk/issues/45336.
TEST=set_breakpoint_state_test.dart
Change-Id: I1a04e6028d4e4560fdb8d3d26420c9a05da06b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193896
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Since hot-reloading will affect all isolates within a group, there
should be nothing isolate-specific inside it. We therefore add a
NoActiveIsolateScope to the main part of the reloading
implementation.
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Refactoring of existing implementation.
Change-Id: I1c8db00e6a016c77c68c2c04448de056a76d42c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184782
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
As part of making the compiler and other subsystems independent
of `Isolate` we have to move various state from `Isolate` to
`IsolateGroup`.
The class_table and object_store were already moved to `IsolateGroup`.
This CL only replaces usages of `Isolate::{object_store,class_table}`
with the equivalent in `IsolateGroup`.
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Pure refactoring - relying on existing test coverage.
Change-Id: I34a0682d715b054d6c5faff077a513980f59a348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177126
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
after startup
It's possible for VM service clients to request information about
isolates before they've been marked as runnable. Updated the assert to
allow for the kNone service event to handle this case.
Fixes https://github.com/dart-lang/sdk/issues/43170
Change-Id: If03d9f6659714408381d5d2e9f9b1d75a83e82a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161761
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
The `TimelineStreamSubscriptionsChanged` event is sent when
`setVMTimelineFlags` is invoked, notifying `Timeline` subscribers that
the set of recorded timeline streams has changed.
Fixes https://github.com/dart-lang/sdk/issues/41822
Change-Id: Ic1545eefea8cf3deeefba97bd1ea2695d1c35016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147681
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
In the early days of AOT, we performed compilation and then ran results in the same process and isolate. This bit was used to track which phase we were in. Today, these always happen in separate processes and separate binaries, distinguished by the macro DART_PRECOMPILED_RUNTIME.
Change-Id: Idd97908f2e692321a6f5aba8d5738625d42f16e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134568
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
(was being added to the isolate list before it was marked as a kernel isolate)
Also do not send service events or debug events from the kernel isolate
Change-Id: I82a1dac3c8a845344dd26ce8a2a9077eb93f8447
Reviewed-on: https://dart-review.googlesource.com/65881
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Status:
- Currently the getIsolate API tries to guess the status of the isolate
when it is in between the IsolateRunnable and PauseStart, by reporting
it as already in the PauseStart status.
This can potentially make flaky all the tests that uses PauseStart to
synchronize with the actual status of the Isolate.
- In the previous situation the timestamp of the event is guessed too,
potentially reporting a wrong value.
- Even with the previous fix the is still a race condition that can lead
to a getIsolate responde with a PauseStart status to be sent before
the actual PauseStart event.
Changes:
- Fallback to None pause event if the isolate is in between
IsolateRunnable and PauseStart, avoiding double posting.
- Send the PauseStart event before the actual status change, partially
avoiding the race conditions.
- Set the pause timestamp before the actual status change, fully
avoiding the race condition.
Closes https://github.com/dart-lang/sdk/issues/28624R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/3006883002 .
A new RPC is introduced `_registerService` which allow clients to
register new services that are accessible from all the other clients.
Each registered endpoint is identified by 3 strings:
- `service`
a non empty string which identifies the provided service
(e.g. `HotReload`, `OpenFile`)
- `alias`
an alias for that particular endpoint used by clients to identify it
(e.g. `Flutter`, `IntelliJ`)
- `method` __generated__
the RPC method that should be invoked from a client to request it
A new _stream_ `_Service` is introduce, and two related events:
- `ServiceRegistered`
which is triggered when a new client is registered.
All the related information (`service`, `alias`, `method`) are sent.
- `ServiceUnregistered`
which is triggered when a client, which previously registered a
service, disconnects.
Just `service` and `method` are sent.
Related https://github.com/dart-lang/sdk/issues/30023R=asiva@google.com, bkonyi@google.com
Review-Url: https://codereview.chromium.org/2980733003 .
- [x] Make `reloadSources` RPC public.
- [x] Add an optional 'pause' parameter to `reloadSources`. When set to true, the isolate will enter the debug pause loop immediately after reloading sources and before resuming execution. This makes it possible for debugger clients to set breakpoints before resuming.
- [x] Add reload_sources_test which tests pausing after reload.
- [x] Fix a bug in `GetVarDescriptors` where a null code object could be used.
R=turnidge@google.com
Review URL: https://codereview.chromium.org/2411153002 .
This is a cut of the work that Todd and I collaborated on in the reload branch.
In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.
- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1965823002 .
- Rename TimelineEventStreamingRecorder to TimelineEventCallbackRecorder. Note that this should only be used for tests.
- Add 'Timeline' service event stream.
- Send a 'TimelineEvents' event on the 'Timeline' stream whenever a TimelineEventBlock is finished and the 'Timeline' stream is subscribed to.
- Simple service protocol test.
R=turnidge@google.com
Review URL: https://codereview.chromium.org/1765563002 .
Fixes#25902
Issue #1
Assuming --pause-isolates-on-start, there is a window of time after an isolate is made runnable and before it pauses at the first message that we say the isolate is "resumed".
- Fix issue #1 by claiming the isolate is paused on start if it will eventually pause on start.
- Also, handle the resume command for this state by clearing the 'should pause on start' bit.
Issue #2
Before an isolate is made runnable we say the isolate is "resumed".
- Fix issue #2 by introducing a new pause event "None".
R=turnidge@google.com
Review URL: https://codereview.chromium.org/1756393002 .
Additions to service protocol:
- PauseEvent includes an "atAsyncContinuation" boolean value.
- Resume command can take an 'OverAsyncContinuation' step mode.
- Breakpoints have an optional 'isSyntheticAsyncContinuation' boolean value.
Added low level step_over_await_test.
Issuing the OverAsyncContinuation resume command does the following:
- Adds a synthetic breakpoint (#1) to the async closure.
- Resumes the isolate.
- When we hit #1, the VM issues a StepOver and then reports us paused at #1.
At the next resume command, the VM will remove #1.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1699153002 .
- Add dart:developer.postEvent for posting events to the service protocol.
- Add 'Extension' service protocol event stream.
- Unit test.
- Update service.md
- Bug fix for logging stream.
R=turnidge@google.com
Review URL: https://codereview.chromium.org/1537523002 .
- Include the embedder's portion of the service isolate's Dart code in precompiled snapshots. Swap it in as the root library when running precompiled instead of loading from source.
- Make linter happy with gen_snapshot.
- Fix profiler to consider Instructions in the VM isolate may have their corresponding Code in the regular isolate.
- Make non-functional service RPCs fail cleanly instead of crashing.
BUG=http://dartbug.com/24651R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1418833004 .
- Display paused time as tooltip over "paused" word.
- Send a timestamp with every ServiceEvent.
- Unit tests verifying that paused on start, exit, and breakpoint timestamps are stable.
- Remember the pause time in DebuggerEvent.
- Remember the pause time in MessageHandler.
- Updated service protocol documentation.
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1311503004 .
This time I am committing the protocol changes first and saving the
Observatory changes for a second cl.
------
We currently support 5 streams: Isolate, Debug, GC, _Echo, and _Graph.
Only generate events when at least one client is listening to the
corresponding event stream.
Only send events to the clients that actually request them.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1166433008
- Allow for multiple breakpoints in the service protocol.
The info isn't actually provided or used yet.
- Drop index for list elements returned by the protocol. Flatten structure.
- Drop index for context elements. Keep sub-structure so we
can choose to add extra slot info later.
- Errors now have ids and kinds.
- exception and stacktrace move from @Error to Error.
- All heap Objects now include class/size.
- Changed BoundedType.type and TypeRef.type to different names.
Turns out we already have a "type" property that conflicts.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1152753005