X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fpcd%2Faction%2FPlatformPcdPreprocessActionForBuilding.java;h=7dd90886b9dbaae33c89c9d68fcf5ceed9b0a121;hp=fd1ae56eb646bcfd71281f3ce6fa30a753e0a5b4;hb=e55d8a3c6b8bdf3a228ae4d9f8afbdecdd36444b;hpb=d7506e116ace59bd37165137a6de1aa6d0fb50fa diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java index fd1ae56eb6..7dd90886b9 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java @@ -28,18 +28,19 @@ import java.util.Map; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions; +import org.tianocore.PcdBuildDefinitionDocument; import org.tianocore.PlatformSurfaceAreaDocument; +import org.tianocore.build.exception.PlatformPcdPreprocessBuildException; import org.tianocore.build.fpd.FpdParserTask; import org.tianocore.build.global.GlobalData; import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.pcd.action.ActionMessage; -import org.tianocore.pcd.entity.ModulePcdInfoFromFpd; +import org.tianocore.pcd.action.PlatformPcdPreprocessAction; import org.tianocore.pcd.entity.MemoryDatabaseManager; +import org.tianocore.pcd.entity.ModulePcdInfoFromFpd; import org.tianocore.pcd.entity.Token; import org.tianocore.pcd.entity.UsageIdentification; import org.tianocore.pcd.exception.EntityException; -import org.tianocore.pcd.action.PlatformPcdPreprocessAction; -import org.tianocore.build.exception.PlatformPcdPreprocessBuildException; import org.tianocore.pcd.exception.PlatformPcdPreprocessException; /** @@ -120,7 +121,9 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces **/ public void execute() throws PlatformPcdPreprocessBuildException { - String errorMessageHeader = "Fail to initialize Pcd memory database for building. Because:"; + String errorMessageHeader = "Fail to initialize Pcd memory database for building. Because:"; + String errorsForPreprocess = null; + // // Get memoryDatabaseManager instance from GlobalData. // The memoryDatabaseManager should be initialized as static variable @@ -138,6 +141,10 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces } catch (PlatformPcdPreprocessException exp) { throw new PlatformPcdPreprocessBuildException(errorMessageHeader + exp.getMessage()); } + errorsForPreprocess = this.getErrorString(); + if (errorsForPreprocess != null) { + throw new PlatformPcdPreprocessBuildException(errorMessageHeader + "\r\n" + errorsForPreprocess); + } // // Generate for PEI, DXE PCD DATABASE's definition and initialization. @@ -228,7 +235,10 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces id.getArch(), id.getModule().getVersion(), id.getModule().getModuleType()); - allModules.add(new ModulePcdInfoFromFpd(usageId, pcdBuildDefinitions.get(id))); + allModules.add( + new ModulePcdInfoFromFpd( + usageId, + ((PcdBuildDefinitionDocument)pcdBuildDefinitions.get(id)).getPcdBuildDefinition())); } return allModules; } @@ -542,7 +552,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces return exceptionString; } } else { - exceptionString = String.format("[FPD file error] The datum type of PCD %s in %s is VOID*. For VOID* type, you have three format choise:\n "+ + exceptionString = String.format("[FPD file error] The datum type of PCD %s in %s is VOID*. For VOID* type, you have three format choise:\n"+ "1) UNICODE string: like L\"xxxx\";\r\n"+ "2) ANSIC string: like \"xxx\";\r\n"+ "3) Byte array: like {0x2, 0x45, 0x23}\r\n"+ @@ -602,19 +612,18 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces "PCD entry %s in module %s!", token.cName, moduleName); - throw new PlatformPcdPreprocessException(exceptionString); + putError(exceptionString); + return null; } dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList(); for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) { - try { - tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName()); - } catch (Exception e) { - throw new PlatformPcdPreprocessException ("Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName()); - } + tokenSpaceStrRet = this.getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName()); if (tokenSpaceStrRet == null) { - throw new PlatformPcdPreprocessException ("Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName()); + exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName(); + putError(exceptionString); + continue; } dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(), @@ -655,6 +664,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces dynamicPcdBuildDefinitions = fpdDocInstance.getPlatformSurfaceArea().getDynamicPcdBuildDefinitions(); if (dynamicPcdBuildDefinitions == null) { + putError("There is no in FPD file!"); return null; }