From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.132]) by mx.groups.io with SMTP id smtpd.web12.4019.1635819191752853271 for ; Mon, 01 Nov 2021 19:13:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: byosoft.net, ip: 211.157.147.132, mailfrom: byomail@byosoft.net) Received: from localhost (unknown [192.168.167.69]) by lucky1.263xmail.com (Postfix) with ESMTP id 4A646FCE12 for ; Tue, 2 Nov 2021 10:13:05 +0800 (CST) X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from mail.byosoft.com.cn (unknown [58.240.74.242]) by smtp.263.net (postfix) whith ESMTP id P9429T139793361950464S1635819184294505_; Tue, 02 Nov 2021 10:13:04 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: byomail@byosoft.net X-SENDER: byomail@byosoft.net X-LOGIN-NAME: byomail@byosoft.net X-FST-TO: devel@edk2.groups.io X-RCPT-COUNT: 1 X-LOCAL-RCPT-COUNT: 0 X-SENDER-IP: 58.240.74.242 X-ATTACHMENT-NUM: 0 X-UNIQUE-TAG: <8955cb02473399a30dca8aef8d345375> X-System-Flag: 0 Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 02 Nov 2021 10:12:03 +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: "'Michael D Kinney'" , Cc: "'Zhiguang Liu'" , "'Michael Kubacki'" References: <20211101213737.586-1-michael.d.kinney@intel.com> <20211101213737.586-2-michael.d.kinney@intel.com> In-Reply-To: <20211101213737.586-2-michael.d.kinney@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUGF0Y2ggVjIgMS83XSBNZGVQa2cvSW5jbHVkZTogRW5oYW5jZSBEZWJ1Z0xpYiB0byBzdXBwb3J0IHJlcHJvZHVjZSBidWlsZHM=?= Date: Tue, 2 Nov 2021 10:12:04 +0800 Message-ID: <005601d7cf8f$07ab9fc0$1702df40$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIZONpyVmW43l3onK7cMciy0JFccwGDDot9q2CTmaA= Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Mike: I add my comments.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Michael D Kinney > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA11=D4=C22=C8=D5 5:38 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Liming Gao ; Zhiguang Liu > ; Michael Kubacki > > =D6=F7=CC=E2: [Patch V2 1/7] MdePkg/Include: Enhance DebugLib to = support > reproduce builds >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3688 >=20 > * 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. >=20 > 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(-) >=20 > 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 >=20 > +// > +// 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 in = a > source > +// file. > +// > +#ifdef DEBUG_LINE_NUMBER > +#else > +#define DEBUG_LINE_NUMBER __LINE__ > +#endif How about #ifndef DEBUG_LINE_NUMBER? Thanks Liming > + > +/** > + Macro that converts a Boolean expression to a Null-terminated ASCII > 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. >=20 > @@ -310,15 +345,15 @@ UnitTestDebugAssert ( > ); >=20 > #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 >=20 > -- > 2.32.0.windows.1