[PATCH 0/2] Resolve dynamic types for pointers

Nils-Christian Kempke nils-christian.kempke@intel.com
Tue Jan 18 13:26:24 GMT 2022


Hi,

please find attached two patches aming at improving usability,
especially but not limited to Fortran and C/Cpp.

The following two patches attempt to resolve dynamic properties for
pointers when printing/accessing them.  When printing/dereferencing 
pointers with dynamic target types we resolve the target type first.
This enables GDB to print additional information about the type of the 
pointer/underlying object.

For example, in C this enables the printing of the dimension of a
dynamic array pointed to by an array pointer.

Any comments are much appreciated!

Cheers,

Nils


Bernhard Heckel (2):
  gdb/types: Resolve dynamic properties of pointer types.
  gdb: Resolve dynamic target types of pointers.

 gdb/c-valprint.c                              |  19 +-
 gdb/gdbtypes.c                                |  29 ++-
 gdb/testsuite/gdb.cp/vla-cxx.cc               |   4 +
 gdb/testsuite/gdb.cp/vla-cxx.exp              |  33 ++++
 gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp       |   4 +-
 .../gdb.fortran/pointer-to-pointer.exp        |   2 +-
 gdb/testsuite/gdb.fortran/pointers.exp        | 181 ++++++++++++++++++
 gdb/testsuite/gdb.fortran/pointers.f90        |  29 +++
 gdb/typeprint.c                               |  17 ++
 gdb/valops.c                                  |  11 ++
 gdb/valprint.c                                |   6 -
 11 files changed, 323 insertions(+), 12 deletions(-)
 create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp

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



More information about the Gdb-patches mailing list