summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Common/Misc.py
diff options
context:
space:
mode:
authorGao, Liming <liming.gao@intel.com>2014-01-10 05:25:50 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-10 05:25:50 +0000
commit2bc3256ca6d439ebf5d85d5e74e5f3e68df14130 (patch)
treecc9a35c905bea5dae72b9758b19f642fc3013e17 /BaseTools/Source/Python/Common/Misc.py
parent8d9e16963ee86478776e2f504a776ec712fb0c77 (diff)
downloadedk2-platforms-2bc3256ca6d439ebf5d85d5e74e5f3e68df14130.tar.xz
Sync BaseTool trunk (version r2640) into EDKII BaseTools.
Signed-off-by: Gao, Liming <liming.gao@intel.com> Reviewed-by: Liu, Jiang A <jiang.a.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15089 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 960581581a..fafd84a0eb 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1238,9 +1238,16 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
Value = FieldList[0]
Size = ''
if len(FieldList) > 1:
- Size = FieldList[1]
+ Type = FieldList[1]
+ # Fix the PCD type when no DataType input
+ if Type == 'VOID*':
+ DataType = 'VOID*'
+ else:
+ Size = FieldList[1]
+ if len(FieldList) > 2:
+ Size = FieldList[2]
if DataType == 'VOID*':
- IsValid = (len(FieldList) <= 2)
+ IsValid = (len(FieldList) <= 3)
else:
IsValid = (len(FieldList) <= 1)
return [Value, '', Size], IsValid, 0
@@ -1255,7 +1262,12 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
Size = FieldList[2]
else:
if Type == 'VOID*':
- Size = str(len(Value))
+ if Value.startswith("L"):
+ Size = str((len(Value)- 3 + 1) * 2)
+ elif Value.startswith("{"):
+ Size = str(len(Value.split(",")))
+ else:
+ Size = str(len(Value) -2 + 1 )
if DataType == 'VOID*':
IsValid = (len(FieldList) <= 3)
else: