[edk2-devel] [PATCH] BaseTools:corrected error message for the DatumType error
Bob Feng
bob.c.feng at intel.com
Tue May 7 03:57:05 UTC 2019
Zhiju,
Please split the long line into multiple <=80char lines, using the backslash so that the patch is easy to review.
Also, would you please update the BZ to add the new error message?
Thanks,
Bob
-----Original Message-----
From: Fan, ZhijuX
Sent: Tuesday, April 30, 2019 10:13 AM
To: devel at edk2.groups.io
Cc: Gao, Liming <liming.gao at intel.com>; Feng, Bob C <bob.c.feng at intel.com>
Subject: [PATCH] BaseTools:corrected error message for the DatumType error
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1762
For structure Pcd, Its DatumType may be self-defined, If the PCD DatumType format is incorrect, this PCD DatumType error message is inappropriate.
This patch corrects the error message.
Cc: Bob Feng <bob.c.feng at intel.com>
Cc: Liming Gao <liming.gao at intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan at intel.com>
---
BaseTools/Source/Python/Workspace/DscBuildData.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 5431296b5a..f20a2fcf28 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -943,9 +943,10 @@ class DscBuildData(PlatformBuildClassObject):
EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,
ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
if PcdType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE):
- if self._DecPcds[PcdCName, TokenSpaceGuid].DatumType.strip() != ValueList[1].strip():
- EdkLogger.error('build', FORMAT_INVALID, "Pcd datumtype used in DSC file is not the same as its declaration in DEC file.", File=self.MetaFile, Line=LineNo,
- ExtraData="%s.%s|%s" % (TokenSpaceGuid, PcdCName, Setting))
+ if self._DecPcds[PcdCName, TokenSpaceGuid].BaseDatumType.strip() != ValueList[1].strip():
+ DecPcd = self._DecPcds[PcdCName, TokenSpaceGuid]
+ EdkLogger.error('build', FORMAT_INVALID, "Pcd datumtype used in DSC file is not the same as its declaration in \n%s(Line: %s). DatumType:%s"% (PathClass(NormPath(DecPcd.PkgPath), GlobalData.gWorkspace, Arch=self._Arch), DecPcd.PcdDefineLineNo, DecPcd.DatumType), File=self.MetaFile, Line=LineNo,
+ ExtraData="Dsc:%s.%s|%s\n Dec:%s.%s|%s|%s|%s" % (TokenSpaceGuid, PcdCName, Setting, TokenSpaceGuid, PcdCName, DecPcd.DefaultValueFromDec, DecPcd.DatumType, DecPcd.TokenValue))
if (TokenSpaceGuid + '.' + PcdCName) in GlobalData.gPlatformPcds:
if GlobalData.gPlatformPcds[TokenSpaceGuid + '.' + PcdCName] != ValueList[Index]:
GlobalData.gPlatformPcds[TokenSpaceGuid + '.' + PcdCName] = ValueList[Index]
--
2.14.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#40069): https://edk2.groups.io/g/devel/message/40069
Mute This Topic: https://groups.io/mt/31416309/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list