summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-11-24 23:19:57 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-11-29 19:49:20 +0800
commit8401d3983d00194b5a9aa77cf65477bfc1716588 (patch)
treea1163f71d8711575889a1d119ae27ecc21916ab3
parent45a70db3c3a59b64e0f517870415963fbfacf507 (diff)
downloadedk2-8401d3983d00194b5a9aa77cf65477bfc1716588.tar.gz
edk2-8401d3983d00194b5a9aa77cf65477bfc1716588.tar.bz2
edk2-8401d3983d00194b5a9aa77cf65477bfc1716588.zip
BaseTools: Fix bug for decimal value of VPDPCD offset display in report
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>
-rw-r--r--BaseTools/Source/Python/build/BuildReport.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index 4c57754b3b..fb28970f66 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1560,7 +1560,10 @@ class FdReport(object):
try:
PcdName, SkuId, Offset, Size, Value = Line.split("#")[0].split("|")
PcdName, SkuId, Offset, Size, Value = PcdName.strip(), SkuId.strip(), Offset.strip(), Size.strip(), Value.strip()
- Offset = '0x%08X' % (int(Offset, 16) + self.VPDBaseAddress)
+ if Offset.lower().startswith('0x'):
+ Offset = '0x%08X' % (int(Offset, 16) + self.VPDBaseAddress)
+ else:
+ Offset = '0x%08X' % (int(Offset, 10) + self.VPDBaseAddress)
self.VPDInfoList.append("%s | %s | %s | %s | %s" % (PcdName, SkuId, Offset, Size, Value))
except:
EdkLogger.error("BuildReport", CODE_ERROR, "Fail to parse VPD information file %s" % self.VpdFilePath)