]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
BaseTools: Enhance BaseTools supports FixedAtBuild usage in VFR file
[mirror_edk2.git] / BaseTools / Source / Python / GenPatchPcdTable / GenPatchPcdTable.py
index 59bc7c4c3e29f015620d8540c53dcb3bd63bb9ad..4452fac0406460556197a3c4aa6ec09cf213f41d 100644 (file)
@@ -5,7 +5,7 @@
 #    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
@@ -37,7 +37,7 @@ __copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserv
 \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
@@ -66,7 +66,7 @@ def _parseForGCC(lines, efifilepath):
     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
@@ -80,14 +80,18 @@ def _parseForGCC(lines, efifilepath):
             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