[pypy-svn] r71371 - pypy/branch/debug-vref2/pypy/jit/backend/x86/tool

arigo at codespeak.net arigo at codespeak.net
Sun Feb 21 13:05:59 CET 2010


Author: arigo
Date: Sun Feb 21 13:05:56 2010
New Revision: 71371

Modified:
   pypy/branch/debug-vref2/pypy/jit/backend/x86/tool/viewcode.py
Log:
Fix: don't keep all output in memory.


Modified: pypy/branch/debug-vref2/pypy/jit/backend/x86/tool/viewcode.py
==============================================================================
--- pypy/branch/debug-vref2/pypy/jit/backend/x86/tool/viewcode.py	(original)
+++ pypy/branch/debug-vref2/pypy/jit/backend/x86/tool/viewcode.py	Sun Feb 21 13:05:56 2010
@@ -262,6 +262,13 @@
         if showgraph:
             g1.display()
 
+    def showtextonly(self):
+        self.ranges.sort()
+        for r in self.ranges:
+            disassembled = r.disassemble()
+            print disassembled
+            del r.text
+
 
 def tab2columns(text):
     lines = text.split('\n')
@@ -365,4 +372,6 @@
     world.parse(f)
     if showgraph:
         world.find_cross_references()
-    world.show(showtext=True, showgraph=showgraph)
+        world.show(showtext=True)
+    else:
+        world.showtextonly()



More information about the Pypy-commit mailing list