mirror_edk2/BaseTools/Source/Python
Laszlo Ersek 963517211c BaseTools/BuildReport: fix report for platforms/arches without struct PCDs
The goal of commit 97c8f5b9e7 ("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 97c8f5b9e7 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: 97c8f5b9e7
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>
2019-02-06 13:07:21 -08:00
..
AutoGen BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
BPDG BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
build BaseTools/BuildReport: fix report for platforms/arches without struct PCDs 2019-02-06 13:07:21 -08:00
Capsule BaseTools/Capsule: Support capsules without a payload header 2018-08-02 14:35:29 -07:00
Common BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
CommonDataClass BaseTools: Remove unused logic for IPF 2019-01-14 09:34:41 +08:00
Ecc BaseTools/ECC: Add a new type of exception 2019-02-02 10:28:54 +08:00
Eot BaseTools: Eot tool Python3 adaption 2019-02-01 11:09:25 +08:00
GenFds BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
GenPatchPcdTable Revert BaseTools: PYTHON3 migration 2018-10-15 08:29:14 +08:00
PatchPcdValue BaseTools: change the Division Operator 2019-02-01 11:09:21 +08:00
Pkcs7Sign BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
Rsa2048Sha256Sign BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
Table Revert BaseTools: PYTHON3 migration 2018-10-15 08:29:14 +08:00
TargetTool BaseTools: Remove unused logic for IPF 2019-01-14 09:34:41 +08:00
Trim BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
UPT BaseTools: Handle the bytes and str difference 2019-02-01 11:09:24 +08:00
Workspace BaseTools:StructurePCD value display incorrect in "Not used" section. 2019-02-02 10:28:56 +08:00
GNUmakefile Sync BaseTool trunk (version r2599) into EDKII BaseTools. 2013-08-23 02:18:16 +00:00
Makefile BaseTools: Remove the step to freeze python tool 2018-10-19 08:21:47 +08:00
sitecustomize.py BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00