[PATCH 0/1] Handle undnamed template tags in GDB

Nils-Christian Kempke nils-christian.kempke@intel.com
Thu Jul 7 14:17:21 GMT 2022


Hi,

please find attached a patch designed to make GDB recored template tags
like DW_TAG_template_type_parameter and DW_TAG_tempolate_value_parameter
even if they do not have a name in the compiler's DWARF.

According to DWARF 5 unnnamed template TAGs are valid DWARF.  However,
GDB does not record symbols that do not have names and as such, did not
record these template arguments.

This patch adds an artificial naming scheme for unnamed template TAGs.
It fixes a reported bug and improves GDB's handling of templates.


Tested on x86-64 Ubuntu 20 with unix, unix/-m32, native-gdbserver and
native-extended-gdbserver.

Cheers,
Nils

Nils-Christian Kempke (1):
  gdb, dwarf: create symbols for template tags without names

 gdb/dwarf2/read.c                             |  46 ++++-
 .../missing-type-name-for-templates.exp       | 166 ++++++++++++++++++
 2 files changed, 211 insertions(+), 1 deletion(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.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