#\r
##\r
\r
+from __future__ import print_function\r
import os\r
import re\r
import sys\r
from optparse import OptionParser\r
\r
-versionNumber = "1.0"\r
+versionNumber = "1.1"\r
__copyright__ = "Copyright (c) 2016, Intel Corporation. All rights reserved."\r
\r
class Symbols:\r
try:\r
nmCommand = "nm"\r
nmLineOption = "-l"\r
- print "parsing (debug) - " + pdbName\r
+ print("parsing (debug) - " + pdbName)\r
os.system ('%s %s %s > nmDump.line.log' % (nmCommand, nmLineOption, pdbName))\r
except :\r
- print 'ERROR: nm command not available. Please verify PATH'\r
+ print('ERROR: nm command not available. Please verify PATH')\r
return\r
\r
#\r
linefile.close()\r
\r
# 000113ca T AllocatePool c:\home\edk-ii\MdePkg\Library\UefiMemoryAllocationLib\MemoryAllocationLib.c:399\r
- patchLineFileMatchString = "([0-9a-fA-F]{8})\s+[T|D|t|d]\s+(\w+)\s*((?:[a-zA-Z]:)?[\w+\-./_a-zA-Z0-9\\\\]*):?([0-9]*)"\r
+ patchLineFileMatchString = "([0-9a-fA-F]*)\s+[T|D|t|d]\s+(\w+)\s*((?:[a-zA-Z]:)?[\w+\-./_a-zA-Z0-9\\\\]*):?([0-9]*)"\r
\r
for reportLine in reportLines:\r
#print "check - " + reportLine\r
DIA2DumpCommand = "Dia2Dump.exe"\r
#DIA2SymbolOption = "-p"\r
DIA2LinesOption = "-l"\r
- print "parsing (pdb) - " + pdbName\r
+ print("parsing (pdb) - " + pdbName)\r
#os.system ('%s %s %s > DIA2Dump.symbol.log' % (DIA2DumpCommand, DIA2SymbolOption, pdbName))\r
os.system ('%s %s %s > DIA2Dump.line.log' % (DIA2DumpCommand, DIA2LinesOption, pdbName))\r
except :\r
- print 'ERROR: DIA2Dump command not available. Please verify PATH'\r
+ print('ERROR: DIA2Dump command not available. Please verify PATH')\r
return\r
\r
#\r
\r
driverPrefixLen = len("Driver - ")\r
# get driver name\r
- if cmp(newline[0:driverPrefixLen],"Driver - ") == 0 :\r
+ if cmp(newline[0:driverPrefixLen], "Driver - ") == 0 :\r
driverlineList = newline.split(" ")\r
driverName = driverlineList[2]\r
#print "Checking : ", driverName\r
else :\r
symbolsFile.symbolsTable[driverName].parse_debug_file (driverName, pdbName)\r
\r
- elif cmp(newline,"") == 0 :\r
+ elif cmp(newline, "") == 0 :\r
driverName = ""\r
\r
# check entry line\r
rvaName = ""\r
symbolName = ""\r
\r
- if cmp(rvaName,"") == 0 :\r
+ if cmp(rvaName, "") == 0 :\r
return newline\r
else :\r
return newline + symbolName\r
try :\r
file = open(Options.inputfilename)\r
except Exception:\r
- print "fail to open " + Options.inputfilename\r
+ print("fail to open " + Options.inputfilename)\r
return 1\r
try :\r
newfile = open(Options.outputfilename, "w")\r
except Exception:\r
- print "fail to open " + Options.outputfilename\r
+ print("fail to open " + Options.outputfilename)\r
return 1\r
\r
try:\r
- while 1:\r
+ while True:\r
line = file.readline()\r
if not line:\r
break\r