From patchwork Thu Jan 4 14:19:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 83310 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 51002385803B for ; Thu, 4 Jan 2024 14:19:26 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 2A7843858D32 for ; Thu, 4 Jan 2024 14:18:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A7843858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2A7843858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704377933; cv=none; b=hhQReDt6CTHhZ4VQDhIX9eLZcN+6ir4ocOrbG6ZeRn6D54Ou59y7VdQ8+p9YGPDSkWp72t0GzAzCg4zjYpM81ar/auzst57unTGsSgZLl6MrHTxjB2g2SAFCMrU7D3GymYHo7b+qHfjf9/DpARvOpPPPmN5OLBqUg4L2bRZ8WHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704377933; c=relaxed/simple; bh=hVdp5c/60+SVyLdU9zFj1aL6/XVJtUGZmXfVUFSyY38=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=Lpu8/HUlxWz/1Bt3gWN7jqpDfTL1hqlm7qsppukmRaeX09znnCAFv9l3bLdx39kgzJlh4YDy7vf6kupI9uUbXoR4ApwKHZWPYVqcYjR/mHOTOtk5vwC3uzYFtH96l4ZcnwWIplkAO+LMI3MxaF6gAR4Ks6XSDY69jDk8EWGD/CU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1D3C121E1A for ; Thu, 4 Jan 2024 14:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704377931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMhYGyT6+DxWyMmOLpf8of9SV02jeb5+TJAPJHKSIEE=; b=BQJ92FD76eWdFlbrSYErs6+TXKcGBQEk4v/w85aSwft8DkJ1ZiPQo9vVMw7uqV9UZ5aT18 5FGtYQ/iT4SVQeUArXAS4YPr8y66Z/OPx036Y6NC7tri8WNmaBkP7+1QkRw6q3KS4ynOLa qxOv+VZIeOw3tMoIKZrLFowFfOgfPgM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704377931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMhYGyT6+DxWyMmOLpf8of9SV02jeb5+TJAPJHKSIEE=; b=HoAYppZq91f13skWFFfYZueRAOG64R2WK80MIdvygU9fJSADmb0GjQHcEk53AInC3uy73h BAd6FBN3v/G9ulBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704377931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMhYGyT6+DxWyMmOLpf8of9SV02jeb5+TJAPJHKSIEE=; b=BQJ92FD76eWdFlbrSYErs6+TXKcGBQEk4v/w85aSwft8DkJ1ZiPQo9vVMw7uqV9UZ5aT18 5FGtYQ/iT4SVQeUArXAS4YPr8y66Z/OPx036Y6NC7tri8WNmaBkP7+1QkRw6q3KS4ynOLa qxOv+VZIeOw3tMoIKZrLFowFfOgfPgM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704377931; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMhYGyT6+DxWyMmOLpf8of9SV02jeb5+TJAPJHKSIEE=; b=HoAYppZq91f13skWFFfYZueRAOG64R2WK80MIdvygU9fJSADmb0GjQHcEk53AInC3uy73h BAd6FBN3v/G9ulBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0343013C96 for ; Thu, 4 Jan 2024 14:18:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2DUbO0q+lmUSOwAAD6G6ig (envelope-from ) for ; Thu, 04 Jan 2024 14:18:50 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/3] [gdb/symtab] Allow changing of added cooked_index entries Date: Thu, 4 Jan 2024 15:19:09 +0100 Message-Id: <20240104141911.7596-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240104141911.7596-1-tdevries@suse.de> References: <20240104141911.7596-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Level: **** X-Spamd-Result: default: False [-1.81 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; URIBL_BLOCKED(0.00)[suse.de:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 1D3C121E1A Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BQJ92FD7; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=HoAYppZq X-Spam-Score: -1.81 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patchwork=sourceware.org@sourceware.org Make cooked_index_storage::add and cooked_index_entry::add return a "cooked_index_entry *" instead of a "const cooked_index_entry *". Tested on x86_64-linux. --- gdb/dwarf2/cooked-index.c | 2 +- gdb/dwarf2/cooked-index.h | 10 +++++----- gdb/dwarf2/read.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index ba77f9cb373..f9850d39bd0 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -228,7 +228,7 @@ cooked_index_entry::write_scope (struct obstack *storage, /* See cooked-index.h. */ -const cooked_index_entry * +cooked_index_entry * cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag, cooked_index_flag flags, const char *name, const cooked_index_entry *parent_entry, diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 3c6b9c35fd5..452a07ffb80 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -257,11 +257,11 @@ class cooked_index_shard /* Create a new cooked_index_entry and register it with this object. Entries are owned by this object. The new item is returned. */ - const cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag, - cooked_index_flag flags, - const char *name, - const cooked_index_entry *parent_entry, - dwarf2_per_cu_data *per_cu); + cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag, + cooked_index_flag flags, + const char *name, + const cooked_index_entry *parent_entry, + dwarf2_per_cu_data *per_cu); /* Install a new fixed addrmap from the given mutable addrmap. */ void install_addrmap (addrmap_mutable *map) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6c62932520f..61646a5fba0 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -4468,11 +4468,11 @@ class cooked_index_storage /* Add an entry to the index. The arguments describe the entry; see cooked-index.h. The new entry is returned. */ - const cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag, - cooked_index_flag flags, - const char *name, - const cooked_index_entry *parent_entry, - dwarf2_per_cu_data *per_cu) + cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag, + cooked_index_flag flags, + const char *name, + const cooked_index_entry *parent_entry, + dwarf2_per_cu_data *per_cu) { return m_index->add (die_offset, tag, flags, name, parent_entry, per_cu); }