public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "JiniSusan.George@amd.com" <JiniSusan.George@amd.com>,
	"tom@tromey.com" <tom@tromey.com>, "eliz@gnu.org" <eliz@gnu.org>,
	"blarsen@redhat.com" <blarsen@redhat.com>
Subject: RE: [PING 3][PATCH v5 0/4] GDB support for DW_AT_trampoline
Date: Thu, 28 Dec 2023 11:30:56 +0000	[thread overview]
Message-ID: <SA1PR11MB6846211CFD730D5286512F4FCB9EA@SA1PR11MB6846.namprd11.prod.outlook.com> (raw)
In-Reply-To: <SA1PR11MB68468723514AC050FA0906FACBC2A@SA1PR11MB6846.namprd11.prod.outlook.com>

Ping!

Best Regards
Abdul Basit

-----Original Message-----
From: Ijaz, Abdul B 
Sent: Wednesday, September 27, 2023 11:05 PM
To: 'gdb-patches@sourceware.org' <gdb-patches@sourceware.org>
Cc: 'JiniSusan.George@amd.com' <JiniSusan.George@amd.com>; 'tom@tromey.com' <tom@tromey.com>; 'eliz@gnu.org' <eliz@gnu.org>; 'blarsen@redhat.com' <blarsen@redhat.com>
Subject: RE: [PING 2][PATCH v5 0/4] GDB support for DW_AT_trampoline

Ping!

Thanks & Best Regards
Abdul Basit

-----Original Message-----
From: Ijaz, Abdul B 
Sent: Sunday, September 3, 2023 9:14 PM
To: gdb-patches@sourceware.org
Cc: JiniSusan.George@amd.com; tom@tromey.com; eliz@gnu.org; blarsen@redhat.com
Subject: RE: [PING][PATCH v5 0/4] GDB support for DW_AT_trampoline

Ping!

Best Regards
Abdul Basit

-----Original Message-----
From: Ijaz, Abdul B <abdul.b.ijaz@intel.com> 
Sent: Wednesday, August 16, 2023 11:54 PM
To: gdb-patches@sourceware.org
Cc: Ijaz, Abdul B <abdul.b.ijaz@intel.com>; JiniSusan.George@amd.com; tom@tromey.com; eliz@gnu.org; blarsen@redhat.com
Subject: [PATCH v5 0/4] GDB support for DW_AT_trampoline

From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>

Hi,

please find attached a series of patches that attempts to enable GDB to handle the DW_AT_trampoline attribute on functions and inlined functions.

DW_AT_trampoline can be emitted by the compiler for functions that are compiler generated trampolines (e.g. wrapping other function calls).
In doing so, the compiler can specify a target as the value of DW_AT_trampoline which the trampoline is wrapping.

This series enables GDB to recognize the DW_AT_trampoline and store the target for a given function.  Patch 3 adapts GDB's stepping behavior when dealing with trampolines and attempts to - by default - hide these trampolines from the user.  When about to step into a trampoline, instead, GDB will try and step through the trampoline and directly towards the target.  Patch 4 in V2 now skip trampoline frames in the stack for printing or finish command.  A new setting has been introduced to turn off this modified stepping behavior or printing of stack for trampolines.

The motivation for these patches comes from ifx which emits the attribute for some of its compiler generated functions.  As I do not know of any other compiler (especially gcc/gfortran) emitting DW_AT_trampoline, I added a gdb.dwarf2 test to this series in order to test the trampoline handling within GDB.

Changes since V4:
  * Fixed reverse finish for trampolines.
  * Elide trampoline frames in backtrace for frame-filters case.
  * Use target subroutine address instead of name in case of ref type
    trampoline target.
  * Fixed loops formatting and now split line where possible at ";".

V4 series of patches can be found here:
https://sourceware.org/pipermail/gdb-patches/2023-August/201263.html

No regression seen on testing x64/native-extended-gdbserver(-m32)/x32/
native-gdbserver test configurations for these changes using Ubuntu 22.

Thanks & Best Regards
Abdul Basit

Abdul Basit Ijaz (1):
  gdb: Skip trampoline frames in the stack for printing or finish
    command.

Nils-Christian Kempke (3):
  gdb, dwarf: add support for DW_AT_trampoline in DWARF reader
  gdb/symtab: add lookup for trampoline functions
  gdb/infrun: handle stepping through functions with DW_AT_trampoline

 gdb/NEWS                                      |  15 ++
 gdb/doc/gdb.texinfo                           |  47 ++++
 gdb/dwarf2/read.c                             |  46 +++-
 gdb/gdbtypes.c                                |  34 ++-
 gdb/gdbtypes.h                                | 113 +++++++-
 gdb/infcmd.c                                  |  13 +
 gdb/infrun.c                                  |  93 ++++++-
 gdb/infrun.h                                  |  10 +
 gdb/python/py-frame.c                         |  15 ++
 gdb/stack.c                                   |   8 +
 gdb/symtab.c                                  |  80 ++++++
 gdb/symtab.h                                  |  19 ++
 .../gdb.dwarf2/dw2-function-trampolines.c     |  80 ++++++
 .../gdb.dwarf2/dw2-function-trampolines.exp   | 245 ++++++++++++++++++
 gdb/testsuite/gdb.fortran/func-trampoline.exp |  69 +++++
 gdb/testsuite/gdb.fortran/func-trampoline.f90 |  39 +++
 .../gdb.fortran/mixed-lang-stack.exp          |  10 +-
 17 files changed, 922 insertions(+), 14 deletions(-)  create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-function-trampolines.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-function-trampolines.exp
 create mode 100644 gdb/testsuite/gdb.fortran/func-trampoline.exp
 create mode 100644 gdb/testsuite/gdb.fortran/func-trampoline.f90

--
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2023-12-28 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 21:53 [PATCH " Abdul Basit Ijaz
2023-08-16 21:53 ` [PATCH v5 1/4] gdb, dwarf: add support for DW_AT_trampoline in DWARF reader Abdul Basit Ijaz
2023-08-16 21:53 ` [PATCH v5 2/4] gdb/symtab: add lookup for trampoline functions Abdul Basit Ijaz
2023-08-16 21:53 ` [PATCH v5 3/4] gdb/infrun: handle stepping through functions with DW_AT_trampoline Abdul Basit Ijaz
2023-08-16 21:53 ` [PATCH v5 4/4] gdb: Skip trampoline frames in the stack for printing or finish command Abdul Basit Ijaz
2023-08-17  5:26 ` [PATCH v5 0/4] GDB support for DW_AT_trampoline Eli Zaretskii
2023-08-17  7:37   ` Ijaz, Abdul B
2023-09-03 19:14 ` [PING][PATCH " Ijaz, Abdul B
2023-09-27 21:05   ` [PING 2][PATCH " Ijaz, Abdul B
2023-12-28 11:30     ` Ijaz, Abdul B [this message]
2024-01-10  7:40       ` [PING 3][PATCH " George, Jini Susan
2024-01-10  9:22         ` Ijaz, Abdul B
2024-01-10 16:59           ` George, Jini Susan

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-all 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=SA1PR11MB6846211CFD730D5286512F4FCB9EA@SA1PR11MB6846.namprd11.prod.outlook.com \
    --to=abdul.b.ijaz@intel.com \
    --cc=JiniSusan.George@amd.com \
    --cc=blarsen@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).