public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: <devel@edk2.groups.io>, <bob.c.feng@intel.com>
Cc: "'Yuwei Chen'" <yuwei.chen@intel.com>
Subject: 回复: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
Date: Thu, 14 Jan 2021 08:46:25 +0800	[thread overview]
Message-ID: <00fe01d6ea0e$b03e8f60$10bbae20$@byosoft.com.cn> (raw)
In-Reply-To: <20210106022157.1748-1-bob.c.feng@intel.com>

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: bounce+27952+69772+4905953+8761045@groups.io
> <bounce+27952+69772+4905953+8761045@groups.io> 代表 Bob Feng
> 发送时间: 2021年1月6日 10:22
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Yuwei Chen
> <yuwei.chen@intel.com>
> 主题: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
> 
> In the following corner case, the build report
> will crash. This patch is to fix this problem.
> 
> Case:
> Multiple SKU are used and 2 more DynamicHii structure Pcds
> are set in dsc file under different SKU. And 1 more of those
> Pcds are not used in any INF file.
> 
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  BaseTools/Source/Python/build/BuildReport.py | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index 3b1add9999d2..468772930ca1 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1123,14 +1123,15 @@ class PcdReport(object):
>                                          for Sku in SkuList:
>                                              SkuInfo =
> Pcd.SkuInfoList[Sku]
>                                              if
> SkuInfo.DefaultStoreDict:
>                                                  DefaultStoreList
> = sorted(SkuInfo.DefaultStoreDict.keys())
>                                                  for DefaultStore
> in DefaultStoreList:
> -
> OverrideValues = Pcd.SkuOverrideValues[Sku]
> -
> DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
> -                                                    if
> DscOverride:
> -                                                        break
> +
> OverrideValues = Pcd.SkuOverrideValues.get(Sku)
> +                                                    if
> OverrideValues:
> +
> DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
> +                                                        if
> DscOverride:
> +
> break
>                                              if DscOverride:
>                                                  break
>                              if DscOverride:
>                                  DscDefaultValue = True
>                                  DscMatch = True
> @@ -1386,13 +1387,14 @@ class PcdReport(object):
>                                          FileWrite(File,
> ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' +
> Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))
>                                      else:
>                                          FileWrite(File,
> ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' +
> Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')',
Value))
>                              FileWrite(File, '%*s: %s: %s' %
> (self.MaxLen + 4, SkuInfo.VariableGuid, SkuInfo.VariableName,
> SkuInfo.VariableOffset))
>                              if IsStructure:
> -                                OverrideValues =
> Pcd.SkuOverrideValues[Sku]
> -                                OverrideFieldStruct =
> self.OverrideFieldValue(Pcd, OverrideValues[DefaultStore])
> -                                self.PrintStructureInfo(File,
> OverrideFieldStruct)
> +                                OverrideValues =
> Pcd.SkuOverrideValues.get(Sku)
> +                                if OverrideValues:
> +                                    OverrideFieldStruct =
> self.OverrideFieldValue(Pcd, OverrideValues[DefaultStore])
> +                                    self.PrintStructureInfo(File,
> OverrideFieldStruct)
>                              self.PrintPcdDefault(File, Pcd, IsStructure,
> DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch,
> DecDefaultValue)
>                  else:
>                      Value = SkuInfo.DefaultValue
>                      IsByteArray, ArrayList = ByteArrayForamt(Value)
>                      if Pcd.DatumType == 'BOOLEAN':
> --
> 2.29.1.windows.1
> 
> 
> 
> 
> 




  parent reply	other threads:[~2021-01-14  0:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  2:21 [Patch 1/1] BaseTools: Fix the build report crash issue Bob Feng
2021-01-14  0:31 ` Yuwei Chen
2021-01-14  0:46 ` gaoliming [this message]
2021-01-14  3:55   ` [edk2-devel] " Bob Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00fe01d6ea0e$b03e8f60$10bbae20$@byosoft.com.cn' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox