public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] GDB support for DW_AT_trampoline
@ 2023-07-10 22:56 Abdul Basit Ijaz
  2023-07-10 22:56 ` [PATCH v3 1/4] gdb, dwarf: add support for DW_AT_trampoline in DWARF reader Abdul Basit Ijaz
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Abdul Basit Ijaz @ 2023-07-10 22:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: abdul.b.ijaz, JiniSusan.George, tom, eliz

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 V2:
  * Mention "on" as default value for skip-trampoline-functions in NEWS
    and gdb.textinfo according to the latest feedback.
  * Update copyright years from 2022 to 2023 in test files which are
    newly added.

V2 series of patches can be found here:
https://sourceware.org/pipermail/gdb-patches/2023-June/200066.html

No regression seen on testing x64/x86/gdbserver test configurations for
these changes using Ubuntu 22.

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                             |  45 +++-
 gdb/gdbtypes.c                                |  35 ++-
 gdb/gdbtypes.h                                | 103 +++++++-
 gdb/infcmd.c                                  |  13 +
 gdb/infrun.c                                  |  81 +++++-
 gdb/infrun.h                                  |  10 +
 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 +-
 16 files changed, 885 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-07-31  7:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 22:56 [PATCH v3 0/4] GDB support for DW_AT_trampoline Abdul Basit Ijaz
2023-07-10 22:56 ` [PATCH v3 1/4] gdb, dwarf: add support for DW_AT_trampoline in DWARF reader Abdul Basit Ijaz
2023-07-27  9:09   ` Bruno Larsen
2023-07-29 11:36     ` Ijaz, Abdul B
2023-07-31  7:16       ` Bruno Larsen
2023-07-10 22:56 ` [PATCH v3 2/4] gdb/symtab: add lookup for trampoline functions Abdul Basit Ijaz
2023-07-10 22:56 ` [PATCH v3 3/4] gdb/infrun: handle stepping through functions with DW_AT_trampoline Abdul Basit Ijaz
2023-07-11 11:21   ` Eli Zaretskii
2023-07-27 11:46   ` Bruno Larsen
2023-07-29 11:03     ` Ijaz, Abdul B
2023-07-10 22:56 ` [PATCH v3 4/4] gdb: Skip trampoline frames in the stack for printing or finish command Abdul Basit Ijaz
2023-07-11 11:23   ` Eli Zaretskii

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).