From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5670A21E256AB for ; Thu, 25 Jan 2018 02:00:53 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 02:06:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,411,1511856000"; d="scan'208";a="13365944" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 25 Jan 2018 02:06:22 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 02:06:22 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 02:06:21 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Thu, 25 Jan 2018 18:06:19 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTool: Fixed the StructurePcd incorrect value. Thread-Index: AQHTlbAWKnts2ANhBkGc7tmpeSm/jKOEXN7Q Date: Thu, 25 Jan 2018 10:06:18 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1AC737@SHSMSX104.ccr.corp.intel.com> References: <20180125074225.17072-1-bob.c.feng@intel.com> In-Reply-To: <20180125074225.17072-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTool: Fixed the StructurePcd incorrect value. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 10:00:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Thursday, January 25, 2018 3:42 PM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTool: Fixed the StructurePcd incorrect value. > >If user not set Structure overall value in Dsc, >Structure Pcd value would be incorrect. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/Workspace/BuildClassObject.py | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py >b/BaseTools/Source/Python/Workspace/BuildClassObject.py >index e5f1f01556..947ac1f466 100644 >--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py >+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py >@@ -65,11 +65,11 @@ class PcdClassObject(object): > self.validlists =3D validlists > self.expressions =3D expressions > self.DscDefaultValue =3D None > if IsDsc: > self.DscDefaultValue =3D Value >- >+ > ## Convert the class to a string > # > # Convert each member of the class to string > # Organize to a signle line format string > # >@@ -107,11 +107,15 @@ class PcdClassObject(object): > # > def __hash__(self): > return hash((self.TokenCName, self.TokenSpaceGuidCName)) > > class StructurePcd(PcdClassObject): >- def __init__(self, StructuredPcdIncludeFile=3D"", Packages=3DNone, >Name=3DNone, Guid=3DNone, Type=3DNone, DatumType=3DNone, Value=3DNone, >Token=3DNone, MaxDatumSize=3DNone, SkuInfoList=3D{}, IsOverrided=3DFalse, >GuidValue=3DNone, validateranges=3D[], validlists=3D[], >expressions=3D[],default_store =3D TAB_DEFAULT_STORES_DEFAULT): >+ def __init__(self, StructuredPcdIncludeFile=3DNone, Packages=3DNone, >Name=3DNone, Guid=3DNone, Type=3DNone, DatumType=3DNone, Value=3DNone, >Token=3DNone, MaxDatumSize=3DNone, SkuInfoList=3DNone, IsOverrided=3DFalse= , >GuidValue=3DNone, validateranges=3DNone, validlists=3DNone, >expressions=3DNone,default_store =3D TAB_DEFAULT_STORES_DEFAULT): >+ if SkuInfoList is None: SkuInfoList=3D{} >+ if validateranges is None: validateranges=3D[] >+ if validlists is None: validlists=3D[] >+ if expressions is None : expressions=3D[] > super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, V= alue, >Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, >validlists, expressions) > self.StructuredPcdIncludeFile =3D StructuredPcdIncludeFile > self.PackageDecs =3D Packages > self.DefaultStoreName =3D [default_store] > self.DefaultValues =3D collections.OrderedDict({}) >@@ -435,6 +439,5 @@ class PlatformBuildClassObject(object): > # > # @retval string Key for hash table > # > def __hash__(self): > return hash(self.MetaFile) >- >-- >2.14.3.windows.1