[v2,0/4] Dynamic properties of pointers

Message ID 20221005204039.575255-1-nils-christian.kempke@intel.com
Headers
Series Dynamic properties of pointers |

Message

Kempke, Nils-Christian Oct. 5, 2022, 8:40 p.m. UTC
  Hi!

Please find attached v2 of this series.  The main change is patch 3
which became a 'some compiler DWARF that is wrong but we still want to
support it' patch after a discussion in
https://sourceware.org/pipermail/gdb-patches/2022-September/192159.html
and thanks to Simon and Zoran.  They convinced me that my v1 was wrong.

V1 can be found here:

https://sourceware.org/pipermail/gdb-patches/2022-September/191934.html

Changes since v1:

  * Patch 1 is unchanged and was already approved by Simon in v1.

  * Patch 2:
  Patch 2 changed quite a bit ang mainly got simpler.  Initially I
  thought here that DW_TAG_pointer_type could actually have the
  DW_AT_associated attribute, but it turned out that this again was an
  icc/icpc/ifort DWARF peculiarity.  The part handling this attribute
  for dynamic pointer types got moved to patch 3.  As a result, I could
  use the same handling for resolving dynamic pointers and references
  in resolve_dynamic_type_internal which made the patch simpler.
  I fixed the Simons' leftover comments in
  https://sourceware.org/pipermail/gdb-patches/2022-September/192142.html

  * Patch 3:
  From patch 2 the DW_AT_associated handling moved to this patch.
  Additionally, I wrapped all changed in this patch in compiler guards
  checking for icc/icpc/ifort and added a dwarf2 tests more concretely
  describing the poor Intel classic compiler DWARF we want to support
  here.  Last, I rewrote the commit message and added some comments.

  * Patch 4: Added a comment to the loop in the testcase.

I am not sure whether I did patch 3 the 'normal/usual' way compiler
quirks are implemented in GDB.  Have a look!  I'm looking forward to
comments.

Cheers!
Nils

Bernhard Heckel (1):
  gdb/types: Resolve pointer types dynamically

Nils-Christian Kempke (3):
  gdb, testsuite: handle icc and icpc deprecated remarks
  gdb, typeprint: workaround icc/icpc/ifort pointer/reference DWARF
  gdb/fortran: Fix sizeof intrinsic for Fortran

 gdb/eval.c                                    |   3 +
 gdb/gdbtypes.c                                |  86 ++++++++-
 gdb/gdbtypes.h                                |   5 +
 gdb/testsuite/gdb.cp/vla-cxx.cc               |   4 +
 gdb/testsuite/gdb.cp/vla-cxx.exp              |  31 ++++
 gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp       |  16 +-
 .../icc-ifort-pointers-and-references.c       |  37 ++++
 .../icc-ifort-pointers-and-references.exp     | 150 +++++++++++++++
 .../gdb.fortran/pointer-to-pointer.exp        |   2 +-
 gdb/testsuite/gdb.fortran/pointers.exp        | 172 ++++++++++++++++++
 gdb/testsuite/gdb.fortran/pointers.f90        |  29 +++
 gdb/testsuite/gdb.fortran/sizeof.exp          | 115 ++++++++++++
 gdb/testsuite/gdb.fortran/sizeof.f90          | 108 +++++++++++
 gdb/testsuite/lib/gdb.exp                     |  18 ++
 gdb/valprint.c                                |  40 +++-
 15 files changed, 796 insertions(+), 20 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/icc-ifort-pointers-and-references.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/icc-ifort-pointers-and-references.exp
 create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp
 create mode 100644 gdb/testsuite/gdb.fortran/sizeof.exp
 create mode 100644 gdb/testsuite/gdb.fortran/sizeof.f90