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.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 89E7021EA15CC for ; Tue, 10 Oct 2017 21:44:42 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 10 Oct 2017 21:48:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="159158959" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 10 Oct 2017 21:48:10 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Oct 2017 21:48:10 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Oct 2017 21:48:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Wed, 11 Oct 2017 12:48:07 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix the bug 'DSC DEFAULT' in report wrongly use FDF value Thread-Index: AQHTQQO2KHlI7EHTlku9+mud1oEJkKLeFjfw Date: Wed, 11 Oct 2017 04:48:07 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E169BBA@SHSMSX104.ccr.corp.intel.com> References: <1507556220-19680-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1507556220-19680-1-git-send-email-yonghong.zhu@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] 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: , X-List-Received-Date: Wed, 11 Oct 2017 04:44:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Monday, October 09, 2017 9:37 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: Fix the bug 'DSC DEFAULT' in report wrongly us= e >FDF value > >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/BaseTools/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 B= SD >License > # which accompanies this distribution. The full text of the license may = be >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, Datum= Type =3D >None, Value =3D None, Token =3D None, MaxDatumSize =3D None, SkuInfoList = =3D {}, >IsOverrided =3D False, GuidValue =3D None, validateranges =3D [], validlis= ts =3D [], >expressions =3D []): >+ def __init__(self, Name =3D None, Guid =3D None, Type =3D None, Datum= Type =3D >None, Value =3D None, Token =3D None, MaxDatumSize =3D None, SkuInfoList = =3D {}, >IsOverrided =3D False, GuidValue =3D None, validateranges =3D [], validlis= ts =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 > > ## 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/BaseTools/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 > > ## Retrieve dynamic PCD settings > # > # @param Type PCD type >@@ -948,13 +948,13 @@ class DscBuildData(PlatformBuildClassObject): > PcdValue, > '', > MaxDatumSize, > {SkuName : SkuInfo}, > False, >- None >- ) >- >+ None, >+ IsDsc=3DTrue) >+ > for pcd in Pcds.values(): > pcdDecObject =3D >self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName] > if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not i= n >pcd.SkuInfoList.keys(): > valuefromDec =3D pcdDecObject.DefaultValue > SkuInfo =3D SkuInfoClass('DEFAULT', '0', '', '', '', '', = '', valuefromDec) >@@ -1067,13 +1067,12 @@ class DscBuildData(PlatformBuildClassObject): > {SkuName : SkuInfo}, > False, > None, > pcdDecObject.validaterang= es, > pcdDecObject.validlists, >- pcdDecObject.expressions >- ) >- >+ pcdDecObject.expressions, >+ IsDsc=3DTrue) > > for pcd in Pcds.values(): > SkuInfoObj =3D pcd.SkuInfoList.values()[0] > pcdDecObject =3D >self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName] > # 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.TokenSpaceGuidCName] > if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not i= n >pcd.SkuInfoList.keys(): > valuefromDec =3D pcdDecObject.DefaultValue >diff --git a/BaseTools/Source/Python/build/BuildReport.py >b/BaseTools/Source/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.BuildTarg= et, >Wa.ToolChain] > for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds: >- DscDefaultValue =3D Platform.Pcds[(TokenCName, >TokenSpaceGuidCName)].DefaultValue >+ DscDefaultValue =3D Platform.Pcds[(TokenCName, >TokenSpaceGuidCName)].DscDefaultValue > if DscDefaultValue: > self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)]= =3D >DscDefaultValue > > def GenerateReport(self, File, ModulePcdSet): > if self.ConditionalPcds: >@@ -912,10 +912,11 @@ class PcdReport(object): > # > # Get PCD default value and their override relationsh= ip > # > DecDefaultValue =3D self.DecPcdDefault.get((Pcd.Token= CName, >Pcd.TokenSpaceGuidCName, DecType)) > DscDefaultValue =3D self.DscPcdDefault.get((Pcd.Token= CName, >Pcd.TokenSpaceGuidCName)) >+ DscDefaultValBak=3D DscDefaultValue > DscDefaultValue =3D self.FdfPcdSet.get((Pcd.TokenCNam= e, Key), >DscDefaultValue) > InfDefaultValue =3D None > > PcdValue =3D DecDefaultValue > if DscDefaultValue: >@@ -998,12 +999,12 @@ class PcdReport(object): > if TypeName in ('DYNHII', 'DEXHII'): > FileWrite(File, '%*s: %s: %s' % (self.Max= Len + 4, >SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset)) > else: > FileWrite(File, '%*s' % (self.MaxLen + 4,= SkuInfo.VpdOffset)) > >- 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())) > > if not InfMatch and InfDefaultValue !=3D None: > FileWrite(File, ' %*s =3D %s' % (self.MaxLen += 19, 'INF DEFAULT', >InfDefaultValue.strip())) > > if not DecMatch and DecDefaultValue !=3D None: >-- >2.6.1.windows.1