From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.29186.1605493473526315545 for ; Sun, 15 Nov 2020 18:24:33 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: bob.c.feng@intel.com) IronPort-SDR: 9+bXPRdNj+wWVvoqY3O/u/7Q+W1j5kGScyWiMV+XVrJ5gsEOweKm+mY90/OCjB6dt4PePdqQxD 6sii+3Oahm2A== X-IronPort-AV: E=McAfee;i="6000,8403,9806"; a="255403903" X-IronPort-AV: E=Sophos;i="5.77,481,1596524400"; d="scan'208";a="255403903" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2020 18:24:32 -0800 IronPort-SDR: g5ukMaimA7nie37Db680Qu9ZoiTQRkIxfoHurSaLxSTGbq34msb1BHQri6Zwg38lVxq8mcejYC n0aEsDhiCmJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,481,1596524400"; d="scan'208";a="533258502" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.32]) by fmsmga005.fm.intel.com with ESMTP; 15 Nov 2020 18:24:30 -0800 From: "Bob Feng" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Star Zeng , Yunhua Feng , Zhiguang Liu Subject: [Patch V2] IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse new Fv map file format Date: Mon, 16 Nov 2020 10:24:22 +0800 Message-Id: <20201116022422.1597-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.29.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Cc: Yunhua Feng Cc: Zhiguang Liu ---=0D V2: Support both the old Fv map file format and new Fv map file format.=0D IntelFsp2Pkg/Tools/PatchFv.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 0c8d908063..112de4077a 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -359,20 +359,23 @@ class Symbols: rptLine =3D fdIn.readline()=0D modName =3D ""=0D foundModHdr =3D False=0D while (rptLine !=3D "" ):=0D if rptLine[0] !=3D ' ':=0D - #DxeIpl (Fixed Flash Address, BaseAddress=3D0x00fffb4310, = EntryPoint=3D0x00fffb4958)=0D - #(GUID=3D86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseadd= ress=3D0x00fffb4398 .databaseaddress=3D0x00fffb4178)=0D - match =3D re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=3D(= 0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+)\)", rptLine)=0D + #DxeIpl (Fixed Flash Address, BaseAddress=3D0x00fffb4310, = EntryPoint=3D0x00fffb4958,Type=3DPE)=0D + match =3D re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=3D(= 0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+),\s*Type=3D\w+\)", rptLine)= =0D + if match is None:=0D + #DxeIpl (Fixed Flash Address, BaseAddress=3D0x00fffb43= 10, EntryPoint=3D0x00fffb4958)=0D + match =3D re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress= =3D(0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+)\)", rptLine)=0D if match is not None:=0D foundModHdr =3D True=0D modName =3D match.group(1)=0D if len(modName) =3D=3D 36:=0D modName =3D self.dictGuidNameXref[modName.upper()]= =0D self.dictModBase['%s:BASE' % modName] =3D int (match.= group(2), 16)=0D self.dictModBase['%s:ENTRY' % modName] =3D int (match.= group(3), 16)=0D + #(GUID=3D86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseadd= ress=3D0x00fffb4398 .databaseaddress=3D0x00fffb4178)=0D match =3D re.match("\(GUID=3D([A-Z0-9\-]+)\s+\.textbaseadd= ress=3D(0x[0-9a-fA-F]+)\s+\.databaseaddress=3D(0x[0-9a-fA-F]+)\)", rptLine)= =0D if match is not None:=0D if foundModHdr:=0D foundModHdr =3D False=0D else:=0D --=20 2.29.1.windows.1