]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix StructurePcd offset error.
authorYuwei Chen <yuwei.chen@intel.com>
Wed, 27 Oct 2021 10:00:03 +0000 (18:00 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 8 Nov 2021 03:18:54 +0000 (03:18 +0000)
Currently when parse VFR files to get the struct info,
BOOLEAN type struct is ignored, which caused offset errors.
This patch fixed these bugs.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Scripts/ConvertFceToStructurePcd.py

index 2baabf2dd5212d23e13ed49b9fbfab89559664f9..9e7fe58768b19264e14a7515950db087ce84a6e6 100644 (file)
@@ -142,7 +142,7 @@ class parser_lst(object):
                       line.append(struct)\r
                       unparse.append(line)\r
                   else:\r
-                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:\r
+                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:\r
                       line = [offset, t_name, 0, uint]\r
                       line.append(struct)\r
                       unparse.append(line)\r
@@ -569,7 +569,7 @@ class mainprocess(object):
     for i in List:\r
       for j in i:\r
         tmp = j.split("|")\r
-        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):\r
+        if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'):\r
           tmp[0] = tmp[0][:tmp[0].index('[')]\r
           List[List.index(i)][i.index(j)] = "|".join(tmp)\r
         else:\r