dump-class-layout is just wrong
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2018 17:07:47 +0000 (17:07 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2018 17:07:47 +0000 (17:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183939

Reviewed by Yusuke Suzuki.

Looks like r229291 contained a half-renamed variable in it, so it
just doesn't work.

* Scripts/dump-class-layout:
(verify_type):
(verify_type_recursive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/dump-class-layout

index e4df40f..c56c879 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-23  JF Bastien  <jfbastien@apple.com>
+
+        dump-class-layout is just wrong
+        https://bugs.webkit.org/show_bug.cgi?id=183939
+
+        Reviewed by Yusuke Suzuki.
+
+        Looks like r229291 contained a half-renamed variable in it, so it
+        just doesn't work.
+
+        * Scripts/dump-class-layout:
+        (verify_type):
+        (verify_type_recursive):
+
 2018-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Run JSC GLib API tests in GTK+ and WPE bots.
index 037447e..d418644 100755 (executable)
@@ -58,8 +58,8 @@ def import_lldb():
 
 def verify_type(target, type):
     typename = type.GetName()
-    seenBefore = Set()
-    (end_offset, padding) = verify_type_recursive(target, type, None, 0, 0, 0, seenBefore)
+    seenOffset = Set()
+    (end_offset, padding) = verify_type_recursive(target, type, None, 0, 0, 0, seenOffset)
     byte_size = type.GetByteSize()
     print 'Total byte size: %u' % (byte_size)
     print 'Total pad bytes: %u' % (padding)
@@ -67,7 +67,7 @@ def verify_type(target, type):
         print 'Padding percentage: %2.2f %%' % ((float(padding) / float(byte_size)) * 100.0)
     print
 
-def verify_type_recursive(target, type, member_name, depth, base_offset, padding, seenBefore):
+def verify_type_recursive(target, type, member_name, depth, base_offset, padding, seenOffset):
     prev_end_offset = base_offset
     typename = type.GetName()
     byte_size = type.GetByteSize()
@@ -105,7 +105,7 @@ def verify_type_recursive(target, type, member_name, depth, base_offset, padding
                     print '%+4u <%3u> %s<PADDING>' % (prev_end_offset, member_padding, '    ' * (depth + 1))
 
             if member_is_class_or_struct:
-                (prev_end_offset, padding) = verify_type_recursive(target, member_canonical_type, member_name, depth + 1, member_total_offset, padding, seenBefore)
+                (prev_end_offset, padding) = verify_type_recursive(target, member_canonical_type, member_name, depth + 1, member_total_offset, padding, seenOffset)
             else:
                 prev_end_offset = member_total_offset + member_byte_size
                 member_typename = member_type.GetName()