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.

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>
This commit is contained in:
Yonghong Zhu 2018-10-11 15:04:41 +08:00
parent 27f38c6d6e
commit 15298db95c
1 changed files with 39 additions and 27 deletions

View File

@ -1085,13 +1085,22 @@ class PcdReport(object):
DecMatch = False
elif Pcd.SkuOverrideValues:
DscOverride = False
if Pcd.DefaultFromDSC:
DscOverride = True
else:
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 = list(OverrideValues.keys())
Data = OverrideValues[Keys[0]]
Struct = list(Data.values())[0]
DscOverride = self.ParseStruct(Struct)
Struct = list(Data.values())
DscOverride = self.ParseStruct(Struct[0])
else:
SkuList = sorted(Pcd.SkuInfoList.keys())
for Sku in SkuList:
@ -1116,6 +1125,8 @@ class PcdReport(object):
DscDefaultValue = True
DscMatch = True
DecMatch = False
else:
DecMatch = True
else:
DscDefaultValue = True
DscMatch = True
@ -1270,8 +1281,9 @@ class PcdReport(object):
if OverrideValues:
Keys = list(OverrideValues.keys())
Data = OverrideValues[Keys[0]]
Struct = list(Data.values())[0]
OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct)
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: