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
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
- Add ServiceIdZone interface for getting temporary ids.
- Add RingServiceIdZone which uses the isolate's object id ring.
- Add GrowableServiceIdZone which uses a growable array.
- Unit tests for ServiceIdZones.
- JSONStream has a service id zone.
- Default service id zone is ring with eager id allocation.
- All service RPCs can include a _serviceIdZone parameter.
- Value of _serviceIdZone can be Ring.NewId or Ring.ExistingId.
- All ObjectIdRing usage in object.cc has been replaced with `jsobj.AddServiceId("id", *this);`
- Add a policy for id reuse to ObjectIdRing::GetIdForObject
- ObjectIdRing can dump its contents to JSON.
- Add _dumpRingRequests RPC which dumps the isolate's ring.
- _getCrashDump includes complete object id ring.
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1132323002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45754 260f80e4-7a28-3924-810f-c04153c831b5
- Add LocalVariableAnnotation to script-inset
- Tweak shortName for a closure
- Teach Script how to find local variable locations (not perfect yet)
- Send tokenPos and endTokenPos for debugger local variables
Performance improvements:
- Reduced script-inset update/computeAnnotations calls from 5 to 1 for each stack frame that is opened
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1126363005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45725 260f80e4-7a28-3924-810f-c04153c831b5
- 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//828353002https://code.google.com/p/dart/source/detail?r=42612R=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
- Add _getCrashDump RPC
- crash dump service response is map of request uris to responses, includes:
-- getVM
-- getFlagList
-- for each isolate:
-- getIsolate
-- _getAllocationProfile
-- getStack
- Add FakeVM to service library
- Add load crash dump to Observatory connect page
- Removes old chromium target support from connect page
- Make debugger page display stack even if libraries can't be loaded
- Fix reload of vm-connect page
- Fix polymer initialization calls
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1100583006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45390 260f80e4-7a28-3924-810f-c04153c831b5
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
Table #1:
All functions sortable on inclusive or exclusive.
Table #2:
Callers of focused function.
Table #3:
Callees of focused function.
Tree:
Inclusive or Exclusive rooted profile tree filtered by focused function.
Also includes:
- Kill LinkLocationManager.
- Merge HashLocationManager into LocationManager.
- Kill nav-control element.
- Add goParameter to navigate based on page parameters (e.g. ?isolateId=...).
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1013563002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45348 260f80e4-7a28-3924-810f-c04153c831b5
Reduce the saturation of the coverage markers.
Creating service-refs is horribly expensive: build the details for call sites and function declarations lazily.
Report is_inlinable instead of CanBeInlined because the latter depends whether the function currently has code or breakpoints.
Review URL: https://codereview.chromium.org//1087833005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45217 260f80e4-7a28-3924-810f-c04153c831b5
- Add the "isolate" command which allows the user to switch isolate by name or number. Supports completion.
- Add the "isolate name" command which allows the user to rename an isolate. Add the "setName" method to the service protocol to support this. Isolates now have a debugger_name() in the vm.
- The new IsolateUpdate event notifies the client when an isolate name changes.
- When an isolate is updated, update the page's isolate too, so the navbar is accurate.
- Update isolate summary to display isolate number.
- Rework how the isolate's name is computed because we were getting garbagey names in the IsolateStart event (SpawnState was not yet set).
- Make sure that the debugger doesn't subscribe to events multiple times.
- "info isolates" is now "isolate list".
- Rework reporting of vm and isolate startTime in the service protocol and in Observatory.
- Fix bug in command completion when subcommands and other completions share common prefixes.
- Rework isolate accounting in the VM object in Observatory. We now create Isolates in getFromMap rather than from IsolateStart events, per se. Rewrite the isolate updating code.
- IsolateStart and IsolateExit events are now owned by the Isolate itself, rather than the vm.
- Return the actual result in pause/resume/etc.
- Add assertion in JSONStream::PrintProperty64 that the result fits in a javascript double. Sigh.
- Stop sending GC events for the service isolate. Add assertions to guard against this happening in the future.
- Misc improvements in error reporting.
Review URL: https://codereview.chromium.org//1007863003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44718 260f80e4-7a28-3924-810f-c04153c831b5
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
--------
VM
Add a new ServiceEvent class in the vm. Rework the event type names.
Add BreakpointAdded, BreakpointResolved, and BreakpointRemoved
service events.
Record the top frame for kIsolateInterrupted and kExceptionThrown
debugger events.
Send a top frame in more Pause* events.
Send breakpoint list with the Isolate response. Remove the
getBreakpoints method from the vm service.
Move Resume events into debugger.cc.
Rework MessageHandler a bit so that we can send PauseStart and
PauseExit notifications.
--------
Observatory
Move some event handler from Application to Isolate.
Rewrite breakpoint tracking code to use the new breakpoint events.
Change run state tracking in Isolate.
Change getFromMap so that it applies updates if the map isn't a ref.
Use getFromMap instead of new ServiceObject in invokeRpc. This
fixes some duplicate ServiceObject problems.
Review URL: https://codereview.chromium.org//979823003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44268 260f80e4-7a28-3924-810f-c04153c831b5
TableTree improvements:
- Row's have flex-box divs in each table cell.
- To represent depth in tree a colored vertical bar for each depth level is shown
- Expanding tree nodes is now asynchronous and animates.
- Change cursor during tree expansion.
Observatory Profiler improvements:
- Improved appearance.
- Support for inclusive (main first) call trees.
- Replace tooltip hover with info toggle.
- Visual icon attributes for code, functions and call tree nodes.
- Fetching / Load status display.
- Cleaned up Code and Function kinds.
Profiler improvements:
- When not profiling the VM (--profile-vm) only walk the stack when we are in Dart code or have exited Dart code. This removes some native stack walker noise.
- Build inclusive (main first) call trees and send across service.
Notes for analyzer team:
Analyzer command line:
./out/ReleaseIA32/dart --keep-code --trace-profiler --profile-depth=128 --observe out/ReleaseIA32/dart-sdk/bin/snapshots/dartanalyzer.dart.snapshot --dart-sdk=out/ReleaseIA32/dart-sdk pkg/compiler/lib/src/dart2js.dart
Profiler settings:
- Tags: None or VM
- Mode: Function
- Direction: Bottom up
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org//965593002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44152 260f80e4-7a28-3924-810f-c04153c831b5