]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix bug for decimal value of VPDPCD offset display in report
authorYonghong Zhu <yonghong.zhu@intel.com>
Thu, 24 Nov 2016 15:19:57 +0000 (23:19 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 29 Nov 2016 11:49:20 +0000 (19:49 +0800)
current if we set VPD PCD's offset to a decimal value, eg: 22, this
value is displayed incorrectly in the "FD VPD Region" section in the
report.txt.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/build/BuildReport.py

index 4c57754b3b1eea42fe9ae0c5e24a26702fe91a0d..fb28970f661d58d312ede01218be31ce5e525b77 100644 (file)
@@ -1560,7 +1560,10 @@ class FdReport(object):
                 try:\r
                     PcdName, SkuId, Offset, Size, Value = Line.split("#")[0].split("|")\r
                     PcdName, SkuId, Offset, Size, Value = PcdName.strip(), SkuId.strip(), Offset.strip(), Size.strip(), Value.strip()\r
-                    Offset = '0x%08X' % (int(Offset, 16) + self.VPDBaseAddress)\r
+                    if Offset.lower().startswith('0x'):\r
+                        Offset = '0x%08X' % (int(Offset, 16) + self.VPDBaseAddress)\r
+                    else:\r
+                        Offset = '0x%08X' % (int(Offset, 10) + self.VPDBaseAddress)\r
                     self.VPDInfoList.append("%s | %s | %s | %s | %s" % (PcdName, SkuId, Offset, Size, Value))\r
                 except:\r
                     EdkLogger.error("BuildReport", CODE_ERROR, "Fail to parse VPD information file %s" % self.VpdFilePath)\r