[Stackless-checkins] CVS: slpdev/src/2.3/psyco-1.2/py-utils xam.py, 1.2, 1.3

Christian Tismer tismer at centera.de
Fri Jul 23 13:36:35 CEST 2004


Update of /home/cvs/slpdev/src/2.3/psyco-1.2/py-utils
In directory centera.de:/tmp/cvs-serv32522/psyco-1.2/py-utils

Modified Files:
	xam.py 
Log Message:
made xam.py work on Windows.
I will create an extra sub-package for psyco.

Index: xam.py
===================================================================
RCS file: /home/cvs/slpdev/src/2.3/psyco-1.2/py-utils/xam.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xam.py	22 Jul 2004 17:49:42 -0000	1.2
--- xam.py	23 Jul 2004 11:36:33 -0000	1.3
***************
*** 17,22 ****
  # psyco_dump_code_buffers() in psyco.c.
  symbolfiles = [sys.executable]
- if sys.platform == "win32":
-     symbolfiles = [os.environ["SYSTEMROOT"] + r"\SYSTEM32\python23.dll"]
  try:
      from psyco import _psyco
--- 17,20 ----
***************
*** 30,37 ****
  
  if sys.platform == "win32":
!     symbollister = r'dumpbin.exe /exports "%s"'
!     # must have run vcvars.bat before.
!     # popen will not work with spaces in paths
!     re_symbolentry = re.compile(r'\s+[0-9a-fA-F]+\s+[0-9a-fA-F]+\s([0-9a-fA-F]+)\s(.*)')
  
  re_addr = re.compile(r'[\s,$]0x([0-9a-fA-F]+)')
--- 28,68 ----
  
  if sys.platform == "win32":
!     # no way to get full info into the executables by
!     # VC7. /PDB:NONE no longer supported.
!     # so we have to read the map files.
!     buildpath = r"d:/slpdev/src/2.3/dev/PCbuild"
!     symbolfiles = [os.path.join(buildpath, x) for x in ("python23.map", "_psyco.map")]
!     class symbollister:
!         def __init__(self, filename):
!             self.file = file(filename)
!             self.generator = self._readline()
! 
!         def _readline(self):
!             for line in self.file:
!                 #  0001:000661e0       _PyEval_CallFunction       1e0671e0 f   modsupport.obj
!                 #  0003:0000e770       _PyClass_Type              1e0d8770     classobject.obj
!                 pieces = line.split()
!                 if len(pieces) == 5:
!                     colonadr, name, adr, dummy, obj = pieces
!                 elif len(pieces) == 4:
!                     colonadr, name, adr, obj = pieces
!                     dummy = "d"
!                 else:
!                     continue
!                 if colonadr.count(":") == 1 and obj.endswith(".obj"):
!                     yield "%s %s %s\n" % (adr, dummy, name[1:])
! 
!         def readline(self):
!             try:
!                 return self.generator.next()
!             except StopIteration:
!                 return ""
! 
!         def close(self):
!             self.file.close()
!             
!         def __iter__(self):
!             return self.generator
! 
  
  re_addr = re.compile(r'[\s,$]0x([0-9a-fA-F]+)')
***************
*** 71,75 ****
  def load_symbol_file(filename, symb1, addr1):
      d = {}
!     g = os.popen(symbollister % filename, "r")
      while 1:
          line = g.readline()
--- 102,109 ----
  def load_symbol_file(filename, symb1, addr1):
      d = {}
!     if type(symbollister) is str:
!         g = os.popen(symbollister % filename, "r")
!     else:
!         g = symbollister(filename)
      while 1:
          line = g.readline()


_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins



More information about the Stackless-checkins mailing list