summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Common/Misc.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-11-30 16:02:21 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-12-02 11:01:24 +0800
commit3e7e8571da891122c6821ebc428ce6dbd8a35ff3 (patch)
tree1b32db90c468b859848ecda6713aacc6214f5180 /BaseTools/Source/Python/Common/Misc.py
parent31bf6304ba2dd97585c0170f0040ea48a6973746 (diff)
downloadedk2-platforms-3e7e8571da891122c6821ebc428ce6dbd8a35ff3.tar.xz
BaseTools: Fix the bug to parse the new map file format
Current the variable and Pcd format save in the map file is changed, so this patch is to support this new format. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 3be1f0f28b..43d08183f7 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -74,7 +74,7 @@ def _parseForGCC(lines, efifilepath, varnames):
status = 0
sections = []
varoffset = []
- for line in lines:
+ for index, line in enumerate(lines):
line = line.strip()
# status machine transection
if status == 0 and line == "Memory Configuration":
@@ -88,14 +88,17 @@ def _parseForGCC(lines, efifilepath, varnames):
continue
# status handler
- if status == 2:
+ if status == 3:
m = re.match('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$', line)
if m != None:
sections.append(m.groups(0))
for varname in varnames:
- m = re.match("^([\da-fA-Fx]+) +[_]*(%s)$" % varname, line)
+ m = re.match(".data.(%s)$" % varname, line)
if m != None:
- varoffset.append((varname, int(m.groups(0)[0], 16) , int(sections[-1][1], 16), sections[-1][0]))
+ if lines[index + 1]:
+ m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', lines[index + 1].strip())
+ if m != None:
+ varoffset.append((varname, int(m.groups(0)[0], 16) , int(sections[-1][1], 16), sections[-1][0]))
if not varoffset:
return []