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 <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
committed by
Yonghong Zhu
parent
f413763b6b
commit
cef7ecf6cd
@ -1127,7 +1127,13 @@ class PcdReport(object):
|
|||||||
for Array in ArrayList:
|
for Array in ArrayList:
|
||||||
FileWrite(File, Array)
|
FileWrite(File, Array)
|
||||||
else:
|
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:
|
if ModulePcdSet is None:
|
||||||
FileWrite(File, gSectionEnd)
|
FileWrite(File, gSectionEnd)
|
||||||
|
Reference in New Issue
Block a user