* [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd
@ 2018-10-19 7:11 Yonghong Zhu
2018-10-22 7:55 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-10-19 7:11 UTC (permalink / raw)
To: edk2-devel
Because of we newly add the PcdFieldValueFromComm and
PcdFieldValueFromFdf in early parser phase, so in the report we use
the saved value in this two variables to print it.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/Python/build/BuildReport.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index a66adfb..c648086 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1072,13 +1072,17 @@ class PcdReport(object):
SkuInfoList = Pcd.SkuInfoList
Pcd = GlobalData.gStructurePcd[self.Arch][(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)]
Pcd.DatumType = Pcd.StructName
if TypeName in ('DYNVPD', 'DEXVPD'):
Pcd.SkuInfoList = SkuInfoList
- if Pcd.PcdFieldValueFromComm:
+ if Pcd.PcdValueFromComm or Pcd.PcdFieldValueFromComm:
BuildOptionMatch = True
DecMatch = False
+ elif Pcd.PcdValueFromFdf or Pcd.PcdFieldValueFromFdf:
+ DscDefaultValue = True
+ DscMatch = True
+ DecMatch = False
elif Pcd.SkuOverrideValues:
DscOverride = False
if Pcd.DefaultFromDSC:
DscOverride = True
else:
@@ -1264,18 +1268,22 @@ class PcdReport(object):
Value = '{} ({:d})'.format(Value, int(Value, 0))
else:
Value = "0x{:X} ({})".format(int(Value, 0), Value)
FileWrite(File, ' %-*s : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
if IsStructure:
+ FiledOverrideFlag = False
OverrideValues = Pcd.SkuOverrideValues
if OverrideValues:
for Data in OverrideValues.values():
Struct = list(Data.values())
if Struct:
OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
self.PrintStructureInfo(File, OverrideFieldStruct)
+ FiledOverrideFlag = True
break
+ if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or Pcd.PcdFieldValueFromFdf):
+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, {})
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
else:
FirstPrint = True
SkuList = sorted(Pcd.SkuInfoList.keys())
for Sku in SkuList:
@@ -1391,15 +1399,19 @@ class PcdReport(object):
else:
FileWrite(File, ' %-*s : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
if TypeName in ('DYNVPD', 'DEXVPD'):
FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
if IsStructure:
+ FiledOverrideFlag = False
OverrideValues = Pcd.SkuOverrideValues[Sku]
if OverrideValues:
Keys = OverrideValues.keys()
OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
self.PrintStructureInfo(File, OverrideFieldStruct)
+ FiledOverrideFlag = True
+ if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or Pcd.PcdFieldValueFromFdf):
+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, {})
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
def OverrideFieldValue(self, Pcd, OverrideStruct):
OverrideFieldStruct = collections.OrderedDict()
if OverrideStruct:
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd
2018-10-19 7:11 [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd Yonghong Zhu
@ 2018-10-22 7:55 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-10-22 7:55 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Friday, October 19, 2018 3:11 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Fix the *B and *F Flag display for Structure
>Pcd
>
>Because of we newly add the PcdFieldValueFromComm and
>PcdFieldValueFromFdf in early parser phase, so in the report we use
>the saved value in this two variables to print it.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/build/BuildReport.py | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/build/BuildReport.py
>b/BaseTools/Source/Python/build/BuildReport.py
>index a66adfb..c648086 100644
>--- a/BaseTools/Source/Python/build/BuildReport.py
>+++ b/BaseTools/Source/Python/build/BuildReport.py
>@@ -1072,13 +1072,17 @@ class PcdReport(object):
> SkuInfoList = Pcd.SkuInfoList
> Pcd = GlobalData.gStructurePcd[self.Arch][(Pcd.TokenCName,
>Pcd.TokenSpaceGuidCName)]
> Pcd.DatumType = Pcd.StructName
> if TypeName in ('DYNVPD', 'DEXVPD'):
> Pcd.SkuInfoList = SkuInfoList
>- if Pcd.PcdFieldValueFromComm:
>+ if Pcd.PcdValueFromComm or Pcd.PcdFieldValueFromComm:
> BuildOptionMatch = True
> DecMatch = False
>+ elif Pcd.PcdValueFromFdf or Pcd.PcdFieldValueFromFdf:
>+ DscDefaultValue = True
>+ DscMatch = True
>+ DecMatch = False
> elif Pcd.SkuOverrideValues:
> DscOverride = False
> if Pcd.DefaultFromDSC:
> DscOverride = True
> else:
>@@ -1264,18 +1268,22 @@ class PcdReport(object):
> Value = '{} ({:d})'.format(Value, int(Value, 0))
> else:
> Value = "0x{:X} ({})".format(int(Value, 0), Value)
> FileWrite(File, ' %-*s : %6s %10s = %s' % (self.MaxLen, Flag + ' ' +
>PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
> if IsStructure:
>+ FiledOverrideFlag = False
> OverrideValues = Pcd.SkuOverrideValues
> if OverrideValues:
> for Data in OverrideValues.values():
> Struct = list(Data.values())
> if Struct:
> OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
> self.PrintStructureInfo(File, OverrideFieldStruct)
>+ FiledOverrideFlag = True
> break
>+ if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or
>Pcd.PcdFieldValueFromFdf):
>+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, {})
> self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue,
>InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
> else:
> FirstPrint = True
> SkuList = sorted(Pcd.SkuInfoList.keys())
> for Sku in SkuList:
>@@ -1391,15 +1399,19 @@ class PcdReport(object):
> else:
> FileWrite(File, ' %-*s : %6s %10s %10s = %s' % (self.MaxLen, '
>', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
> if TypeName in ('DYNVPD', 'DEXVPD'):
> FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
> if IsStructure:
>+ FiledOverrideFlag = False
> OverrideValues = Pcd.SkuOverrideValues[Sku]
> if OverrideValues:
> Keys = OverrideValues.keys()
> OverrideFieldStruct = self.OverrideFieldValue(Pcd,
>OverrideValues[Keys[0]])
> self.PrintStructureInfo(File, OverrideFieldStruct)
>+ FiledOverrideFlag = True
>+ if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or
>Pcd.PcdFieldValueFromFdf):
>+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, {})
> self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch,
>DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
>
> def OverrideFieldValue(self, Pcd, OverrideStruct):
> OverrideFieldStruct = collections.OrderedDict()
> if OverrideStruct:
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-22 7:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-19 7:11 [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd Yonghong Zhu
2018-10-22 7:55 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox