mirror of https://github.com/acidanthera/audk.git
BaseTools:Add extra debugging message
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2014 Add extra debugging to improve error identification. Error while processing file if the file is read incorrectly This patch is going to fix that issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
76912197fa
commit
307e1650be
|
@ -526,12 +526,16 @@ def SearchString(UniObjectClass, FileList, IsCompatibleMode):
|
|||
return UniObjectClass
|
||||
|
||||
for File in FileList:
|
||||
if os.path.isfile(File):
|
||||
Lines = open(File, 'r')
|
||||
for Line in Lines:
|
||||
for StrName in STRING_TOKEN.findall(Line):
|
||||
EdkLogger.debug(EdkLogger.DEBUG_5, "Found string identifier: " + StrName)
|
||||
UniObjectClass.SetStringReferenced(StrName)
|
||||
try:
|
||||
if os.path.isfile(File):
|
||||
Lines = open(File, 'r')
|
||||
for Line in Lines:
|
||||
for StrName in STRING_TOKEN.findall(Line):
|
||||
EdkLogger.debug(EdkLogger.DEBUG_5, "Found string identifier: " + StrName)
|
||||
UniObjectClass.SetStringReferenced(StrName)
|
||||
except:
|
||||
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "SearchString: Error while processing file", File=File, RaiseError=False)
|
||||
raise
|
||||
|
||||
UniObjectClass.ReToken()
|
||||
|
||||
|
|
|
@ -73,8 +73,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
|
|||
try:
|
||||
with open(Source, "r") as File:
|
||||
Lines = File.readlines()
|
||||
except:
|
||||
except IOError:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
|
||||
expect:
|
||||
EdkLogger.error("Trim", AUTOGEN_ERROR, "TrimPreprocessedFile: Error while processing file", File=Source)
|
||||
|
||||
PreprocessedFile = ""
|
||||
InjectedFile = ""
|
||||
|
|
Loading…
Reference in New Issue