Observatory: Don't give a stacktrace on Sentinel
E.g. on this:
```
import "dart:developer";
class C {
foo2() {
var temp = 1;
[1, 2, 3].forEach((outer_ea){
[1, 2, 3].forEach((inner_ea){
debugger();
throw "Two!";
});
});
}
}
main() {
new C().foo2();
}
```
Saying `p this` in the debugger when it stops now says `<optimized out>`
instead of something like
```
Internal error: TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'
TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'
at Object.m (http://127.0.0.1:54975/main.dart.js:1630:3)
at Object.os (http://127.0.0.1:54975/main.dart.js:1830:26)
at Object.b (http://127.0.0.1:54975/main.dart.js:1835:3)
at http://127.0.0.1:54975/main.dart.js:26687:14
at a1I.a (http://127.0.0.1:54975/main.dart.js:3202:71)
at a1I.$2 (http://127.0.0.1:54975/main.dart.js:3547:23)
at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
at Tz.lp (http://127.0.0.1:54975/main.dart.js:39181:9)
at TC.$2 (http://127.0.0.1:54975/main.dart.js:39205:15)
at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
```
Change-Id: I7e001816742ff84dad5859f83b08da86d1043ccf
Reviewed-on: https://dart-review.googlesource.com/68660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
diff --git a/runtime/observatory/lib/src/elements/debugger.dart b/runtime/observatory/lib/src/elements/debugger.dart
index 1c70579..81ed77a 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -178,6 +178,8 @@
await debugger.isolate.evalFrame(debugger.currentFrame, expression);
if (response is S.DartError) {
debugger.console.print(response.message);
+ } else if (response is S.Sentinel) {
+ debugger.console.print(response.valueAsString);
} else {
debugger.console.print('= ', newline: false);
debugger.console.printRef(debugger.isolate, response, debugger.objects);