Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1. Fixed escape character issue
2. Added host and python information in message for better debug

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1290 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jwang36 committed Jul 28, 2008
1 parent 7d650cd commit e832ad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Source/Python/AutoGen/GenC.py
Expand Up @@ -840,7 +840,8 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
Unicode = False
if Value[0] == 'L':
Unicode = True
Value = Value.lstrip('L').strip('"')
Value = Value.lstrip('L') #.strip('"')
Value = eval(Value) # translate escape character
NewValue = '{'
for Index in range(0,len(Value)):
NewValue = NewValue + str(ord(Value[Index]) % 0x100) + ', '
Expand Down
9 changes: 5 additions & 4 deletions Source/Python/build/build.py
Expand Up @@ -20,6 +20,7 @@
import sys
import glob
import time
import platform
import traceback

from threading import *
Expand Down Expand Up @@ -1223,7 +1224,7 @@ def Main():
if Option.WarningAsError == True:
EdkLogger.SetWarningAsError()

EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")
EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[%s]\n" % platform.platform())
ReturnCode = 0
MyBuild = None
try:
Expand Down Expand Up @@ -1277,7 +1278,7 @@ def Main():
# for multi-thread build exits safely
MyBuild.Relinquish()
if Option != None and Option.debug != None:
EdkLogger.quiet(traceback.format_exc())
EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
ReturnCode = X.args[0]
except Warning, X:
# error from Fdf parser
Expand All @@ -1286,7 +1287,7 @@ def Main():
# for multi-thread build exits safely
MyBuild.Relinquish()
if Option != None and Option.debug != None:
EdkLogger.quiet(traceback.format_exc())
EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
else:
EdkLogger.error(X.ToolName, FORMAT_INVALID, File=X.FileName, Line=X.LineNumber, ExtraData=X.Message, RaiseError = False)
ReturnCode = FORMAT_INVALID
Expand All @@ -1304,7 +1305,7 @@ def Main():
ExtraData="Please send email to dev@buildtools.tianocore.org for help, attaching following call stack trace!\n",
RaiseError=False
)
EdkLogger.quiet(traceback.format_exc())
EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
ReturnCode = CODE_ERROR
finally:
Utils.Progressor.Abort()
Expand Down

0 comments on commit e832ad3

Please sign in to comment.