* Re: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
[not found] <16578345A54B07F9.2692@groups.io>
@ 2021-01-13 23:34 ` Bob Feng
0 siblings, 0 replies; 2+ messages in thread
From: Bob Feng @ 2021-01-13 23:34 UTC (permalink / raw)
To: devel@edk2.groups.io, Feng, Bob C; +Cc: Liming Gao, Chen, Christine
Hi Liming,
Would you please review this patch?
Thanks,
Bob
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob Feng
Sent: Wednesday, January 6, 2021 10:22 AM
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Patch 1/1] BaseTools: Fix the build report crash issue
@ 2021-01-06 2:21 Bob Feng
2021-01-14 0:46 ` 回复: [edk2-devel] " gaoliming
0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2021-01-06 2:21 UTC (permalink / raw)
To: devel; +Cc: Liming Gao, Yuwei Chen
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* 回复: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
2021-01-06 2:21 Bob Feng
@ 2021-01-14 0:46 ` gaoliming
2021-01-14 3:55 ` Bob Feng
0 siblings, 1 reply; 2+ messages in thread
From: gaoliming @ 2021-01-14 0:46 UTC (permalink / raw)
To: devel, bob.c.feng; +Cc: 'Yuwei Chen'
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
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
2021-01-14 0:46 ` 回复: [edk2-devel] " gaoliming
@ 2021-01-14 3:55 ` Bob Feng
0 siblings, 0 replies; 2+ messages in thread
From: Bob Feng @ 2021-01-14 3:55 UTC (permalink / raw)
To: devel@edk2.groups.io, gaoliming@byosoft.com.cn; +Cc: Chen, Christine
Create a PR. https://github.com/tianocore/edk2/pull/1352
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Thursday, January 14, 2021 8:46 AM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Chen, Christine <yuwei.chen@intel.com>
Subject: 回复: [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue
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
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-14 3:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <16578345A54B07F9.2692@groups.io>
2021-01-13 23:34 ` [edk2-devel] [Patch 1/1] BaseTools: Fix the build report crash issue Bob Feng
2021-01-06 2:21 Bob Feng
2021-01-14 0:46 ` 回复: [edk2-devel] " gaoliming
2021-01-14 3:55 ` Bob Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox