From: Yunhua Feng Date: Tue, 24 Jul 2018 11:30:11 +0000 (+0800) Subject: BaseTools: Fix bug about *M value not display decimal and hexadecimal X-Git-Tag: edk2-stable201903~1338 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=cef7ecf6cdb44de1520c5d0be9b2c982b59eabc4 BaseTools: Fix bug about *M value not display decimal and hexadecimal V2: Add the check for Pcd DatumType report format like as below: *M Shell.inf = 0xFF (255) Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 27680019dc..5709cde9d6 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1127,7 +1127,13 @@ class PcdReport(object): for Array in ArrayList: FileWrite(File, Array) else: - FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, ModuleDefault.strip())) + Value = ModuleDefault.strip() + if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES: + if Value.startswith(('0x', '0X')): + Value = '{} ({:d})'.format(Value, int(Value, 0)) + else: + Value = "0x{:X} ({})".format(int(Value, 0), Value) + FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, Value)) if ModulePcdSet is None: FileWrite(File, gSectionEnd)