BaseTools: Fix build report for *P and *M flag incorrectly
authorYunhua Feng <yunhuax.feng@intel.com>
Mon, 16 Jul 2018 08:05:42 +0000 (16:05 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 25 Jul 2018 02:51:45 +0000 (10:51 +0800)
Flag *M for INF defined value and DSC components value
Flag *P only for platform defined value

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/build/BuildReport.py

index 176a390..2768001 100644 (file)
@@ -963,6 +963,11 @@ class PcdReport(object):
                 DecDefaultValue = self.DecPcdDefault.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, DecType))\r
                 DscDefaultValue = self.DscPcdDefault.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName))\r
                 DscDefaultValBak = DscDefaultValue\r
+                Field = ''\r
+                for (CName, Guid, Field) in self.FdfPcdSet:\r
+                    if CName == PcdTokenCName and Guid == Key:\r
+                        DscDefaultValue = self.FdfPcdSet[(CName, Guid, Field)]\r
+                        break\r
                 DscDefaultValue = self.FdfPcdSet.get((Pcd.TokenCName, Key), DscDefaultValue)\r
                 if DscDefaultValue != DscDefaultValBak:\r
                     try:\r
@@ -975,13 +980,14 @@ class PcdReport(object):
                 PcdValue = DecDefaultValue\r
                 if DscDefaultValue:\r
                     PcdValue = DscDefaultValue\r
+                Pcd.DefaultValue = PcdValue\r
                 if ModulePcdSet is not None:\r
                     if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in ModulePcdSet:\r
                         continue\r
-                    InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]\r
+                    InfDefaultValue, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]\r
                     Pcd.DefaultValue = PcdValue\r
-                    if InfDefault == "":\r
-                        InfDefault = None\r
+                    if InfDefaultValue == "":\r
+                        InfDefaultValue = None\r
 \r
                 BuildOptionMatch = False\r
                 if GlobalData.BuildOptionPcd:\r
@@ -1084,13 +1090,15 @@ class PcdReport(object):
                 #\r
                 # Report PCD item according to their override relationship\r
                 #\r
-                if DecMatch and InfMatch:\r
+                if DecMatch:\r
                     self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, '  ')\r
+                elif InfDefaultValue and InfMatch:\r
+                    self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, '*M')\r
                 elif BuildOptionMatch:\r
                     self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, '*B')\r
                 else:\r
-                    if DscMatch:\r
-                        if (Pcd.TokenCName, Key) in self.FdfPcdSet:\r
+                    if DscDefaultValue and DscMatch:\r
+                        if (Pcd.TokenCName, Key, Field) in self.FdfPcdSet:\r
                             self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, '*F')\r
                         else:\r
                             self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, '*P')\r