From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 51inOa93BWb3jRkAWB0awg (envelope-from ) for ; Thu, 28 Mar 2024 09:59:11 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=ZaFQuI+B; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D84FB1E0C0; Thu, 28 Mar 2024 09:59:11 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 82B501E030 for ; Thu, 28 Mar 2024 09:59:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD4B73858D33 for ; Thu, 28 Mar 2024 13:59:08 +0000 (GMT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 19B9F3858D1E for ; Thu, 28 Mar 2024 13:58:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19B9F3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 19B9F3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711634332; cv=none; b=nhHUV6jl3/LMMs0Ot6SHG4jMO02Q8hxgHY12fXaS8SOqajizxqr325wOrf/kNja0n4q5Ce4x5lftl8ZtO9Cmhp0N2vp91PCjSejkExAhyqGIeklSUsU9gSCGYzFp04LMw373BWehbHsuAjMbmcnWPVNlE5LQpN6SGh0Fhz9aPzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711634332; c=relaxed/simple; bh=7MX85rMFojAMPWbznGumskHtrlzWkU4Te1UT2pmctnk=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=Vs/qMiKFCrxuJz8Fd+qwUNv0lkRjP+cTq2OhfuPqEDtpRBD+YaY0H+HwFm7Yts/A2jCW2TtdUbWhaRiXejekydmolv+Us5TogcC5Y6XfjUnAt82Da2/XWVUbbZYUg6sTdSSdC05pb1jjuPbbnOUNNoY/V79HotHiJ2MAjtzc9sM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpqHI-0002MN-HY; Thu, 28 Mar 2024 09:58:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JzswMSgnGUrW1tsY0UeesNliJi+7CRGfhJDvsykZnpo=; b=ZaFQuI+BjJV3 HzKvOwuSSMhr0kDfjoGzFTnZy+lLXpkwmZJNOCVBX0cLon2I0ZQjkBdewF0VYvaBaojv7y/5YbRL4 /03/45q8Y12/yhh43NjLsTNXcnPsHCdzCDmu2qVStE9BiEnRJzAxnDjj5l32XeGIg4w7GyMFvFbmt a6rOy7KtMC7sa/7rnL/GKSJ0QSNjPSBS3oYcRUTBTRFbS+5LsatgRu7/IzMSzerIrfB/rM/LJXL0k nHLDYAsxb3NPMUOJvcnN8Na7Z9RbM0B9Udw77do3oOEWfD35KPIltHfZWJGfOOWJLx9BuWmPxVIvS GlHFOdfmwVuwLLu0NS7GGg==; Date: Thu, 28 Mar 2024 15:58:43 +0200 Message-Id: <86wmpmfofg.fsf@gnu.org> From: Eli Zaretskii To: Abdul Basit Ijaz Cc: gdb-patches@sourceware.org, JiniSusan.George@amd.com, tom@tromey.com, nils-christian.kempke@intel.com In-Reply-To: <20240328120528.30382-4-abdul.b.ijaz@intel.com> (message from Abdul Basit Ijaz on Thu, 28 Mar 2024 13:05:21 +0100) Subject: Re: [PATCH v6 03/10] gdb: handle stepping through functions with DW_AT_trampoline References: <20240328120528.30382-1-abdul.b.ijaz@intel.com> <20240328120528.30382-4-abdul.b.ijaz@intel.com> X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org > From: Abdul Basit Ijaz > Cc: abdul.b.ijaz@intel.com, > JiniSusan.George@amd.com, > tom@tromey.com, > eliz@gnu.org, > Nils-Christian Kempke > Date: Thu, 28 Mar 2024 13:05:21 +0100 > > gdb/NEWS | 11 + > gdb/doc/gdb.texinfo | 35 +++ > gdb/infrun.c | 87 ++++++- > gdb/infrun.h | 5 + > .../gdb.dwarf2/dw2-function-trampolines.c | 80 ++++++ > .../gdb.dwarf2/dw2-function-trampolines.exp | 245 ++++++++++++++++++ > 6 files changed, 459 insertions(+), 4 deletions(-) > create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-function-trampolines.c > create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-function-trampolines.exp Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index feb3a37393a..da0d936ff70 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -892,6 +892,17 @@ platform. > > * New commands > > +set skip-trampoline-functions on|off > +show skip-trampoline-functions > + This setting is 'on' by default. When 'on' it controls whether GDB will > + recognize function calls that have been marked as trampolines in the debug > + info. It improves stepping behavior in that it steps over the trampoline > + code and hides it from the user. Currently, only DWARF trampolines are > + supported. > + > + If this is turned off, GDB gdb will handle trampoline functions the same ^^^^^^^ Redundant "gdb" there. > +@kindex set skip-trampoline-functions > +@item set skip-trampoline-functions > +@cindex trampoline functions > +@cindex stepping through trampoline functions > +@itemx set skip-trampoline-functions on > +When calling a function in any language, some compilers might generate > +so-called trampoline functions, which wrap the actual function call (the "trampoline functions" should be in @dfn, as you are introducing new terminology here. > + add_setshow_boolean_cmd ("skip-trampoline-functions", class_run, > + &skip_trampoline_functions, _("\ > +Set whether gdb attempts to hide trampolines marked in the debug info."), _("\ > +Show whether gdb attempts to hide trampolines marked in the debug info."), _("\ > +If on, while stepping gdb will skip through functions and inlined functions\n\ > +marked as trampolines by the compiler. If off, gdb will ignore such function\n\ > +trampolines."), In the last sentence, I think "ignore such function trampolines" is misleading. I suggest to replace this with "treat trampolines as normal functions". Reviewed-By: Eli Zaretskii