When I ran dump-class-layout today (09/26) to see the object size of ResourceHandle it died with the following traceback: [[ $ Tools/Scripts/dump-class-layout -c Debug WebCore ResourceHandle Traceback (most recent call last): File "Tools/Scripts/dump-class-layout", line 169, in <module> main() File "Tools/Scripts/dump-class-layout", line 166, in main dump_class(target_path, args.classname) File "Tools/Scripts/dump-class-layout", line 120, in dump_class debugger = lldb.SBDebugger.Create() NameError: global name 'lldb' is not defined ]] I am using Python 2.7.10.
We import the lldb inside the function import_lldb() in dump-class-layout on line 48, <https://trac.webkit.org/browser/trunk/Tools/Scripts/dump-class-layout?rev=188350#L48>. By (2) of <https://docs.python.org/2/reference/simple_stmts.html#import>, the names from the imported module are defined "in the local namespace (of the scope where the import statement occurs)". And each function creates a local namespace by <https://docs.python.org/2/tutorial/classes.html#python-scopes-and-namespaces>. Therefore, import_lldb() does not import the lldb module into the global namespace.
Created attachment 289896 [details] Patch
Comment on attachment 289896 [details] Patch Clearing flags on attachment: 289896 Committed r206441: <http://trac.webkit.org/changeset/206441>
All reviewed patches have been landed. Closing bug.