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

Unified Diff: runtime/vm/become.cc

Issue 2240663004: Dump information when we hit a FATAL in become (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/become.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/become.cc
diff --git a/runtime/vm/become.cc b/runtime/vm/become.cc
index accca31f396de7ee188a33f5222d30890d99b211..0850584e86ce0431ef41917da73ad5bf34bf9d45 100644
--- a/runtime/vm/become.cc
+++ b/runtime/vm/become.cc
@@ -192,6 +192,35 @@ static bool IsDummyObject(RawObject* object) {
}
+void Become::CrashDump(RawObject* before_obj, RawObject* after_obj) {
+ OS::PrintErr("DETECTED FATAL ISSUE IN BECOME MAPPINGS\n");
+
+ OS::PrintErr("BEFORE ADDRESS: %p\n", before_obj);
+ OS::PrintErr("BEFORE IS HEAP OBJECT: %s",
+ before_obj->IsHeapObject() ? "YES" : "NO");
+ OS::PrintErr("BEFORE IS VM HEAP OBJECT: %s",
+ before_obj->IsVMHeapObject() ? "YES" : "NO");
+
+ OS::PrintErr("AFTER ADDRESS: %p\n", after_obj);
+ OS::PrintErr("AFTER IS HEAP OBJECT: %s",
+ after_obj->IsHeapObject() ? "YES" : "NO");
+ OS::PrintErr("AFTER IS VM HEAP OBJECT: %s",
+ after_obj->IsVMHeapObject() ? "YES" : "NO");
+
+ if (before_obj->IsHeapObject()) {
+ OS::PrintErr("BEFORE OBJECT CLASS ID=%" Pd "\n", before_obj->GetClassId());
+ const Object& obj = Object::Handle(before_obj);
+ OS::PrintErr("BEFORE OBJECT AS STRING=%s\n", obj.ToCString());
+ }
+
+ if (after_obj->IsHeapObject()) {
+ OS::PrintErr("AFTER OBJECT CLASS ID=%" Pd "\n", after_obj->GetClassId());
+ const Object& obj = Object::Handle(after_obj);
+ OS::PrintErr("AFTER OBJECT AS STRING=%s\n", obj.ToCString());
+ }
+}
+
+
void Become::ElementsForwardIdentity(const Array& before, const Array& after) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
@@ -210,12 +239,15 @@ void Become::ElementsForwardIdentity(const Array& before, const Array& after) {
FATAL("become: Cannot self-forward");
}
if (!before_obj->IsHeapObject()) {
+ CrashDump(before_obj, after_obj);
FATAL("become: Cannot forward immediates");
}
if (!after_obj->IsHeapObject()) {
- FATAL("become: Cannot become an immediates");
+ CrashDump(before_obj, after_obj);
+ FATAL("become: Cannot become immediates");
}
if (before_obj->IsVMHeapObject()) {
+ CrashDump(before_obj, after_obj);
FATAL("become: Cannot forward VM heap objects");
}
if (before_obj->IsForwardingCorpse() && !IsDummyObject(before_obj)) {
« no previous file with comments | « runtime/vm/become.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698