Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: runtime/vm/debugger.cc

Issue 2786503003: Fix a couple of bugs with async stack traces (Closed)
Patch Set: update dartk service test status Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 4dbf87e8c46038f1cb5e3dcb01f34b745b4ce20e..d7f345d15aa6eaf275c45164419bae88ebff8b09 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -687,7 +687,7 @@ intptr_t ActivationFrame::ContextLevel() {
}
ASSERT(!pc_desc_.IsNull());
TokenPosition innermost_begin_pos = TokenPosition::kMinSource;
- TokenPosition activation_token_pos = TokenPos();
+ TokenPosition activation_token_pos = TokenPos().FromSynthetic();
ASSERT(activation_token_pos.IsReal());
GetVarDescriptors();
intptr_t var_desc_len = var_descriptors_.Length();
@@ -758,7 +758,10 @@ RawObject* ActivationFrame::GetAsyncCompleterAwaiter(const Object& completer) {
ASSERT(!future_field.IsNull());
Instance& future = Instance::Handle();
future ^= Instance::Cast(completer).GetField(future_field);
- ASSERT(!future.IsNull());
+ if (future.IsNull()) {
+ // The completer object may not be fully initialized yet.
+ return Object::null();
+ }
const Class& future_cls = Class::Handle(future.clazz());
ASSERT(!future_cls.IsNull());
const Field& awaiter_field = Field::Handle(
@@ -1431,8 +1434,7 @@ void DebuggerStackTrace::AddActivation(ActivationFrame* frame) {
void DebuggerStackTrace::AddMarker(ActivationFrame::Kind marker) {
- ASSERT((marker >= ActivationFrame::kAsyncSuspensionMarker) &&
- (marker <= ActivationFrame::kAsyncSuspensionMarker));
+ ASSERT(marker == ActivationFrame::kAsyncSuspensionMarker);
trace_.Add(new ActivationFrame(marker));
}
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698