public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Add comments for the Structure Pcd definition in PcdValueInit.c file
@ 2018-01-23  3:03 BobCF
  2018-01-25  9:54 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-01-23  3:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

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



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

end of thread, other threads:[~2018-01-25  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox