summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Common
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r--BaseTools/Source/Python/Common/BuildVersion.py2
-rw-r--r--BaseTools/Source/Python/Common/DataType.py2
-rw-r--r--BaseTools/Source/Python/Common/Misc.py18
-rw-r--r--BaseTools/Source/Python/Common/String.py30
4 files changed, 35 insertions, 17 deletions
diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Source/Python/Common/BuildVersion.py
index 2a3b0aa68..4decd82c7 100644
--- a/BaseTools/Source/Python/Common/BuildVersion.py
+++ b/BaseTools/Source/Python/Common/BuildVersion.py
@@ -13,4 +13,4 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
-gBUILD_VERSION = "Build 2610"
+gBUILD_VERSION = "Build 2640"
diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py
index dbe7215f4..cd420d168 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -486,6 +486,8 @@ PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
+SECTIONS_HAVE_ITEM_PCD = [PCDS_DYNAMIC_DEFAULT.upper(),PCDS_DYNAMIC_VPD.upper(),PCDS_DYNAMIC_HII.upper(), \
+ PCDS_DYNAMICEX_DEFAULT.upper(),PCDS_DYNAMICEX_VPD.upper(),PCDS_DYNAMICEX_HII.upper()]
# Section allowed to have items after arch
SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
PCDS_DYNAMIC_DEFAULT.upper(),
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 960581581..fafd84a0e 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:
diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Python/Common/String.py
index c28232667..04b45a0b8 100644
--- a/BaseTools/Source/Python/Common/String.py
+++ b/BaseTools/Source/Python/Common/String.py
@@ -401,16 +401,6 @@ def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyl
Comment = Line[Index:].strip()
Line = Line[0:Index].strip()
break
- if Comment:
- # Remove prefixed and trailing comment characters
- Start = 0
- End = len(Comment)
- while Start < End and Comment.startswith(CommentCharacter, Start, End):
- Start += 1
- while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
- End -= 1
- Comment = Comment[Start:End]
- Comment = Comment.strip()
return Line, Comment
@@ -811,11 +801,25 @@ def StringToArray(String):
return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String[2:-1]])
elif String.startswith('"'):
if String == "\"\"":
- return "{0x00}";
+ return "{0x00,0x00}"
else:
- return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ StringLen = len(String[1:-1])
+ if StringLen % 2:
+ return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ else:
+ return "{%s, 0x00,0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ elif String.startswith('{'):
+ StringLen = len(String.split(","))
+ if StringLen % 2:
+ return "{%s, 0x00}" % ", ".join([ C for C in String[1:-1].split(',')])
+ else:
+ return "{%s}" % ", ".join([ C for C in String[1:-1].split(',')])
+
else:
- return '{%s, 0}' % ', '.join(String.split())
+ if len(String.split()) % 2:
+ return '{%s, 0}' % ', '.join(String.split())
+ else:
+ return '{%s, 0,0}' % ', '.join(String.split())
def StringArrayLength(String):
if isinstance(String, unicode):