From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.7809.1636003454912390250 for ; Wed, 03 Nov 2021 22:24:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 04 Nov 2021 13:24:10 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Kinney, Michael D'" , Cc: "'Liu, Zhiguang'" , "'Michael Kubacki'" References: <20211101213737.586-1-michael.d.kinney@intel.com> <20211101213737.586-2-michael.d.kinney@intel.com> <005601d7cf8f$07ab9fc0$1702df40$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0g5Zue5aSNOiBbUGF0Y2ggVjIgMS83XSBNZGVQa2cvSW5jbHVkZTogRW5oYW5jZSBEZWJ1Z0xpYiB0byBzdXBwb3J0IHJlcHJvZHVjZSBidWlsZHM=?= Date: Thu, 4 Nov 2021 13:24:13 +0800 Message-ID: <007701d7d13c$3480faf0$9d82f0d0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIZONpyVmW43l3onK7cMciy0JFccwGDDot9AKhOUssCG6J/lqtNzEmw Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Mike: OK. So, this change is to pass ECC. Reviewed-by: Liming Gao Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Kinney, Michael D > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B411=E6=9C=882=E6=97=A5 = 15:05 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com.= cn; Kinney, Michael > D > =E6=8A=84=E9=80=81: Liu, Zhiguang ; 'Michael Kuba= cki' > > =E4=B8=BB=E9=A2=98: RE: [edk2-devel] =E5=9B=9E=E5=A4=8D: [Patch V2 1/7] M= dePkg/Include: Enhance > DebugLib to support reproduce builds >=20 >=20 >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of > gaoliming > > Sent: Monday, November 1, 2021 7:12 PM > > To: Kinney, Michael D ; > devel@edk2.groups.io > > Cc: Liu, Zhiguang ; 'Michael Kubacki' > > > Subject: [edk2-devel] =E5=9B=9E=E5=A4=8D: [Patch V2 1/7] MdePkg/Include= : Enhance > DebugLib to support reproduce builds > > > > Mike: > > I add my comments. > > > > Thanks > > Liming > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Michael D Kinney > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B411=E6=9C=882=E6=97= =A5 5:38 > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > > =E6=8A=84=E9=80=81: Liming Gao ; Zhiguang L= iu > > > ; Michael Kubacki > > > > > > =E4=B8=BB=E9=A2=98: [Patch V2 1/7] MdePkg/Include: Enhance DebugLib t= o support > > > reproduce builds > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3688 > > > > > > * Add DEBUG_LINE_NUMBER define to DebugLib.h that is > > > by default mapped to __LINE__. A build can define > > > DEBUG_LINE_NUMBER to use a fixed value. > > > * Add DEBUG_EXPRESSION_STRING(Expression) macros to > > > DebugLib.h that is by default mapped to #Expression. > > > A build can define DEBUG_EXPRESSION_STRING_VALUE to > > > set all expression strings to a fixed string value. > > > > > > Cc: Liming Gao > > > Cc: Zhiguang Liu > > > Cc: Michael Kubacki > > > Signed-off-by: Michael D Kinney > > > --- > > > MdePkg/Include/Library/DebugLib.h | 43 > > > ++++++++++++++++++++++++++++--- > > > 1 file changed, 39 insertions(+), 4 deletions(-) > > > > > > diff --git a/MdePkg/Include/Library/DebugLib.h > > > b/MdePkg/Include/Library/DebugLib.h > > > index 4cacd4b8e243..7fb75f956c6e 100644 > > > --- a/MdePkg/Include/Library/DebugLib.h > > > +++ b/MdePkg/Include/Library/DebugLib.h > > > @@ -71,6 +71,41 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > > #define EFI_D_VERBOSE DEBUG_VERBOSE > > > #define EFI_D_ERROR DEBUG_ERROR > > > > > > +// > > > +// Source file line number. > > > +// Default is use the to compiler provided __LINE__ macro value. The > > > __LINE__ > > > +// mapping can be overriden by predefining DEBUG_LINE_NUMBER > > > +// > > > +// Defining DEBUG_LINE_NUMBER to a fixed value is useful when > comparing > > > builds > > > +// across source code formatting changes that may add/remove lines i= n a > > > source > > > +// file. > > > +// > > > +#ifdef DEBUG_LINE_NUMBER > > > +#else > > > +#define DEBUG_LINE_NUMBER __LINE__ > > > +#endif > > > > How about #ifndef DEBUG_LINE_NUMBER? >=20 > I tried that first. ECC flags it as an error thinking it is an include = guard > macro. > We need to fix ECC to not report this as an error. > This style passes ECC and all EDK II CI tests. >=20 > > > > Thanks > > Liming > > > + > > > +/** > > > + Macro that converts a Boolean expression to a Null-terminated ASCI= I > > > string. > > > + > > > + The default is to use the C pre-processor stringizing operator '#'= to > > add > > > + quotes around the C expression. If > DEBUG_EXPRESSION_STRING_VALUE > > > is defined > > > + then the C expression is converted to the fixed string value. > > > + > > > + Defining DEBUG_EXPRESSION_STRING_VALUE to a fixed value is > useful > > > when > > > + comparing builds across source code formatting changes that may > make > > > + changes to spaces or parenthesis in a Boolean expression. > > > + > > > + @param Expression Boolean expression. > > > + > > > +**/ > > > + > > > +#ifdef DEBUG_EXPRESSION_STRING_VALUE > > > +#define DEBUG_EXPRESSION_STRING(Expression) > > > DEBUG_EXPRESSION_STRING_VALUE > > > +#else > > > +#define DEBUG_EXPRESSION_STRING(Expression) #Expression > > > +#endif > > > + > > > /** > > > Prints a debug message to the debug output device if the specified > > error > > > level is enabled. > > > > > > @@ -310,15 +345,15 @@ UnitTestDebugAssert ( > > > ); > > > > > > #if defined(__clang__) && defined(__FILE_NAME__) > > > -#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, > > > __LINE__, #Expression) > > > +#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > > > #else > > > -#define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, > __LINE__, > > > #Expression) > > > +#define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > > > #endif > > > #else > > > #if defined(__clang__) && defined(__FILE_NAME__) > > > -#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, __LINE__, > > > #Expression) > > > +#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > > > #else > > > -#define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, > > > #Expression) > > > +#define _ASSERT(Expression) DebugAssert (__FILE__, > > > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > > > #endif > > > #endif > > > > > > -- > > > 2.32.0.windows.1 > > > > > > > > > > > > > > > >=20 > >