]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/Misc.py
Sync BaseTool trunk (version r2640) into EDKII BaseTools.
[mirror_edk2.git] / BaseTools / Source / Python / Common / Misc.py
index 960581581a7eb6a731d501afb99434bb0cce4273..fafd84a0eb84444cb70a0f36dc3463bbd82655a2 100644 (file)
@@ -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: