|
From: <yi...@us...> - 2012-03-29 05:07:41
|
Revision: 2508
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2508&view=rev
Author: yingke
Date: 2012-03-29 05:07:34 +0000 (Thu, 29 Mar 2012)
Log Message:
-----------
Check if PCD name defined in DSC file is declared in DEC files.
Signed-off-by: yingke
Reviewed-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-03-27 05:56:14 UTC (rev 2507)
+++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-03-29 05:07:34 UTC (rev 2508)
@@ -291,22 +291,24 @@
# apply SKU and inject PCDs from Flash Definition file
for Arch in self.ArchList:
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
+
DecPcds = set()
- if PcdSet:
- PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
- Pkgs = PGen.PackageList
- for Pkg in Pkgs:
- for Pcd in Pkg.Pcds.keys():
- DecPcds.add((Pcd[0], Pcd[1]))
+ PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
+ Pkgs = PGen.PackageList
+ for Pkg in Pkgs:
+ for Pcd in Pkg.Pcds.keys():
+ DecPcds.add((Pcd[0], Pcd[1]))
+ Platform.IsPlatformPcdDeclared(DecPcds)
+
Platform.SkuName = self.SkuId
for Name, Guid in PcdSet:
if (Name, Guid) not in DecPcds:
EdkLogger.error(
'build',
- FORMAT_INVALID,
- "PCD (%s.%s) used in FDF is not declared in DEC files. FDF file: %s, line #: %d." % \
- (Guid, Name, self.FdfProfile.PcdFileLineDict[Name, Guid][0], self.FdfProfile.PcdFileLineDict[Name, Guid][1]),
- ExtraData=None
+ PARSER_ERROR,
+ "PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name),
+ File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],
+ Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
)
Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-03-27 05:56:14 UTC (rev 2507)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-03-29 05:07:34 UTC (rev 2508)
@@ -842,6 +842,17 @@
self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)
self.Pcds[Name, Guid].DefaultValue = Value
+ def IsPlatformPcdDeclared(self, DecPcds):
+ for PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG,
+ MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_VPD,
+ MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII, MODEL_PCD_DYNAMIC_EX_VPD):
+ RecordList = self._RawData[PcdType, self._Arch]
+ for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
+ if (PcdCName, TokenSpaceGuid) not in DecPcds:
+ EdkLogger.error('build', PARSER_ERROR,
+ "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),
+ File=self.MetaFile, Line=Dummy4)
+
_Macros = property(_GetMacros)
Arch = property(_GetArch, _SetArch)
Platform = property(_GetPlatformName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|