public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Feng, Bob C" <bob.c.feng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Add comments for the Structure Pcd definition in PcdValueInit.c file
Date: Thu, 25 Jan 2018 09:54:53 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1AC6F7@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20180123030305.10300-1-bob.c.feng@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Feng, Bob C
>Sent: Tuesday, January 23, 2018 11:03 AM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Add comments for the Structure Pcd definition in
>PcdValueInit.c file
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/Workspace/BuildClassObject.py | 4 ++++
> BaseTools/Source/Python/Workspace/DecBuildData.py     | 2 ++
> BaseTools/Source/Python/Workspace/DscBuildData.py     | 2 +-
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>index 0e3081cfc5..8d02e78b27 100644
>--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>@@ -117,10 +117,12 @@ class StructurePcd(PcdClassObject):
>         self.DefaultValues = collections.OrderedDict({})
>         self.PcdMode = None
>         self.SkuOverrideValues = collections.OrderedDict({})
>         self.FlexibleFieldName = None
>         self.StructName = None
>+        self.PcdDefineLineNo = 0
>+        self.PkgPath = ""
>     def __repr__(self):
>         return self.TypeName
>
>     def AddDefaultValue (self, FieldName, Value, FileName="", LineNo=0):
>         if FieldName in self.DefaultValues:
>@@ -169,10 +171,12 @@ class StructurePcd(PcdClassObject):
>             self.PcdMode = PcdObject.PcdMode if PcdObject.PcdMode else
>self.PcdMode
>             self.DefaultFromDSC=None
>             self.SkuOverrideValues = PcdObject.SkuOverrideValues if
>PcdObject.SkuOverrideValues else self.SkuOverrideValues
>             self.FlexibleFieldName = PcdObject.FlexibleFieldName if
>PcdObject.FlexibleFieldName else self.FlexibleFieldName
>             self.StructName = PcdObject.DatumType if PcdObject.DatumType else
>self.StructName
>+            self.PcdDefineLineNo = PcdObject.PcdDefineLineNo if
>PcdObject.PcdDefineLineNo else self.PcdDefineLineNo
>+            self.PkgPath = PcdObject.PkgPath if PcdObject.PkgPath else
>self.PkgPath
>
> ## LibraryClassObject
> #
> # This Class defines LibraryClassObject used in BuildDatabase
> #
>diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py
>b/BaseTools/Source/Python/Workspace/DecBuildData.py
>index 13fb8686b6..2fd3820dcc 100644
>--- a/BaseTools/Source/Python/Workspace/DecBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DecBuildData.py
>@@ -381,10 +381,12 @@ class DecBuildData(PackageBuildClassObject):
>                     dep_pkgs.append(item.DefaultValue)
>                 elif item.DatumType == item.TokenCName:
>                     struct_pcd.copy(item)
>                     struct_pcd.TokenValue = struct_pcd.TokenValue.strip("{").strip()
>                     struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName =
>pcdname.split(".")
>+                    struct_pcd.PcdDefineLineNo = LineNo
>+                    struct_pcd.PkgPath = self.MetaFile.File
>                 else:
>                     struct_pcd.AddDefaultValue(item.TokenCName,
>item.DefaultValue,self.MetaFile.File,LineNo)
>
>             struct_pcd.PackageDecs = dep_pkgs
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index b042c4306a..60aa4868ed 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1284,11 +1284,11 @@ class DscBuildData(PlatformBuildClassObject):
>             CApp = CApp + '  UINT32  Size;\n'
>             CApp = CApp + '  UINT32  FieldSize;\n'
>             CApp = CApp + '  CHAR8   *Value;\n'
>             CApp = CApp + '  UINT32  OriginalSize;\n'
>             CApp = CApp + '  VOID    *OriginalPcd;\n'
>-            CApp = CApp + '  %s      *Pcd;\n' % (Pcd.DatumType)
>+            CApp = CApp + '  %s      *Pcd;  // From %s Line %d \n' %
>(Pcd.DatumType, Pcd.PkgPath, Pcd.PcdDefineLineNo)
>             CApp = CApp + '\n'
>
>             Pcd.DefaultValue = Pcd.DefaultValue.strip()
>             PcdDefaultValue = StringToArray(Pcd.DefaultValue)
>
>--
>2.14.3.windows.1



      reply	other threads:[~2018-01-25  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  3:03 [Patch] BaseTools: Add comments for the Structure Pcd definition in PcdValueInit.c file BobCF
2018-01-25  9:54 ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E1AC6F7@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox