From: BobCF <bob.c.feng@intel.com>
To: edk2-devel@lists.01.org
Cc: Bob Feng <bob.c.feng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [Patch] BaseTools: Add comments for the Structure Pcd definition in PcdValueInit.c file
Date: Tue, 23 Jan 2018 11:03:05 +0800 [thread overview]
Message-ID: <20180123030305.10300-1-bob.c.feng@intel.com> (raw)
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
next reply other threads:[~2018-01-23 2:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 3:03 BobCF [this message]
2018-01-25 9:54 ` [Patch] BaseTools: Add comments for the Structure Pcd definition in PcdValueInit.c file Gao, Liming
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=20180123030305.10300-1-bob.c.feng@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