public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
@ 2021-10-27 10:00 Yuwei Chen
  2021-10-29  2:01 ` 回复: " gaoliming
  2021-11-08  2:38 ` Bob Feng
  0 siblings, 2 replies; 5+ messages in thread
From: Yuwei Chen @ 2021-10-27 10:00 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

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>
---
 BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py
index 2baabf2dd521..9e7fe58768b1 100644
--- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
+++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
@@ -142,7 +142,7 @@ class parser_lst(object):
                       line.append(struct)
                       unparse.append(line)
                   else:
-                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
+                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:
                       line = [offset, t_name, 0, uint]
                       line.append(struct)
                       unparse.append(line)
@@ -569,7 +569,7 @@ class mainprocess(object):
     for i in List:
       for j in i:
         tmp = j.split("|")
-        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):
+        if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'):
           tmp[0] = tmp[0][:tmp[0].index('[')]
           List[List.index(i)][i.index(j)] = "|".join(tmp)
         else:
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* 回复: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
  2021-10-27 10:00 [PATCH 1/1] BaseTools: Fix StructurePcd offset error Yuwei Chen
@ 2021-10-29  2:01 ` gaoliming
  2021-10-29  5:35   ` Yuwei Chen
  2021-11-08  2:38 ` Bob Feng
  1 sibling, 1 reply; 5+ messages in thread
From: gaoliming @ 2021-10-29  2:01 UTC (permalink / raw)
  To: 'Yuwei Chen', devel; +Cc: 'Bob Feng'

Yuwei: 

> -----邮件原件-----
> 发件人: Yuwei Chen <yuwei.chen@intel.com>
> 发送时间: 2021年10月27日 18:00
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>
> 主题: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> 
> 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>
> ---
>  BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> index 2baabf2dd521..9e7fe58768b1 100644
> --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> @@ -142,7 +142,7 @@ class parser_lst(object):
>                        line.append(struct)
>                        unparse.append(line)
>                    else:
> -                    if uint not in ['UINT8', 'UINT16', 'UINT32',
> 'UINT64']:
> +                    if uint not in ['UINT8', 'UINT16', 'UINT32',
'UINT64',
> 'BOOLEAN']:
>                        line = [offset, t_name, 0, uint]
>                        line.append(struct)
>                        unparse.append(line)
> @@ -569,7 +569,7 @@ class mainprocess(object):
>      for i in List:
>        for j in i:
>          tmp = j.split("|")
> -        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0,
0x0}'):
> +        if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip()
== '{0x0,
> 0x0}'):

Why split '#'?

Thanks
Liming
>            tmp[0] = tmp[0][:tmp[0].index('[')]
>            List[List.index(i)][i.index(j)] = "|".join(tmp)
>          else:
> --
> 2.27.0.windows.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
  2021-10-29  2:01 ` 回复: " gaoliming
@ 2021-10-29  5:35   ` Yuwei Chen
  2021-11-02  1:26     ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 5+ messages in thread
From: Yuwei Chen @ 2021-10-29  5:35 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io; +Cc: Feng, Bob C

Hi Liming,

As the comments have been added to each StructurePcd (https://edk2.groups.io/g/devel/message/68378?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2CStructurePcd%2C20%2C2%2C20%2C78773894), the tmp[1] will have not only the "{0x0,0x0}" value but also the "# comments". If not split with "#", it will generate error format for value "{0x0, 0x0}" StructurePcd.

Thanks,
Christine (Yuwei)

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Friday, October 29, 2021 10:02 AM
> To: Chen, Christine <yuwei.chen@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: 回复: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> 
> Yuwei:
> 
> > -----邮件原件-----
> > 发件人: Yuwei Chen <yuwei.chen@intel.com>
> > 发送时间: 2021年10月27日 18:00
> > 收件人: devel@edk2.groups.io
> > 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>
> > 主题: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> >
> > 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>
> > ---
> >  BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > index 2baabf2dd521..9e7fe58768b1 100644
> > --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > @@ -142,7 +142,7 @@ class parser_lst(object):
> >                        line.append(struct)
> >                        unparse.append(line)
> >                    else:
> > -                    if uint not in ['UINT8', 'UINT16', 'UINT32',
> > 'UINT64']:
> > +                    if uint not in ['UINT8', 'UINT16', 'UINT32',
> 'UINT64',
> > 'BOOLEAN']:
> >                        line = [offset, t_name, 0, uint]
> >                        line.append(struct)
> >                        unparse.append(line) @@ -569,7 +569,7 @@ class
> > mainprocess(object):
> >      for i in List:
> >        for j in i:
> >          tmp = j.split("|")
> > -        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0,
> 0x0}'):
> > +        if (('L"' in j) and ("[" in j)) or
> > + (tmp[1].split("#")[0].strip()
> == '{0x0,
> > 0x0}'):
> 
> Why split '#'?
> 
> Thanks
> Liming
> >            tmp[0] = tmp[0][:tmp[0].index('[')]
> >            List[List.index(i)][i.index(j)] = "|".join(tmp)
> >          else:
> > --
> > 2.27.0.windows.1
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
  2021-10-29  5:35   ` Yuwei Chen
@ 2021-11-02  1:26     ` gaoliming
  0 siblings, 0 replies; 5+ messages in thread
From: gaoliming @ 2021-11-02  1:26 UTC (permalink / raw)
  To: devel, yuwei.chen; +Cc: 'Feng, Bob C'

Yuwei:
  Thanks for your information. I have no other comment for this change. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Yuwei Chen
> 发送时间: 2021年10月29日 13:35
> 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Feng, Bob C <bob.c.feng@intel.com>
> 主题: Re: [edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> 
> Hi Liming,
> 
> As the comments have been added to each StructurePcd
> (https://edk2.groups.io/g/devel/message/68378?p=%2C%2C%2C20%2C0%2
> C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2CStructurePcd%2C20%2C2
> %2C20%2C78773894), the tmp[1] will have not only the "{0x0,0x0}" value but
> also the "# comments". If not split with "#", it will generate error format for
> value "{0x0, 0x0}" StructurePcd.
> 
> Thanks,
> Christine (Yuwei)
> 
> > -----Original Message-----
> > From: gaoliming <gaoliming@byosoft.com.cn>
> > Sent: Friday, October 29, 2021 10:02 AM
> > To: Chen, Christine <yuwei.chen@intel.com>; devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>
> > Subject: 回复: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> >
> > Yuwei:
> >
> > > -----邮件原件-----
> > > 发件人: Yuwei Chen <yuwei.chen@intel.com>
> > > 发送时间: 2021年10月27日 18:00
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>
> > > 主题: [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
> > >
> > > 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>
> > > ---
> > >  BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > > b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > > index 2baabf2dd521..9e7fe58768b1 100644
> > > --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > > +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
> > > @@ -142,7 +142,7 @@ class parser_lst(object):
> > >                        line.append(struct)
> > >                        unparse.append(line)
> > >                    else:
> > > -                    if uint not in ['UINT8', 'UINT16', 'UINT32',
> > > 'UINT64']:
> > > +                    if uint not in ['UINT8', 'UINT16', 'UINT32',
> > 'UINT64',
> > > 'BOOLEAN']:
> > >                        line = [offset, t_name, 0, uint]
> > >                        line.append(struct)
> > >                        unparse.append(line) @@ -569,7 +569,7
> @@ class
> > > mainprocess(object):
> > >      for i in List:
> > >        for j in i:
> > >          tmp = j.split("|")
> > > -        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0,
> > 0x0}'):
> > > +        if (('L"' in j) and ("[" in j)) or
> > > + (tmp[1].split("#")[0].strip()
> > == '{0x0,
> > > 0x0}'):
> >
> > Why split '#'?
> >
> > Thanks
> > Liming
> > >            tmp[0] = tmp[0][:tmp[0].index('[')]
> > >            List[List.index(i)][i.index(j)] = "|".join(tmp)
> > >          else:
> > > --
> > > 2.27.0.windows.1
> >
> >
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
  2021-10-27 10:00 [PATCH 1/1] BaseTools: Fix StructurePcd offset error Yuwei Chen
  2021-10-29  2:01 ` 回复: " gaoliming
@ 2021-11-08  2:38 ` Bob Feng
  1 sibling, 0 replies; 5+ messages in thread
From: Bob Feng @ 2021-11-08  2:38 UTC (permalink / raw)
  To: devel@edk2.groups.io, Chen, Christine; +Cc: Liming Gao

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yuwei Chen
Sent: Wednesday, October 27, 2021 6:00 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
Subject: [edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.

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>
---
 BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py
index 2baabf2dd521..9e7fe58768b1 100644
--- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
+++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
@@ -142,7 +142,7 @@ class parser_lst(object):
                       line.append(struct)
                       unparse.append(line)
                   else:
-                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
+                    if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:
                       line = [offset, t_name, 0, uint]
                       line.append(struct)
                       unparse.append(line) @@ -569,7 +569,7 @@ class mainprocess(object):
     for i in List:
       for j in i:
         tmp = j.split("|")
-        if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):
+        if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'):
           tmp[0] = tmp[0][:tmp[0].index('[')]
           List[List.index(i)][i.index(j)] = "|".join(tmp)
         else:
--
2.27.0.windows.1







^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-08  2:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-27 10:00 [PATCH 1/1] BaseTools: Fix StructurePcd offset error Yuwei Chen
2021-10-29  2:01 ` 回复: " gaoliming
2021-10-29  5:35   ` Yuwei Chen
2021-11-02  1:26     ` 回复: [edk2-devel] " gaoliming
2021-11-08  2:38 ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox