Commit Graph

1103 Commits

Author SHA1 Message Date
Todd Turnidge 6c2ebfcc60 Switch to using SourceLocation universally in service protocol.
Add <location-link> and <location-inset> to provide links and insets
for a location.

Make Frame, Message, and SourceLocation first class in service lib.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1150303004
2015-06-03 09:02:40 -07:00
Ryan Macnak eca0d72abe Provide a logical view of VM-internal maps in Observatory.
BUG=http://dartbug.com/20551
BUG=http://dartbug.com/21185
R=koda@google.com

Review URL: https://codereview.chromium.org//1150103005
2015-06-02 11:38:39 -07:00
Ryan Macnak 98999e6a02 Misc Observatory patches:
- Address some editor hints.
 - Place eval box above fields and be much more generous in expanding fields.
 - Treat maps as plain instances so their refs aren't blank.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1159783004
2015-06-01 14:59:54 -07:00
Todd Turnidge 8adf7de6d1 Introduce Instance.kind.
Use this instead of subclassing Instance in the service protocol.

Revise many instance property names.

BUG=
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//1162133002
2015-05-29 13:02:36 -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
Ryan Macnak 2764bcefba Give structured information about imports and export in the service's library response.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1160943002
2015-05-28 11:37:20 -07:00
Todd Turnidge ab6b2218b0 Standardize on using "kind" to distinguish sub-varieties of a type.
- Event.eventType -> Event.kind.
- Sentinel.id -> Sentinel.kind.

We were already doing this for Code and will do so for Instance in
an upcoming cl.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1153193006
2015-05-28 11:04:32 -07:00
Todd Turnidge 3d02f21309 Service protocol cleanups.
- ServiceEvent -> Event, protocol only.
- Use camel-case for StepOption
- Hide FlagType but make it camel-case too.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1156803003
2015-05-28 10:24:09 -07:00
Todd Turnidge 563083696c Sundry service protocol cleanups before version 1.0.
Frame.depth -> Frame.index
Message.depth -> Message.index
Remove Message.type
Message.priority becomes private
frame -> frameIndex for evaluateInFrame
Class.finalized, Class.implemented, Class.patch Class.allocationStats become private
Instance.nativeFields becomes private
Field.value moves out of "ref" into full object
Field.value -> Field.staticValue
Move Function.static, Function.const to "ref"
Make Script.kind private in docs
Make Function.kind private

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1160873002
2015-05-28 09:30:55 -07:00
Todd Turnidge 95dc56e27e Make several service protocol RPCs private.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1159003002
2015-05-27 11:25:56 -07:00
Ryan Macnak 74dfae69e3 Reapply "Per-closure breakpoints; restructure breakpoint implementation to keep a list of conditions."
Fix copying breakpoints over to a new location when a latent location is resolved.

Fix bad assumption that BreakpointLocationAtLine always returns non-null result.

Review URL: https://codereview.chromium.org//1149983003
2015-05-27 09:59:33 -07:00
Ryan Macnak dfee2bf45d Mark script kinds as private in the service protocol.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1158863002
2015-05-27 09:28:19 -07:00
Ryan Macnak 69c50f7294 Use words! closureFunc -> function, closureCtxt -> context.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1158103002
2015-05-26 16:08:32 -07:00
Ryan Macnak 1fa8c92f31 Libraries have uris not urls. Scripts have uris not names.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1154163004
2015-05-26 16:03:05 -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
Ryan Macnak bad1ccb2f7 Heap snapshot visualizations:
- Dominator tree with retained sizes
- Merge nodes by class

- Split snapshot into chunks so the browser's websockets implementation can handle them.
- Use TypedData indexed by node ids instead of lists of objects and a higher time complexity but more memory efficient algorithm to find the dominator tree (reduces memory usage to ~2X the size of the heap being analyzed from >10X).

R=johnmccutchan@google.com, koda@google.com

Review URL: https://codereview.chromium.org//1124153006
2015-05-26 14:46:28 -07:00
John McCutchan f01b6dd5b2 privatize and remove some fields in Isolate response
- Remove features
- Make heaps -> _heaps
- Make tagCounters -> _tagCounters.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1156183002
2015-05-26 14:05:50 -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
Ryan Macnak e674f0dc62 Revert "Per-closure breakpoints; restructure breakpoint implementation to keep a list of conditions."
This reverts commit d37149ad3b.

Review URL: https://codereview.chromium.org//1145053004
2015-05-21 17:20:57 -07:00
Ryan Macnak d37149ad3b Per-closure breakpoints; restructure breakpoint implementation to keep a list of conditions.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1146173003
2015-05-21 16:52:08 -07:00
rmacnak@google.com 06bd41df60 Use words please.
eval -> evaluate

isolate.evaluate(object, expression) -> object.evaluate(expression)

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45823 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 20:28:28 +00: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 f01c1490f7 Revert 45783
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45784 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 00:32:32 +00:00
johnmccutchan@google.com 95515238cc Move 'dart:profiler' contents into 'dart:developer' and remove 'dart:profiler'
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45783 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 23:48:04 +00:00
rmacnak@google.com aba09abcb5 Update debugger_inspect_test for move to top-level method.
TBR=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45667 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 23:10:22 +00:00
rmacnak@google.com 016214f002 Add Debugger.inspect. 1976 here we come!
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45664 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 22:18:43 +00:00
johnmccutchan@google.com 1f851efdbb Rename 'dart:debugger' to 'dart:developer'
- Rename 'dart:debugger' to 'dart:developer'
- Make 'breakHere' and 'breakHereIf' top level functions.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45658 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 21:24:57 +00:00
ricow@google.com e92f697236 Remove dart2dart support from testing scripts and status files
I will leave it to the dart2js people to remove the support from the dart2js tools (there is also a bunch of comments still in code, do a git grep)

R=kustermann@google.com, floitsch@google.com, kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45588 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 11:29:55 +00:00
johnmccutchan@google.com a25e355731 Add hasStoppedAtBreakpoint
BUG=
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45532 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:30:19 +00:00
johnmccutchan@google.com a19cd071e5 Add 'dart:debugger' library
- Add the 'dart:debugger' library.
- Add the 'Debugger' class.
- Add explicit Dart breakpoint triggered by a call to: Debugger.breakHere();
- Add Debugger.breakHereIf(bool expr)

R=hausner@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45529 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:05:37 +00:00
johnmccutchan@google.com e862e8ad8f Fix analyzer warnings in service tests
BUG=
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45511 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 21:29:01 +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 b18024efb1 Add the --steal-breakpoints flag.
Add a test.

Update debugging_test.dart to not use line number instead of token pos to make it modestly less fragile.

BUG=
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45470 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 17:56:35 +00:00
fschneider@google.com ca629181d0 VM: Use canonical empty-array for empty inlining meta-data.
When inlining meta-information is not used, use Object::empty_array()
instead of Array::New(0), thus saving those allocations.

Guard places for length 0 - before all code objects had an inlining
interval array of length at least 1.

This saves 2 old-space array allocations per unoptimized code object.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45435 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 22:50:02 +00:00
turnidge@google.com aa1363c2af Update hack in test_helper.dart to handle new error message.
BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45379 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 18:32:54 +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
johnmccutchan@google.com 0afab79fde Skip coverage test on Windows
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45319 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 20:10:13 +00:00
rmacnak@google.com 11d54fd84f Reapply "Add tests for evalutating against activation records."
Also kill the testee if the tester has an exceptions running its tests.

BUG=http://dartbug.com/20047
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45305 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 01:13:59 +00:00
rmacnak@google.com f415625d5c Revert "Add tests for evalutating against activation records."
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45264 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-18 00:56:26 +00:00
rmacnak@google.com 677c32a426 Add tests for evalutating against activation records.
Report an exception when the testee hits an assertion failure.

BUG=http://dartbug.com/20047
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45263 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-18 00:06:21 +00:00
turnidge@google.com ec2519c464 Apparently every flag is modified in some test configurations on the buildbot.
This broke my assumption that I could find at least one unmodified flag.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45261 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 23:28:00 +00:00
turnidge@google.com a91774ba56 Fix buildbot.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45260 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 22:32:09 +00:00
turnidge@google.com ad2bb796bc My new tests made some bad assumptions about flag values.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45259 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 22:04:32 +00:00
turnidge@google.com ca5de9eac9 Kill service_test.cc tests in favor of dart tests for the service protocol.
Associated cleanups and fixes that I noticed as I rewrote the tests.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45257 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 21:08:02 +00:00
johnmccutchan@google.com 484a2d2cfa Disable debugging_test on Windows
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45141 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 15:56:10 +00:00
rmacnak@google.com c4403ec250 Ensure call_site_data_test runs with unoptimized code so invocation counts are accurate.
BUG=http://dartbug.com/23160
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45073 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 17:12:06 +00:00
ricow@google.com 8a77499ec5 Mark service/call_site_data_test as flaky on linux
This is not really flaky, but is failing when running with optimization counter tresshold 5

R=iposva@google.com
BUG=23160

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45050 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 06:56:03 +00:00
johnmccutchan@google.com 093460be01 Run service tests in a zone that gracefully handles websocket disconnections
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45046 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 23:58:31 +00:00
johnmccutchan@google.com f6a86e830e Disable code_test on Windows
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45045 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 23:38:56 +00:00
johnmccutchan@google.com 647c355f8c Relocate service library tests and hookup a working status file
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45043 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 22:57:59 +00:00