public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix bug for decimal value of VPDPCD offset display in report
@ 2016-11-24 15:22 Yonghong Zhu
  2016-11-25  2:16 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2016-11-24 15:22 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

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>
---
 BaseTools/Source/Python/build/BuildReport.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index 4c57754..fb28970 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1558,11 +1558,14 @@ class FdReport(object):
                 if len(Line) == 0 or Line.startswith("#"):
                     continue
                 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)
             fd.close()
 
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Fix bug for decimal value of VPDPCD offset display in report
  2016-11-24 15:22 [Patch] BaseTools: Fix bug for decimal value of VPDPCD offset display in report Yonghong Zhu
@ 2016-11-25  2:16 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2016-11-25  2:16 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Zhu, Yonghong
> Sent: Thursday, November 24, 2016 11:23 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [Patch] 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>
> ---
>  BaseTools/Source/Python/build/BuildReport.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index 4c57754..fb28970 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1558,11 +1558,14 @@ class FdReport(object):
>                  if len(Line) == 0 or Line.startswith("#"):
>                      continue
>                  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)
>              fd.close()
> 
> --
> 2.6.1.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-25  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24 15:22 [Patch] BaseTools: Fix bug for decimal value of VPDPCD offset display in report Yonghong Zhu
2016-11-25  2:16 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox