public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: "Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG
Date: Wed, 18 Mar 2020 00:29:37 +0000	[thread overview]
Message-ID: <b0ab32de34f240eda307860afcfa6a9c@intel.com> (raw)
In-Reply-To: <20200317071317.959-1-zhiguang.liu@intel.com>

Zhiguang:
  Please add more information on macro __FILE_NAME__. This is new macro supported by CLANG compiler. 

Thanks
Liming
-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com> 
Sent: 2020年3月17日 15:13
To: devel@edk2.groups.io
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1548
This change will make the generated image not include the absolute file path.
If so, the generated debug image can be reproduced in the different root directory. Also, it will reduce the size of debug image size.

CC: Michael D Kinney <michael.d.kinney@intel.com>
CC: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 MdePkg/Include/Library/DebugLib.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index f1d55cf62b..baab34bf05 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -8,7 +8,7 @@
   of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is   defined, then debug and assert related macros wrapped by it are the NULL implementations. -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -289,7 +289,11 @@ DebugPrintLevelEnabled (
   @param  Expression  Boolean expression that evaluated to FALSE  **/+#if defined(__clang__) && defined(__FILE_NAME__)+#define _ASSERT(Expression)  DebugAssert (__FILE_NAME__, __LINE__, #Expression)+#else #define _ASSERT(Expression)  DebugAssert (__FILE__, __LINE__, #Expression)+#endif   /**-- 
2.25.1.windows.1


      reply	other threads:[~2020-03-18  0:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17  7:13 [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG Zhiguang Liu
2020-03-18  0:29 ` Liming Gao [this message]

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=b0ab32de34f240eda307860afcfa6a9c@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