From nobody Wed Dec 25 14:16:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1507556517142699.0439693803786; Mon, 9 Oct 2017 06:41:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9E82421E7820D; Mon, 9 Oct 2017 06:38:28 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 6A13421DF9690 for ; Mon, 9 Oct 2017 06:38:27 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 06:41:36 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by fmsmga004.fm.intel.com with ESMTP; 09 Oct 2017 06:41:35 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,500,1500966000"; d="scan'208";a="321164337" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Mon, 9 Oct 2017 21:41:31 +0800 Message-Id: <1507556491-16376-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Fix the bug 'DSC DEFAULT' in report wrongly use FDF value X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" current the PCD value in DSC file may be override by FDF file, then it cause the 'DSC DEFAULT' in build report wrongly display the FDF value but not the DSC file's value. This patch add a attribute DscDefaultValue for PcdClassObject to save the actual DSC file's PCD value and use this value to display for 'DSC DEFAULT'. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 7 +++++-- .../Source/Python/Workspace/WorkspaceDatabase.py | 19 +++++++++------= ---- BaseTools/Source/Python/build/BuildReport.py | 7 ++++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index ea26e5e..5fa497b 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -1,9 +1,9 @@ ## @file # This file is used to define each component of the build database # -# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may b= e found at # http://opensource.org/licenses/bsd-license.php # @@ -42,11 +42,11 @@ from Common.BuildToolError import * # @var SkuInfoList: To store value for SkuInfoList # @var IsOverrided: To store value for IsOverrided # @var Phase: To store value for Phase, default is "DXE" # class PcdClassObject(object): - def __init__(self, Name =3D None, Guid =3D None, Type =3D None, DatumT= ype =3D None, Value =3D None, Token =3D None, MaxDatumSize =3D None, SkuInf= oList =3D {}, IsOverrided =3D False, GuidValue =3D None, validateranges =3D= [], validlists =3D [], expressions =3D []): + def __init__(self, Name =3D None, Guid =3D None, Type =3D None, DatumT= ype =3D None, Value =3D None, Token =3D None, MaxDatumSize =3D None, SkuInf= oList =3D {}, IsOverrided =3D False, GuidValue =3D None, validateranges =3D= [], validlists =3D [], expressions =3D [], IsDsc =3D False): self.TokenCName =3D Name self.TokenSpaceGuidCName =3D Guid self.TokenSpaceGuidValue =3D GuidValue self.Type =3D Type self.DatumType =3D DatumType @@ -60,10 +60,13 @@ class PcdClassObject(object): self.IsFromBinaryInf =3D False self.IsFromDsc =3D False self.validateranges =3D validateranges self.validlists =3D validlists self.expressions =3D expressions + self.DscDefaultValue =3D None + if IsDsc: + self.DscDefaultValue =3D Value =20 ## Convert the class to a string # # Convert each member of the class to string # Organize to a signle line format string diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseT= ools/Source/Python/Workspace/WorkspaceDatabase.py index b617221..2c4b973 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -883,12 +883,12 @@ class DscBuildData(PlatformBuildClassObject): PcdValue, '', MaxDatumSize, {}, False, - None - ) + None, + IsDsc=3DTrue) return Pcds =20 ## Retrieve dynamic PCD settings # # @param Type PCD type @@ -948,13 +948,13 @@ class DscBuildData(PlatformBuildClassObject): PcdValue, '', MaxDatumSize, {SkuName : SkuInfo}, False, - None - ) - =20 + None, + IsDsc=3DTrue) + for pcd in Pcds.values(): pcdDecObject =3D self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGu= idCName] if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in= pcd.SkuInfoList.keys(): =20 valuefromDec =3D pcdDecObject.DefaultValue SkuInfo =3D SkuInfoClass('DEFAULT', '0', '', '', '', '', '= ', valuefromDec) @@ -1067,13 +1067,12 @@ class DscBuildData(PlatformBuildClassObject): {SkuName : SkuInfo}, False, None, pcdDecObject.validaterange= s, pcdDecObject.validlists, - pcdDecObject.expressions - ) - =20 + pcdDecObject.expressions, + IsDsc=3DTrue) =20 for pcd in Pcds.values(): SkuInfoObj =3D pcd.SkuInfoList.values()[0] pcdDecObject =3D self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGu= idCName] # Only fix the value while no value provided in DSC file. @@ -1177,12 +1176,12 @@ class DscBuildData(PlatformBuildClassObject): InitialValue, '', MaxDatumSize, {SkuName : SkuInfo}, False, - None - ) + None, + IsDsc=3DTrue) for pcd in Pcds.values(): SkuInfoObj =3D pcd.SkuInfoList.values()[0] pcdDecObject =3D self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGu= idCName] if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in= pcd.SkuInfoList.keys(): valuefromDec =3D pcdDecObject.DefaultValue diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index f0e9093..6a4d7e0 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -831,11 +831,11 @@ class PcdReport(object): # self.DscPcdDefault =3D {} for Arch in Wa.ArchList: Platform =3D Wa.BuildDatabase[Wa.MetaFile, Arch, Wa.BuildTarge= t, Wa.ToolChain] for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds: - DscDefaultValue =3D Platform.Pcds[(TokenCName, TokenSpaceG= uidCName)].DefaultValue + DscDefaultValue =3D Platform.Pcds[(TokenCName, TokenSpaceG= uidCName)].DscDefaultValue if DscDefaultValue: self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = =3D DscDefaultValue =20 def GenerateReport(self, File, ModulePcdSet): if self.ConditionalPcds: @@ -912,10 +912,11 @@ class PcdReport(object): # # Get PCD default value and their override relationship # DecDefaultValue =3D self.DecPcdDefault.get((Pcd.TokenC= Name, Pcd.TokenSpaceGuidCName, DecType)) DscDefaultValue =3D self.DscPcdDefault.get((Pcd.TokenC= Name, Pcd.TokenSpaceGuidCName)) + DscDefaultValBak=3D DscDefaultValue DscDefaultValue =3D self.FdfPcdSet.get((Pcd.TokenCName= , Key), DscDefaultValue) InfDefaultValue =3D None =20 PcdValue =3D DecDefaultValue if DscDefaultValue: @@ -998,12 +999,12 @@ class PcdReport(object): if TypeName in ('DYNHII', 'DEXHII'): FileWrite(File, '%*s: %s: %s' % (self.MaxL= en + 4, SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset)) else: FileWrite(File, '%*s' % (self.MaxLen + 4, = SkuInfo.VpdOffset)) =20 - if not DscMatch and DscDefaultValue !=3D None: - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + = 19, 'DSC DEFAULT', DscDefaultValue.strip())) + if not DscMatch and DscDefaultValBak !=3D None: + FileWrite(File, ' %*s =3D %s' % (self.MaxLen + = 19, 'DSC DEFAULT', DscDefaultValBak.strip())) =20 if not InfMatch and InfDefaultValue !=3D None: FileWrite(File, ' %*s =3D %s' % (self.MaxLen + = 19, 'INF DEFAULT', InfDefaultValue.strip())) =20 if not DecMatch and DecDefaultValue !=3D None: --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel