From nobody Tue May 7 19:19:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55939+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55939+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1584495591; cv=none; d=zohomail.com; s=zohoarc; b=luNiuiDnAphXc8ZuAwV9IxJw9jA7yrGoia6DAyeK5Ctx3M8CpcNymNZqGxeonlm808hpAKjSR261fsfQ5udBhNwks2mgGraDS83DA1hak3EHRkFmgaSTpW2lMuLhngNte80zN8VrpXB3fgPUR65mrPKP2rNE6RZtBlcc5Tudv20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584495591; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=hfpEGQbN0xgJsJr8tsqmJSC+kt7FfTta+5m/HcLdd1E=; b=LLPfjhsRvUYX1E9MYnIpc+Xsm+jXzOGvjp1KQ0Nwj0UCks+1cobwLFLpD5nzNGKrpiMNqCBOjTMCeopWO4lnH0wXGKpthWOoz1C/9Ox3/BfFo9K64OB9cH+OpDYm73OQG9GjoHZ0w786uLBmxzPcj6Tr2nceeKSkSDc8rBYuvBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55939+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158449559193460.65161963467153; Tue, 17 Mar 2020 18:39:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kQC7YY1788612xkKRhvhIMgm; Tue, 17 Mar 2020 18:39:51 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.6523.1584495590728316751 for ; Tue, 17 Mar 2020 18:39:50 -0700 IronPort-SDR: PXcRbopsM8/ROwiQoWanBSkklN2W4vabHqTtsxOHNX2YSm9VZOnDwM2d8bMELs7A2pwMmC6IOJ gW3rMtvmksFw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 18:39:47 -0700 IronPort-SDR: p6YV7M+4rzZtpGkmSvVthizP/EmyVaeHBNQUHzxHjDgUYHKDRIM/VlpzJOFjVvKaHebAlvUnwX s0CDzv6pCHrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,565,1574150400"; d="scan'208";a="291168677" X-Received: from fieedk002.ccr.corp.intel.com ([10.239.158.178]) by FMSMGA003.fm.intel.com with ESMTP; 17 Mar 2020 18:39:40 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [edk2-devel] [Patch V2] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG Date: Wed, 18 Mar 2020 09:39:30 +0800 Message-Id: <20200318013930.597-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com X-Gm-Message-State: 2z1S9bbtrDFfvNoJxH2I7RADx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584495591; bh=WpBQbxpNLJmDd9wBXjvIr1AovQNL/5XVBGnErq5Pc7U=; h=Cc:Date:From:Reply-To:Subject:To; b=HuNVlVv8PofMse7K+eHcGenTHJLcyUBU3touU6sfhmmQ6KytXVbNC6dpGn2oQeivJBe 8I4ZMJ0coqGyFMyRdiESt0FaYt9OakH/ANZOSejVYYGUPTHTABPvCijFaO1LMz62StHhs ZzjVeOO/1O7nuawtgpdxTLxPbzS3ADhzo8o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 in t= he different root directory. Also, it will reduce the size of debug image size. To do so, use __FILE_NAME__ macro to replace __FILE__. __FILE_NAME__ is Clang-specific extension that functions similar to __FILE__ but only renders the last path component (the filename) instead of an invocation dependent f= ull 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. =20 -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -289,7 +289,11 @@ DebugPrintLevelEnabled ( @param Expression Boolean expression that evaluated to FALSE =20 **/ +#if defined(__clang__) && defined(__FILE_NAME__) +#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, __LINE__, #Expres= sion) +#else #define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression) +#endif =20 =20 /** --=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55939): https://edk2.groups.io/g/devel/message/55939 Mute This Topic: https://groups.io/mt/72040378/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-