Prechádzať zdrojové kódy

LibCore: Include object names in Object::dump_tree() output

Andreas Kling 4 rokov pred
rodič
commit
aa3c28957a
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      Libraries/LibCore/Object.cpp

+ 4 - 1
Libraries/LibCore/Object.cpp

@@ -155,7 +155,10 @@ void Object::dump_tree(int indent)
     for (int i = 0; i < indent; ++i) {
     for (int i = 0; i < indent; ++i) {
         printf(" ");
         printf(" ");
     }
     }
-    printf("%s{%p}\n", class_name(), this);
+    printf("%s{%p}", class_name(), this);
+    if (!name().is_null())
+        printf(" %s", name().characters());
+    printf("\n");
 
 
     for_each_child([&](auto& child) {
     for_each_child([&](auto& child) {
         child.dump_tree(indent + 2);
         child.dump_tree(indent + 2);