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.20; helo=mga02.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 F409E21165245 for ; Thu, 11 Oct 2018 00:06:19 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 00:06:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,367,1534834800"; d="scan'208";a="240392466" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.127]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2018 00:06:18 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Thu, 11 Oct 2018 15:06:16 +0800 Message-Id: <1539241576-10044-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Enhance the *P Flag display for Structure Pcd 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: Thu, 11 Oct 2018 07:06:20 -0000 Cover the case: 1.only define the structure Pcd in DEC file, it should not have any Flag. 2.In the DEC file and DSC file only have the PCD's default value, and without the field value, it should have *P Flag. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/build/BuildReport.py | 66 ++++++++++++++++------------ 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index feaf6a5..031594b 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1071,41 +1071,52 @@ class PcdReport(object): if Pcd.PcdFieldValueFromComm: BuildOptionMatch = True DecMatch = False elif Pcd.SkuOverrideValues: DscOverride = False - if not Pcd.SkuInfoList: - OverrideValues = Pcd.SkuOverrideValues - if OverrideValues: - Keys = list(OverrideValues.keys()) - Data = OverrideValues[Keys[0]] - Struct = list(Data.values())[0] - DscOverride = self.ParseStruct(Struct) + if Pcd.DefaultFromDSC: + DscOverride = True else: - SkuList = sorted(Pcd.SkuInfoList.keys()) - for Sku in SkuList: - SkuInfo = Pcd.SkuInfoList[Sku] - if TypeName in ('DYNHII', 'DEXHII'): - if SkuInfo.DefaultStoreDict: - DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys()) - for DefaultStore in DefaultStoreList: - OverrideValues = Pcd.SkuOverrideValues[Sku] - DscOverride = self.ParseStruct(OverrideValues[DefaultStore]) - if DscOverride: - break - else: - OverrideValues = Pcd.SkuOverrideValues[Sku] + DictLen = 0 + for item in Pcd.SkuOverrideValues: + DictLen += len(Pcd.SkuOverrideValues[item]) + if not DictLen: + DscOverride = False + else: + if not Pcd.SkuInfoList: + OverrideValues = Pcd.SkuOverrideValues if OverrideValues: Keys = list(OverrideValues.keys()) - OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]]) - DscOverride = self.ParseStruct(OverrideFieldStruct) - if DscOverride: - break + Data = OverrideValues[Keys[0]] + Struct = list(Data.values()) + DscOverride = self.ParseStruct(Struct[0]) + else: + SkuList = sorted(Pcd.SkuInfoList.keys()) + for Sku in SkuList: + SkuInfo = Pcd.SkuInfoList[Sku] + if TypeName in ('DYNHII', 'DEXHII'): + if SkuInfo.DefaultStoreDict: + DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys()) + for DefaultStore in DefaultStoreList: + OverrideValues = Pcd.SkuOverrideValues[Sku] + DscOverride = self.ParseStruct(OverrideValues[DefaultStore]) + if DscOverride: + break + else: + OverrideValues = Pcd.SkuOverrideValues[Sku] + if OverrideValues: + Keys = list(OverrideValues.keys()) + OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]]) + DscOverride = self.ParseStruct(OverrideFieldStruct) + if DscOverride: + break if DscOverride: DscDefaultValue = True DscMatch = True DecMatch = False + else: + DecMatch = True else: DscDefaultValue = True DscMatch = True DecMatch = False @@ -1250,13 +1261,14 @@ class PcdReport(object): if IsStructure: OverrideValues = Pcd.SkuOverrideValues if OverrideValues: Keys = list(OverrideValues.keys()) Data = OverrideValues[Keys[0]] - Struct = list(Data.values())[0] - OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct) - self.PrintStructureInfo(File, OverrideFieldStruct) + Struct = list(Data.values()) + if Struct: + OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0]) + self.PrintStructureInfo(File, OverrideFieldStruct) self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) else: FirstPrint = True SkuList = sorted(Pcd.SkuInfoList.keys()) for Sku in SkuList: -- 2.6.1.windows.1