Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 00/13] Make the C++ name parser recognize more char literal forms
@ 2026-10-20 16:17 Simon Marchi
  2026-10-20 16:17 ` [PATCH 01/13] gdb: make demangle_parse_info own the memory its tree points into Simon Marchi
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Simon Marchi @ 2026-10-20 16:17 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

I am trying to fix some bugs in the area of non-type template
parameters.  For example, here is one related bug:

  RTTI symbols not found for non-type templates
  https://sourceware.org/bugzilla/show_bug.cgi?id=19320

It's quite complicated, it seems like I can always come up with some
more corner cases which break any of my attempts fix this generally.  So
I'll start with this series of patches that I am fairly confident are
good in any case.  They teach the C++ name parser to recognize literal
forms that clang emits but GDB does not recognize, such as:

    C<(char)'\xff'>
    C<u'\u0152a'>
    C<L'\U0001f600'>

Recognizing these forms allows GDB to canonicalize these names, makes
some more type lookups succeed, and gets rid the infamous `RTTI symbol
not found for class '...'` error in some cases.

Simon Marchi (13):
  gdb: make demangle_parse_info own the memory its tree points into
  gdb: remove p_allocated_size parameter of gdb_cplus_demangle_print
  gdb: modernize mangled_name_to_comp and cp_class_name_from_physname
  gdb: fix crash in "maint canonicalize" without argument
  gdb: move C++ name parser parsing selftest to its own test
  gdb: check exact results in the canonicalize selftest
  gdb: extract lex_char_literal from cpname_yylex
  gdb: remove \^ escape sequence support from C++ name parser
  gdb: remove backslash-newline handling from cp_parse_escape
  gdb: fix out-of-bounds reads in lex_char_literal
  gdb: handle hexadecimal escapes in C++ name parser
  gdb: handle character literal encoding prefixes in C++ name parser
  gdb: handle universal character names in C++ name parser

 gdb/cp-name-parser.c                          | 325 +++++++++++++-----
 gdb/cp-support.c                              | 131 ++++---
 gdb/cp-support.h                              |  10 +-
 gdb/maint.c                                   |   3 +
 gdb/testsuite/gdb.base/maint.exp              |   1 +
 gdb/testsuite/gdb.cp/nontype-template-rtti.cc |  44 +++
 .../gdb.cp/nontype-template-rtti.exp          |  89 +++++
 .../gdb.dwarf2/nontype-template-lookup.exp    | 113 ++++++
 gdb/testsuite/lib/gdb.exp                     |   7 +
 9 files changed, 561 insertions(+), 162 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/nontype-template-rtti.cc
 create mode 100644 gdb/testsuite/gdb.cp/nontype-template-rtti.exp
 create mode 100644 gdb/testsuite/gdb.dwarf2/nontype-template-lookup.exp


base-commit: d74cbaa58f3a8771cb7dd0191b45e3d5b5c5dbbd
-- 
2.56.0


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

end of thread, other threads:[~2026-10-22 16:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 16:17 [PATCH 00/13] Make the C++ name parser recognize more char literal forms Simon Marchi
2026-10-20 16:17 ` [PATCH 01/13] gdb: make demangle_parse_info own the memory its tree points into Simon Marchi
2026-10-20 16:17 ` [PATCH 02/13] gdb: remove p_allocated_size parameter of gdb_cplus_demangle_print Simon Marchi
2026-10-20 16:17 ` [PATCH 03/13] gdb: modernize mangled_name_to_comp and cp_class_name_from_physname Simon Marchi
2026-10-20 16:17 ` [PATCH 04/13] gdb: fix crash in "maint canonicalize" without argument Simon Marchi
2026-10-20 16:17 ` [PATCH 05/13] gdb: move C++ name parser parsing selftest to its own test Simon Marchi
2026-10-20 16:17 ` [PATCH 06/13] gdb: check exact results in the canonicalize selftest Simon Marchi
2026-10-21 15:21   ` Tom Tromey
2026-10-21 15:48     ` Simon Marchi
2026-10-21 16:56       ` Tom Tromey
2026-10-21 17:01         ` Simon Marchi
2026-10-21 17:48           ` Tom Tromey
2026-10-22 16:28             ` Simon Marchi
2026-10-20 16:17 ` [PATCH 07/13] gdb: extract lex_char_literal from cpname_yylex Simon Marchi
2026-10-21 15:22   ` Tom Tromey
2026-10-20 16:17 ` [PATCH 08/13] gdb: remove \^ escape sequence support from C++ name parser Simon Marchi
2026-10-20 16:17 ` [PATCH 09/13] gdb: remove backslash-newline handling from cp_parse_escape Simon Marchi
2026-10-20 16:17 ` [PATCH 10/13] gdb: fix out-of-bounds reads in lex_char_literal Simon Marchi
2026-10-20 16:17 ` [PATCH 11/13] gdb: handle hexadecimal escapes in C++ name parser Simon Marchi
2026-10-20 16:17 ` [PATCH 12/13] gdb: handle character literal encoding prefixes " Simon Marchi
2026-10-20 16:17 ` [PATCH 13/13] gdb: handle universal character names " Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox