summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/build/BuildReport.py
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2019-02-05 03:22:13 -0800
committerJaben Carsey <jaben.carsey@intel.com>2019-02-06 13:07:21 -0800
commit963517211cae1ad38984821061ad7982c448f934 (patch)
tree867c94fb5b3ecc404d48ced8de1770443144c142 /BaseTools/Source/Python/build/BuildReport.py
parent3b6c73f13eac3dc8bf7deb95237cd3f6abf40ce3 (diff)
downloadedk2-963517211cae1ad38984821061ad7982c448f934.tar.gz
edk2-963517211cae1ad38984821061ad7982c448f934.tar.bz2
edk2-963517211cae1ad38984821061ad7982c448f934.zip
BaseTools/BuildReport: fix report for platforms/arches without struct PCDs
The goal of commit 97c8f5b9e7d3 ("BaseTools:StructurePCD value display incorrect in "Not used" section.", 2019-02-02) was to display the full contents of such structure PCDs in the build report that were set in the platform DSC or the FDF, but not used in any module INFs. The listings would appear in the PCDs not used by modules or in conditional directives section of the build report. Commit 97c8f5b9e7d3 assumed that any (platform, architecture) combination would have a (possibly empty) set of structure PCD (and so the set of the structure PCDs could be filtered for set-but-unused ones). This is not the case: in "DscBuildData.py", in method UpdateStructuredPcds(), if "S_pcd_set" remains an empty OrderedDict(), then it is not added to "GlobalData.gStructurePcd" *at all*, for the current (platform, architecture) combination. As a result, when the PCD report tries to fetch the set of structure PCDs for the current (platform, architecture), "GlobalData.gStructurePcd" does not return an empty OrderedDict(); instead, it raises a KeyError. Fix it by defaulting to an empty OrderedDict(), with the get() method. Reported-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1513 Fixes: 97c8f5b9e7d3136b6051a05cf056ce5ca9e79893 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/build/BuildReport.py')
-rw-r--r--BaseTools/Source/Python/build/BuildReport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index e457660fce..0b98d62cb6 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -780,7 +780,7 @@ class PcdReport(object):
# Collect the PCD defined in DSC/FDF file, but not used in module
#
UnusedPcdFullList = []
- StructPcdDict = GlobalData.gStructurePcd[self.Arch]
+ StructPcdDict = GlobalData.gStructurePcd.get(self.Arch, collections.OrderedDict())
for Name, Guid in StructPcdDict:
if (Name, Guid) not in Pa.Platform.Pcds:
Pcd = StructPcdDict[(Name, Guid)]