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

Unified Diff: runtime/vm/object.cc

Issue 1926333002: Dump more info before crashing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 145791fdc209d4d1beda8287491bc1fc5c2bff52..33cb344bd4698ea7c22bb47507b844880f86de3f 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6418,23 +6418,6 @@ bool Function::TestParameterType(
Heap::Space space) const {
AbstractType& other_param_type =
AbstractType::Handle(other.ParameterTypeAt(other_parameter_position));
-
- // TODO(regis): Remove this debugging code.
- if (other_param_type.IsNull()) {
- const Class& owner = Class::Handle(Owner());
- const Class& other_owner = Class::Handle(other.Owner());
- THR_Print("*** null other_param_type ***\n");
- THR_Print("parameter_position: %" Pd "\n", parameter_position);
- THR_Print("other_parameter_position: %" Pd "\n", other_parameter_position);
- THR_Print("function: %s\n", ToCString());
- THR_Print("function owner: %s\n", owner.ToCString());
- THR_Print("other function: %s\n", other.ToCString());
- THR_Print("other function owner: %s\n", other_owner.ToCString());
- AbstractType& param_type =
- AbstractType::Handle(ParameterTypeAt(parameter_position));
- THR_Print("param_type: %s\n", param_type.ToCString());
- }
-
if (!other_param_type.IsInstantiated()) {
other_param_type =
other_param_type.InstantiateFrom(other_type_arguments,
@@ -6452,16 +6435,40 @@ bool Function::TestParameterType(
// TODO(regis): Remove this debugging code.
if (param_type.IsNull()) {
- const Class& owner = Class::Handle(Owner());
- const Class& other_owner = Class::Handle(other.Owner());
THR_Print("*** null param_type ***\n");
THR_Print("parameter_position: %" Pd "\n", parameter_position);
THR_Print("other_parameter_position: %" Pd "\n", other_parameter_position);
- THR_Print("function: %s\n", ToCString());
+ String& str = String::Handle();
+ str = QualifiedScrubbedName();
+ THR_Print("function name: %s\n", str.ToCString());
+ str = other.QualifiedScrubbedName();
+ THR_Print("other function name: %s\n", str.ToCString());
+ Class& owner = Class::Handle();
+ owner = Owner();
THR_Print("function owner: %s\n", owner.ToCString());
- THR_Print("other function: %s\n", other.ToCString());
- THR_Print("other function owner: %s\n", other_owner.ToCString());
+ owner = other.Owner();
+ THR_Print("other function owner: %s\n", owner.ToCString());
THR_Print("other_param_type: %s\n", other_param_type.ToCString());
+ AbstractType& type = AbstractType::Handle();
+ if (parameter_position > 0) {
+ type = ParameterTypeAt(0);
+ THR_Print("receiver type: %s\n",
+ type.IsNull()? "null" : type.ToCString());
+ }
+ THR_Print("has code: %s\n", HasCode() ? "yes" : "no");
+ str = Report::PrependSnippet(Report::kWarning,
+ Script::Handle(script()),
+ token_pos(),
+ Report::AtLocation,
+ Symbols::Empty());
+ THR_Print("function source: %s\n", str.ToCString());
+ for (intptr_t i = 0; i < NumParameters(); i++) {
+ THR_Print("function param %" Pd "\n", i);
+ str = ParameterNameAt(i);
+ THR_Print(" name: %s\n", str.IsNull() ? "null" : str.ToCString());
+ type = ParameterTypeAt(i);
+ THR_Print(" type: %s\n", type.IsNull() ? "null" : type.ToCString());
+ }
}
if (!param_type.IsInstantiated()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698