]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
BaseTools: Fix bug about *M value not display decimal and hexadecimal
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index 27680019dceb5f8a3c5174187c7710f255c0c358..5709cde9d6ca9b14b859779ba1c4f3dc3cee22a2 100644 (file)
@@ -1127,7 +1127,13 @@ class PcdReport(object):
                                 for Array in ArrayList:\r
                                     FileWrite(File, Array)\r
                             else:\r
-                                FileWrite(File, ' *M     %-*s = %s' % (self.MaxLen + 15, ModulePath, ModuleDefault.strip()))\r
+                                Value =  ModuleDefault.strip()\r
+                                if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES:\r
+                                    if Value.startswith(('0x', '0X')):\r
+                                        Value = '{} ({:d})'.format(Value, int(Value, 0))\r
+                                    else:\r
+                                        Value = "0x{:X} ({})".format(int(Value, 0), Value)\r
+                                FileWrite(File, ' *M     %-*s = %s' % (self.MaxLen + 15, ModulePath, Value))\r
 \r
         if ModulePcdSet is None:\r
             FileWrite(File, gSectionEnd)\r