public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Yonghong Zhu <yonghong.zhu@intel.com>
To: edk2-devel@lists.01.org
Subject: [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd
Date: Fri, 19 Oct 2018 15:11:25 +0800	[thread overview]
Message-ID: <1539933085-9728-1-git-send-email-yonghong.zhu@intel.com> (raw)

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



             reply	other threads:[~2018-10-19  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19  7:11 Yonghong Zhu [this message]
2018-10-22  7:55 ` [Patch] BaseTools: Fix the *B and *F Flag display for Structure Pcd Gao, Liming

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=1539933085-9728-1-git-send-email-yonghong.zhu@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