Reviewed-by: Liming Gao <[email protected]>

> -----Original Message-----
> From: Zhu, Yonghong
> Sent: Thursday, November 24, 2016 11:23 PM
> To: [email protected]
> Cc: Gao, Liming <[email protected]>
> 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 <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <[email protected]>
> ---
>  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

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to