From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.7639.1584499181695070245 for ; Tue, 17 Mar 2020 19:39:41 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: liming.gao@intel.com) IronPort-SDR: +6IH1wKXHpWC5stMs3WSQNU43v7GRnTlUp/2ZpVVoaueGGHEcZgkVyKdfV7pNxaHwLf9hjmK69 /67hZ9yw1FXQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 19:39:40 -0700 IronPort-SDR: X4sM4sjpQ+tO1+0lAZS4XIQsXuZfPgetRpYcSORAzZRn8npn6dXj6a3mnGKPSFjQ7fivh5cz69 sjbvweZPYsDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,565,1574150400"; d="scan'208";a="238073694" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 17 Mar 2020 19:39:40 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Mar 2020 19:39:40 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 18 Mar 2020 10:39:38 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Wed, 18 Mar 2020 10:39:37 +0800 From: "Liming Gao" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Shi, Steven" Subject: Re: [Patch V2] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG Thread-Topic: [Patch V2] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG Thread-Index: AQHV/MYiUYmAprgFHE67riH4DkKLyahNoyFQ Date: Wed, 18 Mar 2020 02:39:37 +0000 Message-ID: <2c7caffbd1264bd89ea15bc9732c786d@intel.com> References: <20200318013930.597-1-zhiguang.liu@intel.com> In-Reply-To: <20200318013930.597-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Zhiguang: This change is good. Reviewed-by: Liming Gao Thanks Liming -----Original Message----- From: Liu, Zhiguang =20 Sent: 2020=1B$BG/=1B(B3=1B$B7n=1B(B18=1B$BF|=1B(B 9:40 To: devel@edk2.groups.io Cc: Kinney, Michael D ; Gao, Liming Subject: [Patch V2] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for C= LANG REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1548 For clang compiler, This change will make the generated image not include t= he absolute file path. If so, the generated debug image can be reproduced i= n the different root directory. Also, it will reduce the size of debug imag= e size. To do so, use __FILE_NAME__ macro to replace __FILE__. __FILE_NAME__ is Cla= ng-specific extension that functions similar to __FILE__ but only renders t= he last path component (the filename) instead of an invocation dependent fu= ll path to that file, and __FILE_NAME__ is introduced since clang 9. CC: Michael D Kinney CC: Liming Gao Signed-off-by: Zhiguang Liu --- 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/Deb= ugLib.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_NDEB= UG is defined, then debug and assert related macros wrapped by it are the= NULL implementations. -Copyright (c) 2006 - 2019, Intel Corporation. All r= ights reserved.
+Copyright (c) 2006 - 2020, Intel Corporation. All right= s reserved.
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) D= ebugAssert (__FILE_NAME__, __LINE__, #Expression)+#else #define _ASSERT(Exp= ression) DebugAssert (__FILE__, __LINE__, #Expression)+#endif /**--=20 2.25.1.windows.1