# PCD Name Offset in binary\r
# ======== ================\r
#\r
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
\r
#============================================== Code ===============================================\r
secRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)', re.UNICODE)\r
-symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$]+) +([\da-fA-F]+)', re.UNICODE)\r
+symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+) +([\da-fA-F]+)', re.UNICODE)\r
\r
def parsePcdInfoFromMapFile(mapfilepath, efifilepath):\r
""" Parse map file to get binary patch pcd information \r
imageBase = -1\r
sections = []\r
bpcds = []\r
- for line in lines:\r
+ for index, line in enumerate(lines):\r
line = line.strip()\r
# status machine transection\r
if status == 0 and line == "Memory Configuration":\r
continue\r
\r
# status handler\r
- if status == 2:\r
+ if status == 3:\r
m = re.match('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$', line)\r
if m != None:\r
sections.append(m.groups(0))\r
- if status == 2:\r
- m = re.match("^([\da-fA-Fx]+) +[_]+gPcd_BinaryPatch_([\w_\d]+)$", line)\r
+ if status == 3:\r
+ m = re.match('^.data._gPcd_BinaryPatch_([\w_\d]+)$', line)\r
if m != None:\r
- bpcds.append((m.groups(0)[1], int(m.groups(0)[0], 16) , int(sections[-1][1], 16), sections[-1][0]))\r
+ if lines[index + 1]:\r
+ PcdName = m.groups(0)[0]\r
+ m = re.match('^([\da-fA-Fx]+) +([\da-fA-Fx]+)', lines[index + 1].strip())\r
+ if m != None:\r
+ bpcds.append((PcdName, int(m.groups(0)[0], 16) , int(sections[-1][1], 16), sections[-1][0]))\r
\r
# get section information from efi file\r
efisecs = PeImageClass(efifilepath).SectionHeaderList\r