From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd
Date: Mon, 22 Oct 2018 07:55:31 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E34CC56@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1539933085-9728-1-git-send-email-yonghong.zhu@intel.com>
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
prev parent reply other threads:[~2018-10-22 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E34CC56@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox