From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WcoUHg2V12pjDTsAWB0awg (envelope-from ) for ; Tue, 20 Oct 2026 12:21:33 -0400 Received: by simark.ca (Postfix, from userid 112) id C5DCF1E091; Tue, 20 Oct 2026 12:21:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D37DC1E06B for ; Tue, 20 Oct 2026 12:21:27 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88EBE48FE56A for ; Tue, 20 Oct 2026 16:21:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88EBE48FE56A Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 575FD4C91762 for ; Tue, 20 Oct 2026 16:20:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 575FD4C91762 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 575FD4C91762 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792513259; cv=none; b=Ad9+rCSNUKh2Kx0vAd5mOkJrhy70LHjJuTxZLtIn2t6p7VnqZsLxnDF+qp93uivb5TXX4X6p/9xD9eciMGsKc60XGmvawP86oMHZLSR7mBRUjpecW8A++fYezPdgwt9AVKkK5zg6lqA+tGuIKkVwX7k96aM42oGEFj0OLZ3+aeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792513259; c=relaxed/simple; bh=WuWTtWZWkIiab8NbBaroHqAZilnWtKsUUwBfWkpjMj8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=puYbggHgTMWF/9EBrgJYA2EGe+ygzi3Mei0hgHzANruNhPBz6lYFrbYq2mU3tg7ylSyVz1HjBzPzAJRtOneagbQJ9K/zDAVNPRuEL6rcvnPHV1RrLgVMpuQkUI6NKLuPM2O+o2AYxSkvMsW1Gk1byvo7MHr9qxfm5zknZagolN4= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 575FD4C91762 Received: by simark.ca (Postfix) id 72C881E04D; Tue, 20 Oct 2026 12:20:57 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 00/13] Make the C++ name parser recognize more char literal forms Date: Tue, 20 Oct 2026 12:17:22 -0400 Message-ID: <20261020162054.2140671-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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 C 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