From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Thu, 19 Sep 2019 01:26:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 01:26:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,522,1559545200"; d="scan'208";a="362448195" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 19 Sep 2019 01:26:40 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 01:26:40 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0439.000; Thu, 19 Sep 2019 16:26:38 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH] BaseTools:Change the way that get some VpdPcd information Thread-Topic: [PATCH] BaseTools:Change the way that get some VpdPcd information Thread-Index: AdVuBYXcIIUjTKvDS9COF4MjDC1lMAAvmMQg Date: Thu, 19 Sep 2019 08:26:38 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1615371DF@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Wednesday, September 18, 2019 5:43 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH] BaseTools:Change the way that get some VpdPcd information BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2201 An error occurs using special VpdPcd that is not used in the Inf file In dsc: [PcdsDynamicExVpd.common.DEFAULT] gBoardModuleTokenSpaceGuid.test1|*|{CODE({ {0x0} // terminator })} In dec: [PcdsDynamicEx] # Vpd GPIO table gBoardModuleTokenSpaceGuid.test1|{0}|GPIO_INIT_CONFIG[]|0x50000018 { Library/GpioLib.h MdePkg/MdePkg.dec } ValueError: invalid literal for int() with base 0: '*' This Patch is going to fix issue by Change the way that get some VpdPcd inf= ormation Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/build/BuildReport.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 6b26f1c3b0..880459d367 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1419,10 +1419,19 @@ class PcdReport(object): FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.= VpdOffset)) VPDPcdItem =3D (Pcd.TokenSpaceGuidCName + '.' + Pc= dTokenCName, SkuIdName, SkuInfo.VpdOffset, Pcd.MaxDatumSize, SkuInfo.Defaul= tValue) if VPDPcdItem not in VPDPcdList: - VPDPcdList.append(VPDPcdItem) + PcdGuidList =3D self.UnusedPcds.get(Pcd.TokenS= paceGuidCName) + if PcdGuidList: + PcdList =3D PcdGuidList.get(Pcd.Type) + if not PcdList: + VPDPcdList.append(VPDPcdItem) + for VpdPcd in PcdList: + if PcdTokenCName =3D=3D VpdPcd.TokenCN= ame: + break + else: + VPDPcdList.append(VPDPcdItem) if IsStructure: FiledOverrideFlag =3D False - OverrideValues =3D Pcd.SkuOverrideValues[Sku] + OverrideValues =3D Pcd.SkuOverrideValues.get(Sku) if OverrideValues: Keys =3D list(OverrideValues.keys()) OverrideFieldStruct =3D self.OverrideFieldValu= e(Pcd, OverrideValues[Keys[0]]) -- 2.14.1.windows.1