From a6a326770b0e9e209c604d26fd861a9714c36bef Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Fri, 19 Oct 2018 15:10:30 +0800 Subject: [PATCH] BaseTools: Fix the *B and *F Flag display for Structure Pcd Because of we newly add the PcdFieldValueFromComm and PcdFieldValueFromFdf in early parser phase, so in the report we use the saved value in this two variables to print it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/build/BuildReport.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index a66adfb167..de8f0fb087 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1074,9 +1074,13 @@ class PcdReport(object): Pcd.DatumType = Pcd.StructName if TypeName in ('DYNVPD', 'DEXVPD'): Pcd.SkuInfoList = SkuInfoList - if Pcd.PcdFieldValueFromComm: + if Pcd.PcdValueFromComm or Pcd.PcdFieldValueFromComm: BuildOptionMatch = True DecMatch = False + elif Pcd.PcdValueFromFdf or Pcd.PcdFieldValueFromFdf: + DscDefaultValue = True + DscMatch = True + DecMatch = False elif Pcd.SkuOverrideValues: DscOverride = False if Pcd.DefaultFromDSC: @@ -1266,6 +1270,7 @@ class PcdReport(object): Value = "0x{:X} ({})".format(int(Value, 0), Value) FileWrite(File, ' %-*s : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value)) if IsStructure: + FiledOverrideFlag = False OverrideValues = Pcd.SkuOverrideValues if OverrideValues: for Data in OverrideValues.values(): @@ -1273,7 +1278,11 @@ class PcdReport(object): if Struct: OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0]) self.PrintStructureInfo(File, OverrideFieldStruct) + FiledOverrideFlag = True break + if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or Pcd.PcdFieldValueFromFdf): + OverrideFieldStruct = self.OverrideFieldValue(Pcd, {}) + self.PrintStructureInfo(File, OverrideFieldStruct) self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) else: FirstPrint = True @@ -1393,11 +1402,16 @@ class PcdReport(object): if TypeName in ('DYNVPD', 'DEXVPD'): FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset)) if IsStructure: + FiledOverrideFlag = False OverrideValues = Pcd.SkuOverrideValues[Sku] if OverrideValues: Keys = OverrideValues.keys() OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]]) self.PrintStructureInfo(File, OverrideFieldStruct) + FiledOverrideFlag = True + if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or Pcd.PcdFieldValueFromFdf): + OverrideFieldStruct = self.OverrideFieldValue(Pcd, {}) + self.PrintStructureInfo(File, OverrideFieldStruct) self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) def OverrideFieldValue(self, Pcd, OverrideStruct):