From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 1E82B21164EF8 for ; Wed, 24 Oct 2018 00:30:50 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 00:30:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,419,1534834800"; d="scan'208";a="90794380" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2018 00:30:50 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Oct 2018 00:30:49 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Oct 2018 00:30:49 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.102]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.161]) with mapi id 14.03.0415.000; Wed, 24 Oct 2018 15:30:47 +0800 From: "Feng, Bob C" To: "Zhao, ZhiqiangX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH] BaseTools: Not convert the void* pcd string in command line to array. Thread-Index: AQHUae6eMTDyD0rnfEGUX3CpRnv+/KUuAwCA Date: Wed, 24 Oct 2018 07:30:46 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D15FFE5FAD@SHSMSX101.ccr.corp.intel.com> References: <20181022100404.91472-1-zhiqiangx.zhao@intel.com> In-Reply-To: <20181022100404.91472-1-zhiqiangx.zhao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzczMDQ4ODgtZDJlNy00MTE4LWFhNzgtNzJjNTI4NzY5NzkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiV053YXZsZnFYZEFOWWRSQkVRZWZIU0taSEg5VnZWSkVoUVFHcW9jMUlLSVpjSXR2OFBtb1dQdENqU2UyUlA3ZCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools: Not convert the void* pcd string in command line to array. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 07:30:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Zhao, ZhiqiangX=20 Sent: Monday, October 22, 2018 6:04 PM To: edk2-devel@lists.01.org Cc: Zhao, ZhiqiangX ; Gao, Liming ; Zhu, Yonghong ; Feng, Bob C Subject: [PATCH] BaseTools: Not convert the void* pcd string in command lin= e to array. For void* type pcd in command line, if its value is string, code should not= convert the void* pcd string in command line to array, otherwise it will m= ake the pcd value in report not match its real raw value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 38 +++++--------------= ---- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 804f579f5c..15d9706e35 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1168,7 +1168,7 @@ class PlatformAutoGen(AutoGen): VariableGuidStructure =3D Sku.VariableGuidValue VariableGuid =3D GuidStructureStringToGuidString(Varia= bleGuidStructure) for StorageName in Sku.DefaultStoreDict: - VariableInfo.append_variable(var_info(Index, pcdna= me, StorageName, SkuName, StringToArray(Sku.VariableName), VariableGuid, Sk= u.VariableOffset, Sku.VariableAttribute, Sku.HiiDefaultValue, Sku.DefaultSt= oreDict[StorageName], Pcd.DatumType, Pcd.CustomAttribute['DscPosition'], Pc= d.CustomAttribute.get('IsStru',False))) + VariableInfo.append_variable(var_info(Index,=20 + pcdname, StorageName, SkuName, StringToArray(Sku.VariableName),=20 + VariableGuid, Sku.VariableOffset, Sku.VariableAttribute,=20 + Sku.HiiDefaultValue, Sku.DefaultStoreDict[StorageName] if=20 + Pcd.DatumType in TAB_PCD_NUMERIC_TYPES else=20 + StringToArray(Sku.DefaultStoreDict[StorageName]), Pcd.DatumType,=20 + Pcd.CustomAttribute['DscPosition'],=20 + Pcd.CustomAttribute.get('IsStru',False))) Index +=3D 1 return VariableInfo =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index b0e88a93ce..7ae2ff0683 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1307,29 +1307,16 @@ class DscBuildData(PlatformBuildClassObject): if isinstance(self._DecPcds.get((Pcd.TokenCName, Pcd.Token= SpaceGuidCName), None), StructurePcd): self._DecPcds.get((Pcd.TokenCName, Pcd.TokenSpaceGuidC= Name)).PcdValueFromComm =3D NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.Tok= enCName)][0] else: - if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: - Pcd.PcdValueFromComm =3D NoFiledValues[(Pcd.TokenS= paceGuidCName, Pcd.TokenCName)][0] - Pcd.DefaultValue =3D NoFiledValues[(Pcd.TokenSpace= GuidCName, Pcd.TokenCName)][0] - else: - Pcd.PcdValueFromComm =3D StringToArray(NoFiledValu= es[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]) - Pcd.DefaultValue =3D StringToArray(NoFiledValues[(= Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]) + Pcd.PcdValueFromComm =3D NoFiledValues[(Pcd.TokenSpace= GuidCName, Pcd.TokenCName)][0] + Pcd.DefaultValue =3D=20 + NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] for sku in Pcd.SkuInfoList: SkuInfo =3D Pcd.SkuInfoList[sku] if SkuInfo.DefaultValue: - if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: - SkuInfo.DefaultValue =3D NoFiledValues[(Pc= d.TokenSpaceGuidCName, Pcd.TokenCName)][0] - else: - SkuInfo.DefaultValue =3D StringToArray(NoF= iledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]) + SkuInfo.DefaultValue =3D=20 + NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] else: - if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: - SkuInfo.HiiDefaultValue =3D NoFiledValues[= (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] - else: - SkuInfo.HiiDefaultValue =3D StringToArray(= NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]) + SkuInfo.HiiDefaultValue =3D=20 + NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] for defaultstore in SkuInfo.DefaultStoreDict: - if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: - SkuInfo.DefaultStoreDict[defaultstore]= =3D NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] - else: - SkuInfo.DefaultStoreDict[defaultstore]= =3D StringToArray(NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)]= [0]) + SkuInfo.DefaultStoreDict[defaultstore]=20 + =3D NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0] if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAM= IC_EX_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII]]: if Pcd.DatumType =3D=3D TAB_VOID: if not Pcd.MaxDatumSize: @@ -1341,26 +1328,17 @@ class DscBuildData(PlatformBuildClassObject): else: PcdInDec =3D self.DecPcds.get((Name, Guid)) if PcdInDec: - if PcdInDec.DatumType in TAB_PCD_NUMERIC_TYPES: - PcdInDec.PcdValueFromComm =3D NoFiledValues[(Guid,= Name)][0] - else: - PcdInDec.PcdValueFromComm =3D StringToArray(NoFile= dValues[(Guid, Name)][0]) + PcdInDec.PcdValueFromComm =3D NoFiledValues[(Guid,=20 + Name)][0] if PcdInDec.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_= FIXED_AT_BUILD], self._PCD_TYPE_STRING_[MODEL_PCD_P= ATCHABLE_IN_MODULE], self._PCD_TYPE_STRING_[MODEL_PCD_F= EATURE_FLAG], self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC], self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX]]: self.Pcds[Name, Guid] =3D copy.deepcopy(PcdInDec) - if PcdInDec.DatumType in TAB_PCD_NUMERIC_TYPES: - self.Pcds[Name, Guid].DefaultValue =3D NoFiled= Values[( Guid, Name)][0] - else: - self.Pcds[Name, Guid].DefaultValue =3D StringT= oArray(NoFiledValues[( Guid, Name)][0]) + self.Pcds[Name, Guid].DefaultValue =3D=20 + NoFiledValues[( Guid, Name)][0] if PcdInDec.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_= DYNAMIC], self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX]]: - if PcdInDec.DatumType in TAB_PCD_NUMERIC_TYPES: - self.Pcds[Name, Guid].SkuInfoList =3D {TAB_DEF= AULT:SkuInfoClass(TAB_DEFAULT, self.SkuIds[TAB_DEFAULT][0], '', '', '', '',= '', NoFiledValues[( Guid, Name)][0])} - else: - self.Pcds[Name, Guid].SkuInfoList =3D {TAB_DEF= AULT:SkuInfoClass(TAB_DEFAULT, self.SkuIds[TAB_DEFAULT][0], '', '', '', '',= '', StringToArray(NoFiledValues[( Guid, Name)][0]))} + self.Pcds[Name, Guid].SkuInfoList =3D=20 + {TAB_DEFAULT:SkuInfoClass(TAB_DEFAULT, self.SkuIds[TAB_DEFAULT][0],=20 + '', '', '', '', '', NoFiledValues[( Guid, Name)][0])} return AllPcds =20 def OverrideByFdfOverAll(self,AllPcds): -- 2.14.1.windows.1