From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GYt/FCmV12pjDTsAWB0awg (envelope-from ) for ; Tue, 20 Oct 2026 12:22:01 -0400 Received: by simark.ca (Postfix, from userid 112) id 48FF81E050; Tue, 20 Oct 2026 12:22:01 -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 9CC981E04D for ; Tue, 20 Oct 2026 12:22:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3684F4A9C026 for ; Tue, 20 Oct 2026 16:22:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3684F4A9C026 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id A34184A9C01C for ; Tue, 20 Oct 2026 16:20:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A34184A9C01C 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 A34184A9C01C 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=cFhqk17qPTM3HFWVErPkgIIlxMUgelqINeDpT+v18WDIEe45xPqq4N7ALdWvnQ2hQ+uiq+E5+5LbMSrA7RiqyoSev9pXht5riLRzenqTLZZC1eEonlpSxf995LUKTY8DXYyOOnwZNyjvrZ12+CdBgJGodLcvoNQT9AjVqzKlUAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792513259; c=relaxed/simple; bh=3Mc9sVLg7xB9WinxqSxXVTi57mp6jp9qyfzM+0RGHY0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Ootl5uqsNSk3sYZmE8/QKK8f0jdvZKyUX/TYL7+6xJglTdDbbM9SAoDkpYpzyemnj3vfbrnyTsxlBKWEkAKLygyvTh04FlwOYizaMCmdTLJ9bGSGkXpPf/iM8V5dfi0+bSK1fFofi3XT+thDPz3qrQFbpqTO4N4YgIObvBAklgM= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A34184A9C01C Received: by simark.ca (Postfix) id 389F51E050; Tue, 20 Oct 2026 12:20:58 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 02/13] gdb: remove p_allocated_size parameter of gdb_cplus_demangle_print Date: Tue, 20 Oct 2026 12:17:24 -0400 Message-ID: <20261020162054.2140671-3-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 The only caller of gdb_cplus_demangle_print, cp_comp_to_string, ignores the allocated size it returns. Remove the parameter. Change-Id: I0efad01e56f1f3ee6df2c543574279a23cd66027 --- gdb/cp-name-parser.c | 4 +--- gdb/cp-support.c | 7 ++++--- gdb/cp-support.h | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gdb/cp-name-parser.c b/gdb/cp-name-parser.c index fe2ffd61a6c8..deb4ae4dd83b 100644 --- a/gdb/cp-name-parser.c +++ b/gdb/cp-name-parser.c @@ -380,10 +380,8 @@ cpname_state::parse_number (const char *p, int len, int parsed_float, gdb::unique_xmalloc_ptr cp_comp_to_string (struct demangle_component *result, int estimated_len) { - size_t err; - return gdb_cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, result, - estimated_len, &err); + estimated_len); } /* Merge the two parse trees given by DEST and SRC. The parse tree diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 0f1ead6a4e98..80f3f14c4086 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1641,12 +1641,13 @@ gdb_demangle (const char *name, int options) gdb::unique_xmalloc_ptr gdb_cplus_demangle_print (int options, struct demangle_component *tree, - int estimated_length, - size_t *p_allocated_size) + int estimated_length) { + size_t allocated_size; + return gdb::unique_xmalloc_ptr (cplus_demangle_print (options | DMGL_VERBOSE, tree, - estimated_length, p_allocated_size)); + estimated_length, &allocated_size)); } /* A wrapper for cplus_demangle_v3_components that forces diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 103cbf0cd652..4f5a12c8f69d 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -208,8 +208,7 @@ gdb::unique_xmalloc_ptr gdb_demangle (const char *name, int options); /* A wrapper for cplus_demangle_print. */ extern gdb::unique_xmalloc_ptr gdb_cplus_demangle_print - (int options, struct demangle_component *tree, int estimated_length, - size_t *p_allocated_size); + (int options, struct demangle_component *tree, int estimated_length); /* Find an instance of the character C in the string S that is outside of all parenthesis pairs, single-quoted strings, and double-quoted -- 2.56.0