From 5cef92771fb966b6ebe5eccbd97c2127c091b4e9 Mon Sep 17 00:00:00 2001 From: Zhiguang Liu Date: Tue, 29 Oct 2019 13:07:44 +0800 Subject: BaseTools: Add map file parsing support for CLANG9 Cc: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao Signed-off-by: Zhiguang Liu --- BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/GenPatchPcdTable') diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py index 7d5e4fc34a..d962ab0add 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py @@ -49,20 +49,23 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath): if len(lines) == 0: return None firstline = lines[0].strip() + if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline): + return _parseForXcodeAndClang9(lines, efifilepath) if (firstline.startswith("Archive member included ") and firstline.endswith(" file (symbol)")): return _parseForGCC(lines, efifilepath) if firstline.startswith("# Path:"): - return _parseForXcode(lines, efifilepath) + return _parseForXcodeAndClang9(lines, efifilepath) return _parseGeneral(lines, efifilepath) -def _parseForXcode(lines, efifilepath): +def _parseForXcodeAndClang9(lines, efifilepath): valuePattern = re.compile('^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))') status = 0 pcds = [] for line in lines: line = line.strip() - if status == 0 and line == "# Symbols:": + if status == 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \ + or line == "# Symbols:"): status = 1 continue if status == 1 and len(line) != 0: -- cgit v1.2.3