From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6Ro6Dn6V12pzDTsAWB0awg (envelope-from ) for ; Tue, 20 Oct 2026 12:23:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 33F931E050; Tue, 20 Oct 2026 12:23:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 70FA11E04D for ; Tue, 20 Oct 2026 12:23:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 154204A9A89F for ; Tue, 20 Oct 2026 16:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 154204A9A89F Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BEDC94A9C025 for ; Tue, 20 Oct 2026 16:23:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEDC94A9C025 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 BEDC94A9C025 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=1792513381; cv=none; b=NqxQBdNuXeiAQtS2FA+1PoUpbPHMfMhk3rOWZzboNWEdxlvcib2OvXK1Y6xpvFYLGSvuVw+3Xb0twgZXEyfsS6kF2XVB0u4bIX4tN9VwV4MhcIWEopJISHmh+1QljUIqXABnxY+ynp1imSX8DInQmKL1RnjaKdDEjfGuetOn0bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792513381; c=relaxed/simple; bh=yFN4JsV9O5UHR7ql5Dnm5HeSHa1OhA2JlxKpxAbWd2U=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=LflrBMu+5rF9aeViboQ3KDrZcl/FE2mH4TdHCLYB3A8rUqjYwGkwfH2ol06RK6L/zFVdv/10DfKByNz8vuvGk40Zja7Q5ZYxKc2I0oFqtMHs9MrUjOXICr65C3C0MKQa1nMurHdfnoUK7FdK9QWbFZLs7teG7JRp9KZm16EW+/0= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEDC94A9C025 Received: by simark.ca (Postfix) id 14EBA1E04D; Tue, 20 Oct 2026 12:23:01 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 08/13] gdb: remove \^ escape sequence support from C++ name parser Date: Tue, 20 Oct 2026 12:17:30 -0400 Message-ID: <20261020162054.2140671-9-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261020162054.2140671-1-simon.marchi@efficios.com> References: <20261020162054.2140671-1-simon.marchi@efficios.com> 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 cp_parse_escape, used by the C++ name parser to parse escape sequences in character literals, accepts "\^" followed by a character. This denotes a control character, as in caret notation: "\^A" is 1, "\^?" is 0177 (DEL). This is not valid C or C++, no known compiler (gcc or clang) nor the demangler produce it in symbol names, so I don't think that the C++ name parser needs to accept it. This support is a leftover from GDB's old generic parse_escape function, in utils.c, which already supported "\^" since basically forever. When the C++ name parser was introduced, in commit fb4c6eba439c (2005-03-11), it got a copy of parse_escape, including the "\^" support. That copy was renamed to cp_parse_escape in commit 5256a53bb3fb (2008-10-27). parse_escape itself lost the "\^" support in commit 6c7a06a3facf (2009-03-20), but the copy was not updated. Remove it. A "\^" sequence is now handled like other unknown escape sequences. Change-Id: I866d04281d16dc2f82ea391ffa84370450682951 --- gdb/cp-name-parser.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gdb/cp-name-parser.c b/gdb/cp-name-parser.c index d7ecb534b718..4c5f18c9851f 100644 --- a/gdb/cp-name-parser.c +++ b/gdb/cp-name-parser.c @@ -494,24 +494,6 @@ cp_parse_escape (const char **string_ptr) case 0: (*string_ptr)--; return 0; - case '^': - { - c = *(*string_ptr)++; - - if (c == '?') - return 0177; - else if (c == '\\') - target_char = cp_parse_escape (string_ptr); - else - target_char = c; - - /* Now target_char is something like `c', and we want to find - its control-character equivalent. */ - target_char = target_char & 037; - - return target_char; - } - case '0': case '1': case '2': -- 2.56.0