summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-02-07 16:05:13 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-02-08 13:36:03 +0800
commitd03c056b2946cc2f83b6d206297915dadc08f230 (patch)
tree515a61272f9642d34bcbfbe2bfb892af3f95131f /BaseTools
parenta316d7ac91d302085b5c35d76db703f2208ec026 (diff)
downloadedk2-d03c056b2946cc2f83b6d206297915dadc08f230.zip
edk2-d03c056b2946cc2f83b6d206297915dadc08f230.tar.gz
edk2-d03c056b2946cc2f83b6d206297915dadc08f230.tar.bz2
BaseTools: Fix the bug to parse the short varname in map file
current in the map file, there have two ways for var to save its offset, if the varname is short, then the offset will in the same line with varname, otherwise, it saved in the next line. 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')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 43d0818..1a5968a 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1,7 +1,7 @@
## @file
# Common routines used by all tools
#
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -93,10 +93,16 @@ def _parseForGCC(lines, efifilepath, varnames):
if m != None:
sections.append(m.groups(0))
for varname in varnames:
- m = re.match(".data.(%s)$" % varname, line)
+ Str = ''
+ m = re.match("^.data.(%s)" % varname, line)
if m != None:
- if lines[index + 1]:
- m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', lines[index + 1].strip())
+ m = re.match(".data.(%s)$" % varname, line)
+ if m != None:
+ Str = lines[index + 1]
+ else:
+ Str = line[len(".data.%s" % varname):]
+ if Str:
+ m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', Str.strip())
if m != None:
varoffset.append((varname, int(m.groups(0)[0], 16) , int(sections[-1][1], 16), sections[-1][0]))