From 7c41b8135de692ea45334747b73936ea6804622f Mon Sep 17 00:00:00 2001 From: zhijufan Date: Thu, 6 Sep 2018 13:53:18 +0800 Subject: BaseTools: Align the boolean type PCD value's display in the report This patch align the boolean type PCD value's display in the build report. Original it may display 0x0, also may use 0 for the same PCD. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/build/BuildReport.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source') diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index a598d64244..c7fa1b97db 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1014,7 +1014,7 @@ class PcdReport(object): First = False - if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES: + if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: PcdValueNumber = int(PcdValue.strip(), 0) if DecDefaultValue is None: DecMatch = True @@ -1102,6 +1102,15 @@ class PcdReport(object): # # Report PCD item according to their override relationship # + if Pcd.DatumType == 'BOOLEAN': + if DscDefaultValue: + DscDefaultValue = str(int(DscDefaultValue, 0)) + if DecDefaultValue: + DecDefaultValue = str(int(DecDefaultValue, 0)) + if InfDefaultValue: + InfDefaultValue = str(int(InfDefaultValue, 0)) + if Pcd.DefaultValue: + Pcd.DefaultValue = str(int(Pcd.DefaultValue, 0)) if DecMatch: self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, ' ') elif InfDefaultValue and InfMatch: @@ -1126,9 +1135,11 @@ class PcdReport(object): ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {}) for ModulePath in ModuleOverride: ModuleDefault = ModuleOverride[ModulePath] - if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES: + if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0) Match = (ModulePcdDefaultValueNumber == PcdValueNumber) + if Pcd.DatumType == 'BOOLEAN': + ModuleDefault = str(ModulePcdDefaultValueNumber) else: Match = (ModuleDefault.strip() == PcdValue.strip()) if Match: @@ -1247,6 +1258,8 @@ class PcdReport(object): for DefaultStore in DefaultStoreList: Value = SkuInfo.DefaultStoreDict[DefaultStore] IsByteArray, ArrayList = ByteArrayForamt(Value) + if Pcd.DatumType == 'BOOLEAN': + Value = str(int(Value, 0)) if FirstPrint: FirstPrint = False if IsByteArray: @@ -1309,6 +1322,8 @@ class PcdReport(object): else: Value = SkuInfo.DefaultValue IsByteArray, ArrayList = ByteArrayForamt(Value) + if Pcd.DatumType == 'BOOLEAN': + Value = str(int(Value, 0)) if FirstPrint: FirstPrint = False if IsByteArray: -- cgit v1.2.3