summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-06 07:26:05 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-06 07:26:05 +0000
commite55d8a3c6b8bdf3a228ae4d9f8afbdecdd36444b (patch)
tree62b545ca477f51b725c21a08929a2b7e4e029e22 /Tools/Source/GenBuild
parentd7506e116ace59bd37165137a6de1aa6d0fb50fa (diff)
downloadedk2-platforms-e55d8a3c6b8bdf3a228ae4d9f8afbdecdd36444b.tar.xz
In preprocess for getting platform PCD information, if meet error, put error into stack but not stop immediately, all errors will be summaried after preprocess working.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1194 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java36
1 files changed, 23 insertions, 13 deletions
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 <DynamicPcdBuildDefinitions> in FPD file!");
return null;
}