diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-10-15 14:51:55 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-10-15 15:26:48 +0800 |
commit | f88113789b3d6f0d29a3cf29bca3ce1a872d29b6 (patch) | |
tree | aaeb524516db6a6c67f48230a6451a35dc857bae /BaseTools | |
parent | 425084cd45860df8959ea1f890ca0e855d2a6220 (diff) | |
download | edk2-f88113789b3d6f0d29a3cf29bca3ce1a872d29b6.zip edk2-f88113789b3d6f0d29a3cf29bca3ce1a872d29b6.tar.gz edk2-f88113789b3d6f0d29a3cf29bca3ce1a872d29b6.tar.bz2 |
BaseTools: Enhance the *P Flag display for Structure Pcd
Cover the case:
1.only define the structure Pcd in DEC file, it should not have any
Flag.
2.In the DEC file and DSC file only have the PCD's default value, and
without the field value, it should have *P Flag.
(re-add this patch since it be reverted in Python3 migration patches,
but this patch is not related with Python3)
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/build/BuildReport.py | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 4fe29f1..50db503 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1079,37 +1079,48 @@ class PcdReport(object): DecMatch = False
elif Pcd.SkuOverrideValues:
DscOverride = False
- if not Pcd.SkuInfoList:
- OverrideValues = Pcd.SkuOverrideValues
- if OverrideValues:
- Keys = OverrideValues.keys()
- Data = OverrideValues[Keys[0]]
- Struct = Data.values()[0]
- DscOverride = self.ParseStruct(Struct)
+ if Pcd.DefaultFromDSC:
+ DscOverride = True
else:
- SkuList = sorted(Pcd.SkuInfoList.keys())
- for Sku in SkuList:
- SkuInfo = Pcd.SkuInfoList[Sku]
- if TypeName in ('DYNHII', 'DEXHII'):
- if SkuInfo.DefaultStoreDict:
- DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
- for DefaultStore in DefaultStoreList:
- OverrideValues = Pcd.SkuOverrideValues[Sku]
- DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
- if DscOverride:
- break
- else:
- OverrideValues = Pcd.SkuOverrideValues[Sku]
+ DictLen = 0
+ for item in Pcd.SkuOverrideValues:
+ DictLen += len(Pcd.SkuOverrideValues[item])
+ if not DictLen:
+ DscOverride = False
+ else:
+ if not Pcd.SkuInfoList:
+ OverrideValues = Pcd.SkuOverrideValues
if OverrideValues:
- Keys = OverrideValues.keys()
- OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
- DscOverride = self.ParseStruct(OverrideFieldStruct)
- if DscOverride:
- break
+ Keys = list(OverrideValues.keys())
+ Data = OverrideValues[Keys[0]]
+ Struct = list(Data.values())
+ DscOverride = self.ParseStruct(Struct[0])
+ else:
+ SkuList = sorted(Pcd.SkuInfoList.keys())
+ for Sku in SkuList:
+ SkuInfo = Pcd.SkuInfoList[Sku]
+ if TypeName in ('DYNHII', 'DEXHII'):
+ if SkuInfo.DefaultStoreDict:
+ DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
+ for DefaultStore in DefaultStoreList:
+ OverrideValues = Pcd.SkuOverrideValues[Sku]
+ DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
+ if DscOverride:
+ break
+ else:
+ OverrideValues = Pcd.SkuOverrideValues[Sku]
+ if OverrideValues:
+ Keys = list(OverrideValues.keys())
+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
+ DscOverride = self.ParseStruct(OverrideFieldStruct)
+ if DscOverride:
+ break
if DscOverride:
DscDefaultValue = True
DscMatch = True
DecMatch = False
+ else:
+ DecMatch = True
else:
DscDefaultValue = True
DscMatch = True
@@ -1256,11 +1267,12 @@ class PcdReport(object): if IsStructure:
OverrideValues = Pcd.SkuOverrideValues
if OverrideValues:
- Keys = OverrideValues.keys()
+ Keys = list(OverrideValues.keys())
Data = OverrideValues[Keys[0]]
- Struct = Data.values()[0]
- OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct)
- self.PrintStructureInfo(File, OverrideFieldStruct)
+ Struct = list(Data.values())
+ if Struct:
+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
+ self.PrintStructureInfo(File, OverrideFieldStruct)
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
else:
FirstPrint = True
|