From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0DU4JmkKq18oGQAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2020 16:47:21 -0500 Received: by simark.ca (Postfix, from userid 112) id 9A8631F08B; Tue, 10 Nov 2020 16:47:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 155571E58E for ; Tue, 10 Nov 2020 16:47:21 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C64EF398742E; Tue, 10 Nov 2020 21:47:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C64EF398742E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605044840; bh=MoIxVucNAAInoLAGnQGfMBdZm4tK1QJxx6Eaq6s4jnI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SsgtArgYlrKs3gZAko4WMTTv/8b6OxDfXrE6U8G6so2RamiMk38RQwGkPYEuDEwJP 4HGTK2Q5PPql2XxC2m1KfSomN+6xGGNmUOVr97dl4TeTxVfDyjU2JKieMcFScOKIwx SLoJy+wZrKBAuZWam3BaQqCOaOsHMJE3B8pnf1s0= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 9E62A398683E for ; Tue, 10 Nov 2020 21:47:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9E62A398683E X-ASG-Debug-ID: 1605044837-0c856e6cd5714c0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id lwJa0oXz8CZOPAkk (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Nov 2020 16:47:18 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id B44BE441B21; Tue, 10 Nov 2020 16:47:17 -0500 (EST) X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Subject: [PATCH 10/12] gdb: change linux gdbarch data from post to pre-init Date: Tue, 10 Nov 2020 16:46:12 -0500 X-ASG-Orig-Subj: [PATCH 10/12] gdb: change linux gdbarch data from post to pre-init Message-Id: <20201110214614.2842615-11-simon.marchi@efficios.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201110214614.2842615-1-simon.marchi@efficios.com> References: <20201110214614.2842615-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1605044838 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1675 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.85785 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" The following patch will need to fill a field in linux_gdbarch_data while the gdbarch is being built. linux_gdbarch_data is currently allocated as a post-init gdbarch data, meaning it's not possible to fill it before the gdbarch is completely initialized. Change it to a pre-init gdbarch data to allow this. The init_linux_gdbarch_data function doesn't use the created gdbarch, it only allocates the linux_gdbarch_data structure on the gdbarch's obstack, so the change is trivial. gdb/ChangeLog: * linux-tdep.c (init_linux_gdbarch_data): Change parameter to obkstack. (_initialize_linux_tdep): Register pre-init gdb data instead of post-init. Change-Id: If35ce91b6bb5435680d43b9268d811d95661644f --- gdb/linux-tdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index f3d1ccb4d1c..767cca4afd0 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -171,9 +171,9 @@ struct linux_gdbarch_data }; static void * -init_linux_gdbarch_data (struct gdbarch *gdbarch) +init_linux_gdbarch_data (struct obstack *obstack) { - return GDBARCH_OBSTACK_ZALLOC (gdbarch, struct linux_gdbarch_data); + return obstack_zalloc (obstack); } static struct linux_gdbarch_data * @@ -2673,7 +2673,7 @@ void _initialize_linux_tdep () { linux_gdbarch_data_handle = - gdbarch_data_register_post_init (init_linux_gdbarch_data); + gdbarch_data_register_pre_init (init_linux_gdbarch_data); /* Observers used to invalidate the cache when needed. */ gdb::observers::inferior_exit.attach (invalidate_linux_cache_inf); -- 2.28.0