Commit Graph

45 Commits

Author SHA1 Message Date
Ryan Macnak 37ed87b038 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: I8a8b20d8f90acd3b5f741c93f10ba99971aa0c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154825
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-10-14 18:16:27 +00:00
Ben Konyi 6a66061703 [ Service ] Add getWebSocketTarget RPC to allow for Observatory to
connect to DDS without relying on a redirect.

Some WebSocket implementations (particularly dart:html's) don't follow
redirects and don't provide the user with the message returned by the
server.

This CL adds 'getWebSocketTarget' as an RPC which returns the
URI that should be used by the client to connect directly to the proper
web socket target. In addition, the "implicit-redirect" forwarding has
been removed.

Change-Id: Iaf88c965f6fedfa6f63c28a08860a3c80388797c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156485
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-03 22:06:41 +00:00
David Morgan 6bdf55f31f Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit 65e3c9d3b1.

Reason for revert: package:logging, package:stack_trace and package:usage need to be migrated first.

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Changes from the original landing:
> 
>  - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
>  - The test harness is taught about 'service_2'
>  - Observatory's package is added to front end's opt-in list
>  - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots
> 
> The ported tests themselves are not changed.
> 
> Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I43b72f149d8d7e9fe06006cdd8593fed1726aa3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152004
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-23 08:06:00 +00:00
Ryan Macnak 65e3c9d3b1 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Changes from the original landing:

 - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
 - The test harness is taught about 'service_2'
 - Observatory's package is added to front end's opt-in list
 - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots

The ported tests themselves are not changed.

Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-23 02:12:46 +00:00
Alexander Aprelev d315f906de Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit d806959461.

Reason for revert: multiple failures on service and other tests on various buildbots

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: Id22f40dafa8c0fc3fb8c3052321629a48cb7dbc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149684
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-06-02 03:03:57 +00:00
Ryan Macnak d806959461 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-02 01:20:08 +00:00
Ben Konyi f9816cdc35 [ DDS / Service ] Put the VM service into single client mode when DDS connects
Added a private RPC, _yieldControlToDDS, which DDS invokes once
connected to the VM service. Once this method is called, the following
happens:

- The VM service stops accepting new web socket requests.
- The VM service enters single client mode, where DDS is the single
  client.

DDS can only place the VM service in single client mode when it is the only
VM service client. If other clients are connected, DDS will fail to start and
throw an exception.

The purpose of this change is to simplify state management between the
VM service and DDS. The plan is to delegate the following features to
DDS:

- Service extension management
- Custom client name support
- Isolate resume coordination for multiple clients

Change-Id: I0b3143710d94ee9444a4894e24555f7ed1caf5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142564
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-22 22:03:59 +00:00
Ben Konyi 5b19445d9c Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit cccddf3530.

Change-Id: Iabde3542d5be33ffabf50efd9226597aef876ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143961
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-17 21:12:44 +00:00
Alexander Aprelev cccddf3530 Revert "Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests""
This reverts commit e5b85792da as it seems to have broken service/pause_on_start_and_exit_with_child_test/service https://ci.chromium.org/p/dart/builders/ci.sandbox/app-kernel-linux-debug-x64/5877

Change-Id: Idb9df51816eebfb58137c449c6461731c77409f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143881
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 23:37:25 +00:00
Ben Konyi e5b85792da Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
Fixes buildbot failures by running VM service and DDS service tests in
separate test processes.

This reverts commit 1f0c90868c.

Change-Id: I0ad9b2e6ccea4d5468dd4dcdde0e286bcbf820ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 17:59:25 +00:00
Ben Konyi 1f0c90868c Revert "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit 6b2419ddaf.

Reason for revert: Failures on bots. Reverting.

Original change's description:
> [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
> 
> This change adds stream forwarding to the Dart Development Service,
> allowing for clients to subscribe to service protocol streams with DDS
> instead of the VM service directly. DDS will maintain a single
> subscription for each stream as long as at least one client is listening
> to that stream. A DDS stream subscription will be closed when the last
> client listening to that stream either disconnects or calls
> streamCancel.
> 
> This change also enables DDS for most of the Observatory services tests,
> excluding thoses which utilize:
> 
> - Service extensions
> - Client naming
> - Client isolate resume synchronization
> 
> Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I185e63eabca54a3dff49d4f5a8a126795cadfa80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-08 00:07:38 +00:00
Ben Konyi 6b2419ddaf [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
This change adds stream forwarding to the Dart Development Service,
allowing for clients to subscribe to service protocol streams with DDS
instead of the VM service directly. DDS will maintain a single
subscription for each stream as long as at least one client is listening
to that stream. A DDS stream subscription will be closed when the last
client listening to that stream either disconnects or calls
streamCancel.

This change also enables DDS for most of the Observatory services tests,
excluding thoses which utilize:

- Service extensions
- Client naming
- Client isolate resume synchronization

Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-07 23:18:45 +00:00
Ryan Macnak 5a45050d1e [observatory] Flatten the heap snapshot before loading.
This improves the time to deserialize a snapshot. It also doubles the memory needed to receive the snapshot buffer, but the memory high water mark is still computing the dominators.

Change-Id: Ib93015cd6cb366dd2ff750da09ddaa3b37159f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115010
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-05 17:27:06 +00:00
Ryan Macnak 6e987b6eb5 [vm, service] Add requestHeapSnapshot.
This replaces _requestHeapSnapshot and _getObjectByAddresses, which relied on the invalid assumption that objects don't move and the heap hasn't mutated since the initial snapshot.

Updates Observatory to the new format. Adds treemap visualization of the dominator tree. Adds the ability to save and load heap snapshots to files. Removes analysis grouping references by source and target class. Removes ability to navigate from a pixel in the fragmentation view to inspector. Removes ability to query the top retaining instance from an ordinary class browser.

Change-Id: Ia7781c05d43bf3ec149f8b4ecab803b37c3ee981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112181
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-08-19 19:31:42 +00:00
Paul Berry 9e3842d624 Observatory strong mode fix: fix type errors with onDisconnect.
The method ObservatoryApplication._switchVM calls newVM.onDisconnect
and requires the resulting future to be completed with a String.  In
normal operation, this is satisfied and we just need to change a few
static types to enforce it.  But when FakeVM was in use, the future
was completed with `this`.  Since ObservatoryApplication._switchVM is
the only call site that cares what the future is completed with, it
makes sense to just change all the types to Future<String> and modify
FakeVM accordingly.

Change-Id: Id94d27ac6a42f31ab19ccc9ad8dd270ecf4042b4
Reviewed-on: https://dart-review.googlesource.com/57400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-05-30 20:50:24 +00:00
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Ryan Macnak 9f4ffb64ef Partial static mode changes for vm-service and tests (part 2).
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ie2605f5043b9f5d2f9156928e3cd39f74e726853
Reviewed-on: https://dart-review.googlesource.com/30681
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-20 00:45:28 +00:00
Lasse R.H. Nielsen 84c8f27e51 Revert constant-name changes to observatory code.
Change-Id: I7622658c61d1f3c7ebd2d3fbed7c57ef252d97bb
Reviewed-on: https://dart-review.googlesource.com/21620
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-17 12:49:53 +00:00
Lasse R.H. Nielsen 0b58c4bd10 Change some constant declarations to lowerCase.
Retain the old values.

Reapply of https://dart-review.googlesource.com/c/sdk/+/20680 with fixes
for VM method fingerprints.

Change-Id: Ie14e7ccc3194d5561983348e6b6752728913ff4d
Reviewed-on: https://dart-review.googlesource.com/20664
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 12:59:14 +00:00
Lasse R.H. Nielsen e61fc07b58 Revert "Change some constant declarations to lowerCase."
This reverts commit c048cfb178.

Reason for revert: VM code fingerprints needs update.

Original change's description:
> Change some constant declarations to lowerCase.
> 
> Retain the old values.
> 
> Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
> Reviewed-on: https://dart-review.googlesource.com/11520
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Florian Loitsch <floitsch@google.com>

TBR=lrn@google.com,floitsch@google.com

Change-Id: I095e8198304ca4e59b39d30b0fdf0af4945e5231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 11:23:08 +00:00
Lasse R.H. Nielsen c048cfb178 Change some constant declarations to lowerCase.
Retain the old values.

Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
Reviewed-on: https://dart-review.googlesource.com/11520
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-14 11:13:04 +00:00
John McCutchan 7fca076fbb Use dartfmt on Observatory code
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2345023003 .
2016-09-16 06:59:51 -07:00
John McCutchan 72b79d970b Improve VM connection flow in Observatory
- [x] Don't show "(Connected)" next to a VM we aren't connected to.
- [x] Navigate to the vm-connect page if we get an initial connection error.
- [x] Fix regression of the 'vm disconnected' notification bubble not appearing.
- [x] Use the Uris helper class instead of hard coded paths
- [x] Improve user inputted URI normalization
- [x] Ignore network errors on stream subscription requests
- [x] On first launch, attempt to connect to the default target and not the last target connected to.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2340973002 .
2016-09-15 11:29:06 -07:00
Carlo Bernaschina ba0f803fbe Centralized event streams
R=turnidge@google.com

Review URL: https://codereview.chromium.org/2211603002 .
2016-08-04 17:11:16 -07:00
Carlo Bernaschina e71c000ce4 Converted Observatory vm-nav-menu element
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2170723002 .
2016-07-22 15:08:05 -07:00
Alexandre Ardhuin 0784fc3134 use const constructors of Utf8* 2015-08-29 22:44:28 +02:00
Todd Turnidge de300cfa0e Process service events as microtasks.
This preserves the ordering among rpc responses and events.

Add assertions that events are processed in order.

Add a correct timestamp for Resume events when we are paused at start.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1315673007 .
2015-08-27 12:31:06 -07:00
Natalie Weizenbaum 61ea0618ce Support JSON-RPC 2.0-compatible VM service events.
This adds a parameter to streamListen that will cause it to produce JSON-RPC
2.0-compatible events.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1257943003 .
2015-07-28 17:17:40 -07:00
Todd Turnidge c4dad3117a Make VM event streams look like real dart streams.
This is a bit ugly in that vm event streams are created
asynchronously, which is not very natural with the dart libs.

Update tests accordingly.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1217823009 .
2015-07-08 14:18:59 -07:00
Todd Turnidge 67adc6102d Add getVersion and setLibraryDebuggable RPCs to the service protocol.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1149373006
2015-05-28 13:34:23 -07:00
Todd Turnidge 8d24372339 Revert "Add the streamListen and streamCancel rpcs to the vm service."
This reverts commit 0967b63073.

Conflicts:
	runtime/observatory/tests/service/graph_test.dart
	runtime/vm/service.cc

BUG=

Review URL: https://codereview.chromium.org//1152283005
2015-05-26 15:22:39 -07:00
Todd Turnidge 0967b63073 Add the streamListen and streamCancel rpcs to the vm service.
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.

    Implement this all as Dart streams in the service lib.

    Update tests.  Fix a race in async_generator_..._test that was biting me.

Review URL: https://codereview.chromium.org//1143783003
2015-05-26 13:52:35 -07:00
turnidge@google.com 2757d6e686 Rework error handling in the service protocol and in Observatory.
In JSON RPC, error results and regular results are distinguished structurally.  We now do this in the service protocol instead of returning a regular result with the "Error" type.

VM:

- Add PrintError method to JSONStream.  Use this to generate all errors in the service protocol.

- Fix some bugs with "limit" parameter handling.

- Change return value for heap rpcs when they find a collected/expired reference.

- Update tests.

Observatory:

- Add app.handleExceptions -- this is a widely-used exception handler that puts up a notification when there is an uncaught/unexpected exception.  Added a top-level zone catch that uses this handler, as well as explicit uses of this handler at various points in the code.  Most pages use this implicitly or explictly, except for the debugger page, which displays exceptions in the console.

[ General rule, when a function returns a Future, generally let the error pass through.  If a function does async work but doesn't return the Future, then it should handle errors explicitly by calling app.handleExceptions, etc. ]

- Fixed notifications.  They were generally broken.  Some hard-coded type names needed to be fixed, some hacks needed to be removed.

- Add a new class RpcException and a variety of subclasses which capture the error cases when making an rpc.

- Redo refresh buttons so their callbacks return Futures instead of taking a "done" closure.  Cleaner.  Allows us to move error handling outside of the callback.

- Drop ServiceError, ServiceException and the associated views.

- Redo notifications so that event and exception notifications are supported.

- No longer null out the vm when it is disconnected.

- Remove notifications when we visit the vm-connect page.  Only show the "Proceeding will lose current page" dialog when we aren't on the vm-connect page already.

- Improve error message on cpu profile page when profiling is disabled on the VM.

- Allow variables to wrap on debugger page.

- Make eval-box and eval-link tolerant of errors during rpc.  Make the errors display nicely.

- When a breakpoint is marked "not possible", make sure it disappears.  This got broken during script view refactor.

- Drop vm's errors and exceptions streams.  No longer needed.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1120133002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45792 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 19:34:37 +00:00
johnmccutchan@google.com 2f7cff7170 Display isolate message queue in Observatory debugger
- Log the parameters to RPCs
- Display messages like stack frames
    - handler function and script visible
    - message preview instead of local variables
- Expanded and previewed messages do not collapse when stepping within the existing message
- Mark patch classes as finalized to avoid ASSERT on class_finalizer.cc:2358 **
- Support iterating over message queues
- Support printing the message queue as JSON
- Inhibit OOB messages from being handled if we are iterating over the message queue
    - avoids dead lock when looking up port handler (done in Dart code with message handler locked) and a stack overflow trigger to handle OOB messages
- make getObject understand message ids
- Fix dartbug.com/23355

** Need to discuss with Ivan and Matthias (reviewed code differs from committed code but matches my fix):
https://codereview.chromium.org//828353002
https://code.google.com/p/dart/source/detail?r=42612

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1122503003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45505 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 20:20:44 +00:00
turnidge@google.com d9f65329c3 Do not JSON encode the 'result' of a service rpc.
Before a response looked like this...

{ result:<string> id:* }

...where result was always a json encoded string.  This meant that
users of the service protocol had to json decode both the outer
message and the result, which was silly.

Now a response looks like this:

{ result:<map> id:* }

This means that users of the service protocol only need to decode once.

We have changed event formats as well.  Previously, an event looked like this:

{ result:<string> }

(Essentially a result without an id.)  The result was json encoded,
requiring the user to double-decode.

Now an event looks like this:

{ event:<map> }

This allows us to distinguish events from rpc results and avoids
double-decoding.  It also avoids having an id-less rpc result mistaken
for an event.

------------

Some details and associated changes:

- Unify GCEvent and ServiceEvent in the VM.

- Move sequence number handling out of dart code and into JSONStream
  in the VM.  Plumbing.  I needed to do this to avoid double-encoding.
  Some of the dart code gets a bit simpler.

- Update C++ tests to have a sequence number.

- Change format of method/params used in Error responses to be more json-y.

- Strip out double decoding in the service lib.

- Improvements to tests.  I was running into some races and other issues.

- Fail fast when we run into a message decoding problem.  Instead of
  returning a service exception, we now disconnect from the vm.

- VMDisconnected => ConnectionClosed.

- Add some support for a reason string when disconnecting from the vm
  in the service library.

Review URL: https://codereview.chromium.org//1093043004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45378 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 17:55:08 +00:00
turnidge@google.com 0edd5aae1e Some cleanups in the code that posts results to service clients.
- Remove the notion of event families and masks.  This wasn't really used.

- Change "response" to "result" in our response map to be more json-rpc-like.

- Pass events to the service isolate as Strings.

- Add more type declarations around raw data (Uint8List) responses.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1077823003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45034 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 21:08:38 +00:00
turnidge@google.com 1f851c718c Implement 'print', 'up', 'down', and 'frame' commands in the Observatory debugger.
Implement in-frame evaluation in the vm service.

Add a notion of 'current frame' and use it across the debugger,
particularly in source-location based commands (break, clear).

Change the expansion logic for frames, so that by default only the
current frame is shown.  When a user expands a frame it is now pinned.

Change command line parsing so that internal whitespace is preserved.  We need this to properly evaluate expressions with internal whitespace.

Fix a deadlock in the debugger message loop.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//993613002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44353 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 00:07:45 +00:00
johnmccutchan@google.com cadc1a495b Fix isolate lifecycle handling in service library
- Use IsolateCreated and IsolateShutdown events to edit the VM's isolate cache directly.
- IsolateCreated and IsolateShutdown events are owned by the VM.
- When eagerly loading a new isolate, consume any errors rather than letting them bubble up to the application level.
- When reloading the VM perform an edit the isolate cache instead of replacing it.
- When reloading the VM do not reload all isolates.
- Fix flaky coverage_test fail by delaying setting the breakpoint.
- Add isolate lifecycle unit test.
- Make the isolate cache observable and send an observable notification that the 'isolates' property has changed when editing the isolate cache.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//961483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44056 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 17:00:50 +00:00
turnidge@google.com d554f4fbfe Finish moving service protocol to json rpc.
Service

- Remove support for old-style service requests.

- Drop 'arguments' from JsonStream and ServiceRequestHandler.

- Json-rpc inspired renaming: command->method, options->params all over.

- Implement getFlagList, setFlag, getObjectByAddress.

- Add helpers PrintMissingParamError and PrintInvalidParamError
  to make our error messages more regular.

- Update tests.

- Service_SetSource removed for now.  John will resurrect.

Observatory

- Drop all Deprecated 'get' functions.  We now use json rpc for everything.

- Drop 'link' and 'relativeLink' from ServiceObject -- they were
  ui-specific and they are no longer meaningful anyways.  Use 'id' instead.

- New pages: VMPage, FlagsPage, InspectPage, ErrorPage.  All urls
  used by Observatory are now 'new school' and have a proper
  prefix.  ErrorPage is the new catch-all.

- Pages now use a Uri instead of a url String.  This lets them
  grab query parameters more easily.

- SimplePage replaces IsolateSuffixPage.

- We now use gotoLink() or makeLink() to make our navigation
  links.  gotoLink gets some optional parameters to make it
  easier to construct links to ServiceObjects.

- Rework mouse clicks on the heap map to use getObjectByAddress.

- Remove the breakpoint_list.  It wasn't working.  I'll add it back later.

- Silence logging of getIsolateMetric/getVMMetric.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//897193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43514 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 17:45:52 +00:00
turnidge@google.com 91afcbdfc9 Rename the get* methods in preparation for removing them.
Add proper caching to getObject, etc.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//892913003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43431 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 21:47:39 +00:00
turnidge@google.com e65e6fab9d Begin migrating the vm service from a rest-style interface to a json-rpc style interface.
BUG=

Review URL: https://codereview.chromium.org//823403004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43370 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 23:15:40 +00:00
koda@google.com 98e2fafbf2 Rank most retaining instances for each class.
Keep a heap snapshot (object graph) in the isolate.
On request from a class view, show 10 most retaining instances.

Currently, a new snapshot is fetched every time a ranking is requested.
In the future, we will want more fine-grained management of snapshots,
with its own dedicated view/console.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//818733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42754 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 21:31:14 +00:00
johnmccutchan@google.com 261200c587 Build Observatory as part of runtime
Relanding https://codereview.chromium.org/810623005/

Review URL: https://codereview.chromium.org//837723004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42645 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 21:59:42 +00:00
whesse@google.com aa5a986d5d Revert "Build Observatory with runtime"
This reverts commit 76df7b3c1bf83c08d3994d61df4c9c530fadb4e5.
This commit breaks dartium compilation.

BUG=
R=ricow@google.com

Review URL: https://codereview.chromium.org//839543002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42619 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 10:07:58 +00:00
johnmccutchan@google.com 9d6ac72b46 1) Remove prebuilt Observatory sources
2) Move observatory from runtime/bin/vmservice/observatory to runtime/observatory

3) Add two tools scripts:
- tools/run_pub.py (runs pub before SDK is built)
- tools/obs_tool.py (helper for get, build, and deploy stages)

4) Build Observatory with runtime:
- pub get --offline
- pub build
- deploy

5) Build artifacts are now in standard output directory, for example, out/DebugIA32/observatory.

6) Add a new 'dart_boostrap' host target (no snapshot, no observatory) that can be used as the Dart executable to run pub when building Observatory. This is behind a build.py flag --use-bootstrap-for-observatory because:

- It is only necessary on older Linux distributions that are incompatible with the prebuilt Dart testing executable.
- running pub build with the boostrap Debug build is significantly slower.

7) Detect if the prebuilt executable doesn't work and automatically switch to the 'dart_bootstrap' executable. Also, warn the user and provide a Wiki link with more information.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//810623005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42614 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-05 21:26:52 +00:00