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.151; helo=mga17.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 F02CF225892CF for ; Thu, 8 Mar 2018 21:12:41 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2018 21:18:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,443,1515484800"; d="scan'208";a="23219254" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga007.jf.intel.com with ESMTP; 08 Mar 2018 21:18:57 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Mar 2018 21:18:51 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Mar 2018 21:18:50 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by shsmsx102.ccr.corp.intel.com ([169.254.2.80]) with mapi id 14.03.0319.002; Fri, 9 Mar 2018 13:18:47 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch V2] BaseTools: Update --pcd parser to support flexible pcd format Thread-Index: AQHTt1+fKcLcM+Fg/0SeYyj/v+/rXaPHXWtA Date: Fri, 9 Mar 2018 05:18:47 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1E442E@SHSMSX104.ccr.corp.intel.com> References: <1520569925-7236-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1520569925-7236-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 V2] BaseTools: Update --pcd parser to support flexible pcd format 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: Fri, 09 Mar 2018 05:12: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: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Friday, March 09, 2018 12:32 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch V2] BaseTools: Update --pcd parser to support flexi= ble >pcd format > >This patch update --pcd parser to support flexible pcd format. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/Common/Expression.py | 21 +- > BaseTools/Source/Python/Common/Misc.py | 41 ++- > BaseTools/Source/Python/GenFds/FdfParser.py | 1 + > BaseTools/Source/Python/GenFds/FfsInfStatement.py | 18 +- > BaseTools/Source/Python/GenFds/GenFds.py | 49 ---- > BaseTools/Source/Python/Workspace/DscBuildData.py | 292 ++++++++------ >------- > .../Source/Python/Workspace/MetaFileParser.py | 1 + > BaseTools/Source/Python/build/BuildReport.py | 4 +- > 8 files changed, 159 insertions(+), 268 deletions(-) > >diff --git a/BaseTools/Source/Python/Common/Expression.py >b/BaseTools/Source/Python/Common/Expression.py >index 5a0ade9..79dc83e 100644 >--- a/BaseTools/Source/Python/Common/Expression.py >+++ b/BaseTools/Source/Python/Common/Expression.py >@@ -13,11 +13,11 @@ > ## Import Modules > # > from Common.GlobalData import * > from CommonDataClass.Exceptions import BadExpression > from CommonDataClass.Exceptions import WrnExpression >-from Misc import GuidStringToGuidStructureString, ParseFieldValue >+from Misc import GuidStringToGuidStructureString, ParseFieldValue, >IsFieldValueAnArray > import Common.EdkLogger as EdkLogger > import copy > > ERR_STRING_EXPR =3D 'This operator cannot be used in string expre= ssion: >[%s].' > ERR_SNYTAX =3D 'Syntax error, the rest of expression cannot = be >evaluated: [%s].' >@@ -123,10 +123,29 @@ def IsValidCString(Str): > ValidString =3D re.compile(r'[_a-zA-Z][_0-9a-zA-Z]*$') > if not ValidString.match(Str): > return False > return True > >+def BuildOptionValue(PcdValue, GuidDict): >+ IsArray =3D False >+ if PcdValue.startswith('H'): >+ InputValue =3D PcdValue[1:] >+ elif PcdValue.startswith("L'") or PcdValue.startswith("'"): >+ InputValue =3D PcdValue >+ elif PcdValue.startswith('L'): >+ InputValue =3D 'L"' + PcdValue[1:] + '"' >+ else: >+ InputValue =3D PcdValue >+ if IsFieldValueAnArray(InputValue): >+ IsArray =3D True >+ if IsArray: >+ try: >+ PcdValue =3D ValueExpressionEx(InputValue, 'VOID*', GuidDict)= (True) >+ except: >+ pass >+ return PcdValue >+ > ## ReplaceExprMacro > # > def ReplaceExprMacro(String, Macros, ExceptionList =3D None): > StrList =3D SplitString(String) > for i, String in enumerate(StrList): >diff --git a/BaseTools/Source/Python/Common/Misc.py >b/BaseTools/Source/Python/Common/Misc.py >index af374d8..2086b4c 100644 >--- a/BaseTools/Source/Python/Common/Misc.py >+++ b/BaseTools/Source/Python/Common/Misc.py >@@ -1439,10 +1439,26 @@ def ParseConsoleLog(Filename): > Opw.write('%s\n' % Line) > > Opr.close() > Opw.close() > >+def IsFieldValueAnArray (Value): >+ Value =3D Value.strip() >+ if Value.startswith('GUID') and Value.endswith(')'): >+ return True >+ if Value.startswith('L"') and Value.endswith('"') and len(list(Value= [2:-1])) > >1: >+ return True >+ if Value[0] =3D=3D '"' and Value[-1] =3D=3D '"' and len(list(Value[1:= -1])) > 1: >+ return True >+ if Value[0] =3D=3D '{' and Value[-1] =3D=3D '}': >+ return True >+ if Value.startswith("L'") and Value.endswith("'") and len(list(Value[= 2:-1])) > >1: >+ return True >+ if Value[0] =3D=3D "'" and Value[-1] =3D=3D "'" and len(list(Value[1:= -1])) > 1: >+ return True >+ return False >+ > def AnalyzePcdExpression(Setting): > Setting =3D Setting.strip() > # There might be escaped quote in a string: \", \\\" , \', \\\' > Data =3D Setting > # There might be '|' in string and in ( ... | ... ), replace it with = '-' >@@ -2375,35 +2391,10 @@ def PackRegistryFormatGuid(Guid): > int(Guid[4][-6:-4], 16), > int(Guid[4][-4:-2], 16), > int(Guid[4][-2:], 16) > ) > >-def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, >PcdDatumType, Value): >- if PcdDatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, >TAB_UINT64,'BOOLEAN']: >- if Value.startswith('L') or Value.startswith('"'): >- if not Value[1]: >- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type = PCD, >when specify the Value in the command line, please use the following forma= t: >"string", L"string", H"{...}"') >- Value =3D Value >- elif Value.startswith('H'): >- if not Value[1]: >- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type = PCD, >when specify the Value in the command line, please use the following forma= t: >"string", L"string", H"{...}"') >- Value =3D Value[1:] >- else: >- if not Value[0]: >- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type = PCD, >when specify the Value in the command line, please use the following forma= t: >"string", L"string", H"{...}"') >- Value =3D '"' + Value + '"' >- >- IsValid, Cause =3D CheckPcdDatum(PcdDatumType, Value) >- if not IsValid: >- EdkLogger.error("build", FORMAT_INVALID, Cause, ExtraData=3D"%s.%= s" % >(TokenSpaceGuidCName, TokenCName)) >- if PcdDatumType =3D=3D 'BOOLEAN': >- Value =3D Value.upper() >- if Value =3D=3D 'TRUE' or Value =3D=3D '1': >- Value =3D '1' >- elif Value =3D=3D 'FALSE' or Value =3D=3D '0': >- Value =3D '0' >- return Value > ## Get the integer value from string like "14U" or integer like 2 > # > # @param Input The object that may be either a integer value or = a string > # > # @retval Value The integer value that the input represents >diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py >b/BaseTools/Source/Python/GenFds/FdfParser.py >index fc2b409..76d7e6a 100644 >--- a/BaseTools/Source/Python/GenFds/FdfParser.py >+++ b/BaseTools/Source/Python/GenFds/FdfParser.py >@@ -926,10 +926,11 @@ class FdfParser: > MacroDict.update(GlobalData.gGlobalDefines) > MacroDict.update(GlobalData.gCommandLineDefines) > if GlobalData.BuildOptionPcd: > for Item in GlobalData.BuildOptionPcd: > PcdName, TmpValue =3D Item.split("=3D") >+ TmpValue =3D BuildOptionValue(TmpValue, {}) > MacroDict[PcdName.strip()] =3D TmpValue > # Highest priority > > return MacroDict > >diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py >b/BaseTools/Source/Python/GenFds/FfsInfStatement.py >index dfff892..a348233 100644 >--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py >+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py >@@ -1,9 +1,9 @@ > ## @file > # process FFS generation from INF statement > # >-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
>+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> # Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.
> # > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the = BSD >License > # which accompanies this distribution. The full text of the license may= be >found at >@@ -272,11 +272,13 @@ class FfsInfStatement(FfsInfStatementClassObject): > # Override Patchable PCD value by the value from Build Option > BuildOptionOverride =3D False > if GlobalData.BuildOptionPcd: > for pcd in GlobalData.BuildOptionPcd: > if PcdKey =3D=3D (pcd[1], pcd[0]): >- DefaultValue =3D pcd[2] >+ if pcd[2]: >+ continue >+ DefaultValue =3D pcd[3] > BuildOptionOverride =3D True > break > > if not DscOverride and not FdfOverride and not BuildOptionOve= rride: > continue >@@ -286,19 +288,19 @@ class FfsInfStatement(FfsInfStatementClassObject): > try: > DefaultValue =3D ValueExpressionEx(DefaultValue, Pcd.= DatumType, >Platform._GuidDict)(True) > except BadExpression: > EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] = Value >"%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, DefaultValue), >File=3Dself.InfFileName) > >- if Pcd.DefaultValue: >+ if Pcd.InfDefaultValue: > try: >- Pcd.DefaultValue =3D ValueExpressionEx(Pcd.DefaultVal= ue, >Pcd.DatumType, Platform._GuidDict)(True) >+ Pcd.InfDefaultValue =3D ValueExpressionEx(Pcd.InfDefa= ultValue, >Pcd.DatumType, Platform._GuidDict)(True) > except BadExpression: > EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] = Value >"%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, >Pcd.DefaultValue),File=3Dself.InfFileName) > > # Check value, if value are equal, no need to patch > if Pcd.DatumType =3D=3D "VOID*": >- if Pcd.DefaultValue =3D=3D DefaultValue or DefaultValue i= n [None, '']: >+ if Pcd.InfDefaultValue =3D=3D DefaultValue or DefaultValu= e in [None, '']: > continue > # Get the string size from FDF or DSC > if DefaultValue[0] =3D=3D 'L': > # Remove L"", but the '\0' must be appended > MaxDatumSize =3D str((len(DefaultValue) - 2) * 2) >@@ -308,19 +310,19 @@ class FfsInfStatement(FfsInfStatementClassObject): > MaxDatumSize =3D str(len(DefaultValue) - 1) > if DscOverride: > Pcd.MaxDatumSize =3D PatchPcd.MaxDatumSize > # If no defined the maximum size in DSC, try to get curre= nt size from >INF > if Pcd.MaxDatumSize in ['', None]: >- Pcd.MaxDatumSize =3D str(len(Pcd.DefaultValue.split('= ,'))) >+ Pcd.MaxDatumSize =3D str(len(Pcd.InfDefaultValue.spli= t(','))) > else: > Base1 =3D Base2 =3D 10 >- if Pcd.DefaultValue.upper().startswith('0X'): >+ if Pcd.InfDefaultValue.upper().startswith('0X'): > Base1 =3D 16 > if DefaultValue.upper().startswith('0X'): > Base2 =3D 16 > try: >- PcdValueInImg =3D int(Pcd.DefaultValue, Base1) >+ PcdValueInImg =3D int(Pcd.InfDefaultValue, Base1) > PcdValueInDscOrFdf =3D int(DefaultValue, Base2) > if PcdValueInImg =3D=3D PcdValueInDscOrFdf: > continue > except: > continue >diff --git a/BaseTools/Source/Python/GenFds/GenFds.py >b/BaseTools/Source/Python/GenFds/GenFds.py >index 9ca7c87..4c56cbb 100644 >--- a/BaseTools/Source/Python/GenFds/GenFds.py >+++ b/BaseTools/Source/Python/GenFds/GenFds.py >@@ -36,12 +36,10 @@ from Common import EdkLogger > from Common.String import * > from Common.Misc import DirCache, PathClass > from Common.Misc import SaveFileOnChange > from Common.Misc import ClearDuplicatedInf > from Common.Misc import GuidStructureStringToGuidString >-from Common.Misc import CheckPcdDatum >-from Common.Misc import BuildOptionPcdValueFormat > from Common.BuildVersion import gBUILD_VERSION > from Common.MultipleWorkspace import MultipleWorkspace as mws > import FfsFileStatement > import glob > from struct import unpack >@@ -367,57 +365,10 @@ def SingleCheckCallback(option, opt_str, value, >parser): > setattr(parser.values, option.dest, value) > gParamCheck.append(option) > else: > parser.error("Option %s only allows one instance in command line!= " % >option) > >-def CheckBuildOptionPcd(): >- for Arch in GenFdsGlobalVariable.ArchList: >- PkgList =3D >GenFdsGlobalVariable.WorkSpace.GetPackageList(GenFdsGlobalVariable.Acti >vePlatform, Arch, GenFdsGlobalVariable.TargetName, >GenFdsGlobalVariable.ToolChainTag) >- for i, pcd in enumerate(GlobalData.BuildOptionPcd): >- if type(pcd) is tuple: >- continue >- (pcdname, pcdvalue) =3D pcd.split('=3D') >- if not pcdvalue: >- EdkLogger.error('GenFds', OPTION_MISSING, "No Value speci= fied for >the PCD %s." % (pcdname)) >- if '.' in pcdname: >- (TokenSpaceGuidCName, TokenCName) =3D pcdname.split('.') >- HasTokenSpace =3D True >- else: >- TokenCName =3D pcdname >- TokenSpaceGuidCName =3D '' >- HasTokenSpace =3D False >- TokenSpaceGuidCNameList =3D [] >- FoundFlag =3D False >- PcdDatumType =3D '' >- NewValue =3D '' >- for package in PkgList: >- for key in package.Pcds: >- PcdItem =3D package.Pcds[key] >- if HasTokenSpace: >- if (PcdItem.TokenCName, PcdItem.TokenSpaceGuidCNa= me) =3D=3D >(TokenCName, TokenSpaceGuidCName): >- PcdDatumType =3D PcdItem.DatumType >- NewValue =3D >BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, >PcdDatumType, pcdvalue) >- FoundFlag =3D True >- else: >- if PcdItem.TokenCName =3D=3D TokenCName: >- if not PcdItem.TokenSpaceGuidCName in >TokenSpaceGuidCNameList: >- if len (TokenSpaceGuidCNameList) < 1: >- >TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName) >- PcdDatumType =3D PcdItem.DatumType >- TokenSpaceGuidCName =3D >PcdItem.TokenSpaceGuidCName >- NewValue =3D >BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, >PcdDatumType, pcdvalue) >- FoundFlag =3D True >- else: >- EdkLogger.error( >- 'GenFds', >- PCD_VALIDATION_INFO_ERROR, >- "The Pcd %s is found under mu= ltiple different >TokenSpaceGuid: %s and %s." % (TokenCName, >PcdItem.TokenSpaceGuidCName, TokenSpaceGuidCNameList[0]) >- ) >- >- GlobalData.BuildOptionPcd[i] =3D (TokenSpaceGuidCName, TokenC= Name, >NewValue) >- >- > ## FindExtendTool() > # > # Find location of tools to process data > # > # @param KeyStringList Filter for inputs of section generation >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index e72b777..91b3a27 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -19,11 +19,11 @@ > # > from Common.String import * > from Common.DataType import * > from Common.Misc import * > from types import * >- >+from Common.Expression import * > from CommonDataClass.CommonClass import SkuInfoClass > from Common.TargetTxtClassObject import * > from Common.ToolDefClassObject import * > from MetaDataTable import * > from MetaFileTable import * >@@ -903,40 +903,10 @@ class DscBuildData(PlatformBuildClassObject): > pcd.PcdValueFromComm =3D >pcd.SkuInfoList.get("DEFAULT").DefaultValue > for pcd in self._Pcds: > if isinstance(self._Pcds[pcd],StructurePcd) and >(self._Pcds[pcd].PcdValueFromComm or >self._Pcds[pcd].PcdFieldValueFromComm): > UpdateCommandLineValue(self._Pcds[pcd]) > >- def GetFieldValueFromComm(self,ValueStr,TokenSpaceGuidCName, >TokenCName, FieldName): >- PredictedFieldType =3D "VOID*" >- if ValueStr.startswith('L'): >- if not ValueStr[1]: >- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type = PCD, >when specify the Value in the command line, please use the following forma= t: >"string", L"string", H"{...}"') >- ValueStr =3D ValueStr[0] + '"' + ValueStr[1:] + '"' >- PredictedFieldType =3D "VOID*" >- elif ValueStr.startswith('H') or ValueStr.startswith('{'): >- EdkLogger.error("build", FORMAT_INVALID, 'Currently we do not >support assign H"{...}" format for Pcd field.', ExtraData=3D"%s.%s.%s from >command line" % (TokenSpaceGuidCName, TokenCName, FieldName)) >- ValueStr =3D ValueStr[1:] >- PredictedFieldType =3D "VOID*" >- elif ValueStr.upper() in ['TRUE', '0X1', '0X01', '1', 'FALSE', '0= X0', '0X00', '0']: >- PredictedFieldType =3D "BOOLEAN" >- elif ValueStr.isdigit() or ValueStr.upper().startswith('0X'): >- PredictedFieldType =3D TAB_UINT16 >- else: >- if not ValueStr[0]: >- EdkLogger.error("build", FORMAT_INVALID, 'For Void* type = PCD, >when specify the Value in the command line, please use the following forma= t: >"string", L"string", H"{...}"') >- ValueStr =3D '"' + ValueStr + '"' >- PredictedFieldType =3D "VOID*" >- IsValid, Cause =3D CheckPcdDatum(PredictedFieldType, ValueStr) >- if not IsValid: >- EdkLogger.error("build", FORMAT_INVALID, Cause, >ExtraData=3D"%s.%s.%s from command line" % (TokenSpaceGuidCName, >TokenCName, FieldName)) >- if PredictedFieldType =3D=3D 'BOOLEAN': >- ValueStr =3D ValueStr.upper() >- if ValueStr =3D=3D 'TRUE' or ValueStr =3D=3D '1': >- ValueStr =3D '1' >- elif ValueStr =3D=3D 'FALSE' or ValueStr =3D=3D '0': >- ValueStr =3D '0' >- return ValueStr > def __ParsePcdFromCommandLine(self): > if GlobalData.BuildOptionPcd: > for i, pcd in enumerate(GlobalData.BuildOptionPcd): > if type(pcd) is tuple: > continue >@@ -973,152 +943,122 @@ class DscBuildData(PlatformBuildClassObject): > TokenSpaceGuidCName =3D '' > HasTokenSpace =3D False > TokenSpaceGuidCNameList =3D [] > FoundFlag =3D False > PcdDatumType =3D '' >- NewValue =3D '' >+ DisplayName =3D TokenCName >+ if FieldName: >+ DisplayName =3D TokenCName + '.' + FieldName > if not HasTokenSpace: > for key in self.DecPcds: >- if TokenCName =3D=3D key[0]: >- if TokenSpaceGuidCName: >- EdkLogger.error( >- 'build', >- AUTOGEN_ERROR, >- "The Pcd %s is found unde= r multiple different >TokenSpaceGuid: %s and %s." % (TokenCName, TokenSpaceGuidCName, >key[1]) >- ) >- else: >- TokenSpaceGuidCName =3D key[1] >- FoundFlag =3D True >+ PcdItem =3D self.DecPcds[key] >+ if TokenCName =3D=3D PcdItem.TokenCName: >+ if not PcdItem.TokenSpaceGuidCName in >TokenSpaceGuidCNameList: >+ if len (TokenSpaceGuidCNameList) < 1: >+ >TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName) >+ TokenSpaceGuidCName =3D >PcdItem.TokenSpaceGuidCName >+ PcdDatumType =3D PcdItem.DatumType >+ FoundFlag =3D True >+ else: >+ EdkLogger.error( >+ 'build', >+ AUTOGEN_ERROR, >+ "The Pcd %s is found under mu= ltiple different >TokenSpaceGuid: %s and %s." % (DisplayName, >PcdItem.TokenSpaceGuidCName, TokenSpaceGuidCNameList[0]) >+ ) > else: > if (TokenCName, TokenSpaceGuidCName) in self.DecPcds: > FoundFlag =3D True >- if FieldName: >- NewValue =3D self.GetFieldValueFromComm(pcdvalue, >TokenSpaceGuidCName, TokenCName, FieldName) >- GlobalData.BuildOptionPcd[i] =3D (TokenSpaceGuidCName= , >TokenCName, FieldName,NewValue,("build command options",1)) >- else: >- # Replace \' to ', \\\' to \' >- pcdvalue =3D pcdvalue.replace("\\\\\\'", '\\\\\\"').r= eplace('\\\'', >'\'').replace('\\\\\\"', "\\'") >- for key in self.DecPcds: >- PcdItem =3D self.DecPcds[key] >- if HasTokenSpace: >- if (PcdItem.TokenCName, PcdItem.TokenSpaceGui= dCName) >=3D=3D (TokenCName, TokenSpaceGuidCName): >- PcdDatumType =3D PcdItem.DatumType >- if pcdvalue.startswith('H'): >- try: >- pcdvalue =3D ValueExpressionEx(pc= dvalue[1:], >PcdDatumType, self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser', FORMAT_= INVALID, 'PCD [%s.%s] >Value "%s", %s' % >- (TokenSpaceGuidCN= ame, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_UINT8, TA= B_UINT16, >TAB_UINT32, TAB_UINT64, 'BOOLEAN']: >- pcdvalue =3D 'H' + pcdvalue >- elif pcdvalue.startswith("L'"): >- try: >- pcdvalue =3D ValueExpressionEx(pc= dvalue, PcdDatumType, >self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser', FORMAT_= INVALID, 'PCD [%s.%s] >Value "%s", %s' % >- (TokenSpaceGuidCN= ame, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_UINT8, TA= B_UINT16, >TAB_UINT32, TAB_UINT64, 'BOOLEAN']: >- pcdvalue =3D 'H' + pcdvalue >- elif pcdvalue.startswith("'"): >- try: >- pcdvalue =3D ValueExpressionEx(pc= dvalue, PcdDatumType, >self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser', FORMAT_= INVALID, 'PCD [%s.%s] >Value "%s", %s' % >- (TokenSpaceGuidCN= ame, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_UINT8, TA= B_UINT16, >TAB_UINT32, TAB_UINT64, 'BOOLEAN']: >- pcdvalue =3D 'H' + pcdvalue >- elif pcdvalue.startswith('L'): >- pcdvalue =3D 'L"' + pcdvalue[1:] + '"= ' >- try: >- pcdvalue =3D ValueExpressionEx(pc= dvalue, PcdDatumType, >self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser', FORMAT_= INVALID, 'PCD [%s.%s] >Value "%s", %s' % >- (TokenSpaceGuidCN= ame, TokenCName, >pcdvalue, Value)) >- else: >- try: >- pcdvalue =3D ValueExpressionEx(pc= dvalue, PcdDatumType, >self._GuidDict)(True) >- except BadExpression, Value: >- try: >- pcdvalue =3D '"' + pcdvalue += '"' >- pcdvalue =3D ValueExpressionE= x(pcdvalue, >PcdDatumType, self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser', FOR= MAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (TokenSpaceGu= idCName, TokenCName, >pcdvalue, Value)) >- NewValue =3D >BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, >PcdDatumType, pcdvalue) >- FoundFlag =3D True >- else: >- if PcdItem.TokenCName =3D=3D TokenCName: >- if not PcdItem.TokenSpaceGuidCName in >TokenSpaceGuidCNameList: >- if len (TokenSpaceGuidCNameList) < 1: >- >TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName) >- PcdDatumType =3D PcdItem.DatumTyp= e >- TokenSpaceGuidCName =3D >PcdItem.TokenSpaceGuidCName >- if pcdvalue.startswith('H'): >- try: >- pcdvalue =3D ValueExpress= ionEx(pcdvalue[1:], >PcdDatumType, self._GuidDict)(True) >- except BadExpression, Value: >- EdkLogger.error('Parser',= FORMAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (TokenSpa= ceGuidCName, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_U= INT8, TAB_UINT16, >TAB_UINT32, TAB_UINT64,'BOOLEAN']: >- pcdvalue =3D 'H' + pcdval= ue >- elif pcdvalue.startswith("L'"): >- try: >- pcdvalue =3D ValueExpress= ionEx(pcdvalue, >PcdDatumType, self._GuidDict)( >- True) >- except BadExpression, Value: >- EdkLogger.error('Parser',= FORMAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (TokenSpa= ceGuidCName, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_U= INT8, TAB_UINT16, >TAB_UINT32, TAB_UINT64, 'BOOLEAN']: >- pcdvalue =3D 'H' + pcdval= ue >- elif pcdvalue.startswith("'"): >- try: >- pcdvalue =3D ValueExpress= ionEx(pcdvalue, >PcdDatumType, self._GuidDict)( >- True) >- except BadExpression, Value: >- EdkLogger.error('Parser',= FORMAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (TokenSpa= ceGuidCName, TokenCName, >pcdvalue, Value)) >- if PcdDatumType not in [TAB_U= INT8, TAB_UINT16, >TAB_UINT32, TAB_UINT64, 'BOOLEAN']: >- pcdvalue =3D 'H' + pcdval= ue >- elif pcdvalue.startswith('L'): >- pcdvalue =3D 'L"' + pcdvalue[= 1:] + '"' >- try: >- pcdvalue =3D ValueExpress= ionEx(pcdvalue, >PcdDatumType, self._GuidDict)( >- True) >- except BadExpression, Value: >- EdkLogger.error('Parser',= FORMAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (TokenSpa= ceGuidCName, TokenCName, >pcdvalue, Value)) >- else: >- try: >- pcdvalue =3D ValueExpress= ionEx(pcdvalue, >PcdDatumType, self._GuidDict)(True) >- except BadExpression, Value: >- try: >- pcdvalue =3D '"' + pc= dvalue + '"' >- pcdvalue =3D ValueExp= ressionEx(pcdvalue, >PcdDatumType, self._GuidDict)(True) >- except BadExpression, Val= ue: >- EdkLogger.error('Pars= er', FORMAT_INVALID, 'PCD >[%s.%s] Value "%s", %s' % >- (Toke= nSpaceGuidCName, TokenCName, >pcdvalue, Value)) >- NewValue =3D >BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, >PcdDatumType, pcdvalue) >- FoundFlag =3D True >- else: >- EdkLogger.error( >- 'build', >- AUTOGEN_ERROR, >- "The Pcd %s is found unde= r multiple different >TokenSpaceGuid: %s and %s." % (TokenCName, >PcdItem.TokenSpaceGuidCName, TokenSpaceGuidCNameList[0]) >- ) >- GlobalData.BuildOptionPcd[i] =3D (TokenSpaceGuidCName= , >TokenCName, FieldName,NewValue,("build command options",1)) > if not FoundFlag: > if HasTokenSpace: >- EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd = %s.%s is not >found in the DEC file." % (TokenSpaceGuidCName, TokenCName)) >+ EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd = %s.%s is not >found in the DEC file." % (TokenSpaceGuidCName, DisplayName)) > else: >- EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd = %s is not >found in the DEC file." % (TokenCName)) >+ EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd = %s is not >found in the DEC file." % (DisplayName)) >+ pcdvalue =3D pcdvalue.replace("\\\\\\'", '\\\\\\"').repla= ce('\\\'', >'\'').replace('\\\\\\"', "\\'") >+ if FieldName: >+ pcdvalue =3D self.HandleFlexiblePcd(TokenSpaceGuidCNa= me, >TokenCName, pcdvalue, PcdDatumType, self._GuidDict, FieldName) >+ else: >+ pcdvalue =3D self.HandleFlexiblePcd(TokenSpaceGuidCNa= me, >TokenCName, pcdvalue, PcdDatumType, self._GuidDict) >+ IsValid, Cause =3D CheckPcdDatum(PcdDatumType, pcdval= ue) >+ if not IsValid: >+ EdkLogger.error("build", FORMAT_INVALID, Cause, >ExtraData=3D"%s.%s" % (TokenSpaceGuidCName, TokenCName)) >+ GlobalData.BuildOptionPcd[i] =3D (TokenSpaceGuidCName, >TokenCName, FieldName, pcdvalue,("build command options",1)) >+ > for BuildData in self._Bdb._CACHE_.values(): > if BuildData.MetaFile.Ext =3D=3D '.dec' or BuildData.= MetaFile.Ext =3D=3D >'.dsc': > continue > for key in BuildData.Pcds: > PcdItem =3D BuildData.Pcds[key] > if (TokenSpaceGuidCName, TokenCName) =3D=3D >(PcdItem.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName >=3D=3D"": >- PcdItem.DefaultValue =3D NewValue >+ PcdItem.DefaultValue =3D pcdvalue >+ >+ def HandleFlexiblePcd(self, TokenSpaceGuidCName, TokenCName, >PcdValue, PcdDatumType, GuidDict, FieldName=3D''): >+ if FieldName: >+ IsArray =3D False >+ TokenCName +=3D '.' + FieldName >+ if PcdValue.startswith('H'): >+ if FieldName and IsFieldValueAnArray(PcdValue[1:]): >+ PcdDatumType =3D 'VOID*' >+ IsArray =3D True >+ if FieldName and not IsArray: >+ return PcdValue >+ try: >+ PcdValue =3D ValueExpressionEx(PcdValue[1:], PcdDatumType= , >GuidDict)(True) >+ except BadExpression, Value: >+ EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Va= lue >"%s", %s' % >+ (TokenSpaceGuidCName, TokenCName, PcdValu= e, Value)) >+ elif PcdValue.startswith("L'") or PcdValue.startswith("'"): >+ if FieldName and IsFieldValueAnArray(PcdValue): >+ PcdDatumType =3D 'VOID*' >+ IsArray =3D True >+ if FieldName and not IsArray: >+ return PcdValue >+ try: >+ PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, >GuidDict)(True) >+ except BadExpression, Value: >+ EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Va= lue >"%s", %s' % >+ (TokenSpaceGuidCName, TokenCName, PcdValu= e, Value)) >+ elif PcdValue.startswith('L'): >+ PcdValue =3D 'L"' + PcdValue[1:] + '"' >+ if FieldName and IsFieldValueAnArray(PcdValue): >+ PcdDatumType =3D 'VOID*' >+ IsArray =3D True >+ if FieldName and not IsArray: >+ return PcdValue >+ try: >+ PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, >GuidDict)(True) >+ except BadExpression, Value: >+ EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Va= lue >"%s", %s' % >+ (TokenSpaceGuidCName, TokenCName, PcdValu= e, Value)) >+ else: >+ if PcdValue.upper() =3D=3D 'FALSE': >+ PcdValue =3D str(0) >+ if PcdValue.upper() =3D=3D 'TRUE': >+ PcdValue =3D str(1) >+ if not FieldName: >+ if PcdDatumType not in >['UINT8','UINT16','UINT32','UINT64','BOOLEAN']: >+ PcdValue =3D '"' + PcdValue + '"' >+ else: >+ IsArray =3D False >+ Base =3D 10 >+ if PcdValue.upper().startswith('0X'): >+ Base =3D 16 >+ try: >+ Num =3D int(PcdValue, Base) >+ except: >+ PcdValue =3D '"' + PcdValue + '"' >+ if IsFieldValueAnArray(PcdValue): >+ PcdDatumType =3D 'VOID*' >+ IsArray =3D True >+ if not IsArray: >+ return PcdValue >+ try: >+ PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, >GuidDict)(True) >+ except BadExpression, Value: >+ EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Va= lue >"%s", %s' % >+ (TokenSpaceGuidCName, TokenCName, PcdValu= e, Value)) >+ return PcdValue >+ > ## Retrieve all PCD settings in platform > def _GetPcds(self): > if self._Pcds =3D=3D None: > self._Pcds =3D sdict() > self.__ParsePcdFromCommandLine() >@@ -1553,26 +1493,10 @@ class DscBuildData(PlatformBuildClassObject): > return len(Value) - 2 > return len(Value) > > return str(max([pcd_size for pcd_size in [get_length(item) for it= em in >sku_values]])) > >- def IsFieldValueAnArray (self, Value): >- Value =3D Value.strip() >- if Value.startswith('GUID') and Value.endswith(')'): >- return True >- if Value.startswith('L"') and Value.endswith('"') and len(list(V= alue[2:-1])) > >1: >- return True >- if Value[0] =3D=3D '"' and Value[-1] =3D=3D '"' and len(list(Valu= e[1:-1])) > 1: >- return True >- if Value[0] =3D=3D '{' and Value[-1] =3D=3D '}': >- return True >- if Value.startswith("L'") and Value.endswith("'") and len(list(Va= lue[2:- >1])) > 1: >- return True >- if Value[0] =3D=3D "'" and Value[-1] =3D=3D "'" and len(list(Valu= e[1:-1])) > 1: >- return True >- return False >- > def ExecuteCommand (self, Command): > try: > Process =3D subprocess.Popen(Command, stdout=3Dsubprocess.PIP= E, >stderr=3Dsubprocess.PIPE, shell=3DTrue) > except: > EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute >command: %s' % Command) >@@ -1615,11 +1539,11 @@ class DscBuildData(PlatformBuildClassObject): > for FieldList in [Pcd.DefaultValues]: > if not FieldList: > continue > for FieldName in FieldList: > FieldName =3D "." + FieldName >- IsArray =3D self.IsFieldValueAnArray(FieldList[FieldName.= strip(".")][0]) >+ IsArray =3D IsFieldValueAnArray(FieldList[FieldName.strip= (".")][0]) > if IsArray and not (FieldList[FieldName.strip(".")][0].st= artswith('{GUID') >and FieldList[FieldName.strip(".")][0].endswith('}')): > try: > Value =3D ValueExpressionEx(FieldList[FieldName.s= trip(".")][0], >"VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, "Invalid= value format >for %s. From %s Line %d " % >@@ -1645,11 +1569,11 @@ class DscBuildData(PlatformBuildClassObject): > for FieldList in >[Pcd.SkuOverrideValues[skuname].get(defaultstorenameitem)]: > if not FieldList: > continue > for FieldName in FieldList: > FieldName =3D "." + FieldName >- IsArray =3D >self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0]) >+ IsArray =3D IsFieldValueAnArray(FieldList[FieldNa= me.strip(".")][0]) > if IsArray and not >(FieldList[FieldName.strip(".")][0].startswith('{GUID') and >FieldList[FieldName.strip(".")][0].endswith('}')): > try: > Value =3D ValueExpressionEx(FieldList[Fie= ldName.strip(".")][0], >"VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, = "Invalid value >format for %s. From %s Line %d " % >@@ -1669,11 +1593,11 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size,= %s, %s, %d); // >>From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), >ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], >FieldList[FieldName_ori][0]) > if Pcd.PcdFieldValueFromComm: > CApp =3D CApp + "// From Command Line \n" > for FieldName in Pcd.PcdFieldValueFromComm: > FieldName =3D "." + FieldName >- IsArray =3D >self.IsFieldValueAnArray(Pcd.PcdFieldValueFromComm[FieldName.strip(".")] >[0]) >+ IsArray =3D >IsFieldValueAnArray(Pcd.PcdFieldValueFromComm[FieldName.strip(".")][0]) > if IsArray and not >(Pcd.PcdFieldValueFromComm[FieldName.strip(".")][0].startswith('{GUID') >and Pcd.PcdFieldValueFromComm[FieldName.strip(".")][0].endswith('}')): > try: > Value =3D >ValueExpressionEx(Pcd.PcdFieldValueFromComm[FieldName.strip(".")][0], >"VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, "Invalid val= ue format >for %s. From %s Line %d " % >@@ -1702,11 +1626,11 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D "// Default value in Dec \n" > CApp =3D CApp + "void Assign_%s_%s_Default_Value(%s *Pcd){\n" % >(Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Pcd.DatumType) > CApp =3D CApp + ' UINT32 FieldSize;\n' > CApp =3D CApp + ' CHAR8 *Value;\n' > DefaultValueFromDec =3D Pcd.DefaultValueFromDec >- IsArray =3D self.IsFieldValueAnArray(Pcd.DefaultValueFromDec) >+ IsArray =3D IsFieldValueAnArray(Pcd.DefaultValueFromDec) > if IsArray: > try: > DefaultValueFromDec =3D >ValueExpressionEx(Pcd.DefaultValueFromDec, "VOID*")(True) > except BadExpression: > EdkLogger.error("Build", FORMAT_INVALID, "Invalid value f= ormat >for %s.%s, from DEC: %s" % >@@ -1723,11 +1647,11 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (ValueSize) > for FieldList in [Pcd.DefaultValues]: > if not FieldList: > continue > for FieldName in FieldList: >- IsArray =3D self.IsFieldValueAnArray(FieldList[FieldName]= [0]) >+ IsArray =3D IsFieldValueAnArray(FieldList[FieldName][0]) > if IsArray: > try: > FieldList[FieldName][0] =3D >ValueExpressionEx(FieldList[FieldName][0], "VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, "Invalid= value format >for %s. From %s Line %d " % >@@ -1773,11 +1697,11 @@ class DscBuildData(PlatformBuildClassObject): > pcddefaultvalue =3D >Pcd.DscRawValue.get(SkuName,{}).get(DefaultStoreName) > for FieldList in >[pcddefaultvalue,inherit_OverrideValues.get(DefaultStoreName)]: > if not FieldList: > continue > if pcddefaultvalue and FieldList =3D=3D pcddefaultvalue: >- IsArray =3D self.IsFieldValueAnArray(FieldList) >+ IsArray =3D IsFieldValueAnArray(FieldList) > if IsArray: > try: > FieldList =3D ValueExpressionEx(FieldList, "VOID*= ")(True) > except BadExpression: > EdkLogger.error("Build", FORMAT_INVALID, "Invalid= value format >for %s.%s, from DSC: %s" % >@@ -1803,11 +1727,11 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + ' Value =3D %s; // From DSC = Default Value %s\n' % >(self.IntToCString(Value, ValueSize), >Pcd.DscRawValue.get(SkuName,{}).get(DefaultStoreName)) > CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % = (ValueSize) > continue > if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT','STANDARD') o= r >(( (SkuName,'') not in Pcd.ValueChain) and ( (SkuName,DefaultStoreName) >not in Pcd.ValueChain )): > for FieldName in FieldList: >- IsArray =3D self.IsFieldValueAnArray(FieldList[FieldN= ame][0]) >+ IsArray =3D IsFieldValueAnArray(FieldList[FieldName][= 0]) > if IsArray: > try: > FieldList[FieldName][0] =3D >ValueExpressionEx(FieldList[FieldName][0], "VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, "Inv= alid value >format for %s. From %s Line %d " % >@@ -1844,11 +1768,11 @@ class DscBuildData(PlatformBuildClassObject): > pcddefaultvalue =3D Pcd.PcdValueFromComm > for FieldList in [pcddefaultvalue,Pcd.PcdFieldValueFromComm]: > if not FieldList: > continue > if pcddefaultvalue and FieldList =3D=3D pcddefaultvalue: >- IsArray =3D self.IsFieldValueAnArray(FieldList) >+ IsArray =3D IsFieldValueAnArray(FieldList) > if IsArray: > try: > FieldList =3D ValueExpressionEx(FieldList, "VOID*= ")(True) > except BadExpression: > EdkLogger.error("Build", FORMAT_INVALID, "Invalid= value format >for %s.%s, from Command: %s" % >@@ -1863,11 +1787,11 @@ class DscBuildData(PlatformBuildClassObject): > # > CApp =3D CApp + ' Value =3D %s; // From Command = Line.\n' % >(self.IntToCString(Value, ValueSize)) > CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Val= ueSize) > continue > for FieldName in FieldList: >- IsArray =3D self.IsFieldValueAnArray(FieldList[FieldName]= [0]) >+ IsArray =3D IsFieldValueAnArray(FieldList[FieldName][0]) > if IsArray: > try: > FieldList[FieldName][0] =3D >ValueExpressionEx(FieldList[FieldName][0], "VOID*", self._GuidDict)(True) > except BadExpression: > EdkLogger.error('Build', FORMAT_INVALID, "Invalid= value format >for %s. From %s Line %d " % >diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py >b/BaseTools/Source/Python/Workspace/MetaFileParser.py >index 6809003..69bdf21 100644 >--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py >+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py >@@ -1244,10 +1244,11 @@ class DscParser(MetaFileParser): > if self._ItemType not in [MODEL_META_DATA_DEFINE, >MODEL_META_DATA_GLOBAL_DEFINE]: > Macros.update(self._Symbols) > if GlobalData.BuildOptionPcd: > for Item in GlobalData.BuildOptionPcd: > PcdName, TmpValue =3D Item.split("=3D") >+ TmpValue =3D BuildOptionValue(TmpValue, self._GuidDict) > Macros[PcdName.strip()] =3D TmpValue > return Macros > > def _PostProcess(self): > Processer =3D { >diff --git a/BaseTools/Source/Python/build/BuildReport.py >b/BaseTools/Source/Python/build/BuildReport.py >index 89bdfa1..d555dce 100644 >--- a/BaseTools/Source/Python/build/BuildReport.py >+++ b/BaseTools/Source/Python/build/BuildReport.py >@@ -975,11 +975,13 @@ class PcdReport(object): > > BuildOptionMatch =3D False > if GlobalData.BuildOptionPcd: > for pcd in GlobalData.BuildOptionPcd: > if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) = =3D=3D (pcd[0], >pcd[1]): >- PcdValue =3D pcd[2] >+ if pcd[2]: >+ continue >+ PcdValue =3D pcd[3] > Pcd.DefaultValue =3D PcdValue > BuildOptionMatch =3D True > break > > if First: >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel