]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse new Fv map file format
authorBob Feng <bob.c.feng@intel.com>
Fri, 13 Nov 2020 10:32:08 +0000 (18:32 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 19 Nov 2020 07:35:23 +0000 (07:35 +0000)
The commit 76e8aac158b0717fa27f12e4d008f79161ddb050 changed Fv map format.
It added the image type to better support source level debug. But it broke
the function of PatchFv.py because PatchFv.py also consume Fv map file.

This patch is to update PatchFv.py to make it work again.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Yunhua Feng <fengyunhua@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
IntelFsp2Pkg/Tools/PatchFv.py

index 0c8d908063154babdee8d5575a5443a8f71a63f8..112de4077a18eb95679d9e18fec75508d949993e 100644 (file)
@@ -361,9 +361,11 @@ class Symbols:
         foundModHdr = False\r
         while (rptLine != "" ):\r
             if rptLine[0] != ' ':\r
-                #DxeIpl (Fixed Flash Address, BaseAddress=0x00fffb4310, EntryPoint=0x00fffb4958)\r
-                #(GUID=86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseaddress=0x00fffb4398 .databaseaddress=0x00fffb4178)\r
-                match = re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-F]+)\)", rptLine)\r
+                #DxeIpl (Fixed Flash Address, BaseAddress=0x00fffb4310, EntryPoint=0x00fffb4958,Type=PE)\r
+                match = re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-F]+),\s*Type=\w+\)", rptLine)\r
+                if match is None:\r
+                    #DxeIpl (Fixed Flash Address, BaseAddress=0x00fffb4310, EntryPoint=0x00fffb4958)\r
+                    match = re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-F]+)\)", rptLine)\r
                 if match is not None:\r
                     foundModHdr = True\r
                     modName = match.group(1)\r
@@ -371,6 +373,7 @@ class Symbols:
                        modName = self.dictGuidNameXref[modName.upper()]\r
                     self.dictModBase['%s:BASE'  % modName] = int (match.group(2), 16)\r
                     self.dictModBase['%s:ENTRY' % modName] = int (match.group(3), 16)\r
+                #(GUID=86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseaddress=0x00fffb4398 .databaseaddress=0x00fffb4178)\r
                 match = re.match("\(GUID=([A-Z0-9\-]+)\s+\.textbaseaddress=(0x[0-9a-fA-F]+)\s+\.databaseaddress=(0x[0-9a-fA-F]+)\)", rptLine)\r
                 if match is not None:\r
                     if foundModHdr:\r