This CL updates the parsing of "break" statements in the debug console
in observatory, as well as handling that the same script can be a part
of several libraries.
Before one could get stuff like this:
$ break package:front_end/src/fasta/scope.dart:389
Function 'package:front_end/src/fasta/scope.dart:389' not found
$ break scope.dart:389
Script 'scope.dart' is ambiguous
The first one is fixes by this CL: We now allow package uris and thus
no longer think it's a function. In this case it wouldn't have mattered
though, it would just say it was ambiguous, as the last case.
This is caused by the same script being found twice. By using a set
instead of a list, that's fixed too.
Change-Id: I3931c8f2abc0a3a5a77cff516da8767037196bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133593
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
- Clean up loading flow.
- Replace manual iterators with generator functions.
- Produce clearer messages when running out of memory.
- Make various implementation functions and constants private.
Change-Id: I9e016b37552e3110baf00f3052b131dc0d79b748
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132027
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Don't flatten snapshot chunks into a linear byte array to avoid a 2GB limit in JS. The lifts the largest snapshot we can handle to either 2^32 objects or the memory limit in JS.
Change-Id: I1a3ec03cf83cb03b4cf67245b12560a083a6e5b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131943
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
When CPU profiling is disabled, the getCpuSamples RPC would return with
a ServerRpcException stating that the profiler was disabled. This wasn't
being caught when the RPC was invoked, but was being caught in
`ObservatoryApplication` and swallowed. This resulted in the timeline
page being stuck at the timeline loading dialog.
Also includes fixes from "[observatory] Properly wait for Catapult's iframe to load. Give
message while fetching timeline.", commit 3b99524167, which was reverted.
Change-Id: I2fe23d4dba5e20f717e111c519563866bb1a221c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
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>
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>
document.registerElement is going away soon, and dart2js never implemented window.customElements.define.
Replace the inheritance with composition for each FooElement.
When used to create a DOM tree, replace `new FooElement()` with `new FooElement().element`.
In CSS, replace each custom element selector with a class selector, i.e. `foo-element` with `.foo-element`.
Bug: https://github.com/dart-lang/sdk/issues/34107
Change-Id: Id5ab5b6104a6165a8ad3b01d73ee9d76e46024ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reproduction without this fix:
Create 2 files, test1.dart and test2.dart:
```
$ cat test1.dart
import "test2.dart";
main() {
test();
test();
}
$ cat test2.dart
test() {
// blank line.
print("hello");
}
```
Launch with observatory enabled and paused at start, e.g.
`out/ReleaseX64/dart --observe --pause-isolates-on-start test1.dart`
Set a breakpoint on the second (*not* the first!) call to `test()`.
Continue execution.
Now write `break test2.dart:2` into the debugger console and you will be
presented with a stack trace looking something like this:
```
Unexpected exception:
NoSuchMethodError: method not found: 'gi4'
Receiver: Instance of 'minified:hS'
Arguments: []
StackTrace:
main.dart.js 459:3 Object.n
main.dart.js 15752:9 hS.G
main.dart.js 15901:28 hS.gi4
main.dart.js 40703:10 GE.$1
main.dart.js 43127:29 Hz.$0
main.dart.js 43100:9 pN.lG
main.dart.js 43124:12 HA.$1
main.dart.js 43127:29 Hz.$0
main.dart.js 43100:9 pN.lG
main.dart.js 43124:12 HA.$1
===== asynchronous gap ===========================
main.dart.js 14033:115 LH.cG
main.dart.js 13585:17 qm.eB
main.dart.js 13571:3 qm.kC
main.dart.js 13870:3 cQ.aV
main.dart.js 13873:27 cQ.I
main.dart.js 40226:79 P.R
===== asynchronous gap ===========================
[...]
```
This CL fixes the issue by catching the NoSuchMethod
(it will succeed for UnresolvedSourceLocation for instance)
and then using the scriptref and token position on the
abstract class Location to get the actual line.
Change-Id: Id951e2727a5edb8ba52a65959c833dcbf923406c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98667
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously, a valid web socket connection would use the following URI:
`ws://127.0.0.1/ws`
Now, by default, the VM service requires a connection to be made with a
URI similar to the following:
`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`
where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.
This behavior can be disabled with the `--disable-service-auth-codes`
flag.
Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
- Setting the `disableBreakpoints` parameter to true will result in any
breakpoints hit during execution resulting from an evaluate or invoke
call to be ignored.
- Default behavior is the same (break on breakpoints).
- Updated Observatory eval box to disable breakpoints.
- Added tests
Change-Id: Ibf40f8a8de018718435118e13cc2e969f8ed7944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95320
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
In Dart2, type bounds checking is either performed by the common front-end or
by explicitly generated code, but not by type finalization or runtime anymore,
as it was done in Dart1.
Consequently, the class BoundedType is not needed anymore, and malbounded or
malformed types are not seen by the runtime either.
Change-Id: I5d6e4c68d153d6730fa7ff7f6d9dcfa611299c16
Reviewed-on: https://dart-review.googlesource.com/c/86687
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>