From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4GVkFNxj8WIM8SIAWB0awg (envelope-from ) for ; Mon, 08 Aug 2022 15:28:28 -0400 Received: by simark.ca (Postfix, from userid 112) id 5189E1EA06; Mon, 8 Aug 2022 15:28:28 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=efnpJk+5; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 D50651E9ED for ; Mon, 8 Aug 2022 15:28:27 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4557B385AE76 for ; Mon, 8 Aug 2022 19:28:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4557B385AE76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659986907; bh=JFGSu40Hbo4om8xwtTub5iAPe8oQrOCPym9NjSVRBQ8=; 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=efnpJk+5EKc49SWLIEBQaR5yUl4T5GuwB6N/GknxwXn/Mo/hvnwSMXDwZci5Ckfqi lj2t1IaNks3AvRe5OPfa+xv2bUPw7VUfOp8io+n91BRPNaWCE6T/nOPoW1Gds0Bgya vC1x3dw8p9ZPOiI2UAUNkYgO5Z/vMG5zXBBoJZlo= Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 15E0A385702D for ; Mon, 8 Aug 2022 19:28:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15E0A385702D Received: by mail-io1-xd30.google.com with SMTP id x64so7947942iof.1 for ; Mon, 08 Aug 2022 12:28:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=JFGSu40Hbo4om8xwtTub5iAPe8oQrOCPym9NjSVRBQ8=; b=Gs2OeHG8+BiW1UYHZJIndpEPhqa1yCzBv3+P0LfZxGbbY5R3vCd5DydUAxoKvIPmsj vHf0vclq4o3V2C5Ipcyh1vOUZEyM4BKFB1HGQ/F385eYK4XLaFpmjcRSP2oSlY8fK390 cQXC5hpAgpoJNDJu8DjnDzz4ITwL5RTZWNtpoWtWfU2V5pMaNk/ed5VbnTc61Dqcp9wv 14Phvw5lE3pnuXQNIjHDQ/ZLmwD4Q/lSU815J00geDoYK79qD2bOnxbI8zyE9SH/j4kR PUP0YLUkXw0FFerkCg/KvznOYDHbevh4uo4NsQBT6EeSKMm0t1PaFOL0ukaJ/Px9Hofa ziog== X-Gm-Message-State: ACgBeo1WkWP8oxsVFRZfiv2L3w1h+IHfoD//oB9LxgtgQtmhSRCBjFYz puW3DM0OHiosk2TERKWD9fPDI9PJ8zoRNw== X-Google-Smtp-Source: AA6agR5T2bXdSMXqQJbRTotC6abUjdx+Z9wT/Op6h0rraFyS6K+9nvH0HjkZv2RRN+kO4DGQsxOFmA== X-Received: by 2002:a05:6602:3cc:b0:679:61e7:3928 with SMTP id g12-20020a05660203cc00b0067961e73928mr8089562iov.217.1659986885369; Mon, 08 Aug 2022 12:28:05 -0700 (PDT) Received: from murgatroyd.Home (71-211-185-228.hlrn.qwest.net. [71.211.185.228]) by smtp.gmail.com with ESMTPSA id z11-20020a027a4b000000b003423f7b779csm5438380jad.41.2022.08.08.12.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 12:28:04 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Remove current_target_so_ops Date: Mon, 8 Aug 2022 13:27:59 -0600 Message-Id: <20220808192801.260256-2-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220808192801.260256-1-tromey@adacore.com> References: <20220808192801.260256-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Tom Tromey via Gdb-patches Reply-To: Tom Tromey Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" current_target_so_ops is only set in a single place. It seems better to simply remove it. --- gdb/solib-target.c | 5 ----- gdb/solib.c | 9 +++------ gdb/solist.h | 3 --- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/gdb/solib-target.c b/gdb/solib-target.c index 54b98243e51..8def640a1e7 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -453,9 +453,4 @@ _initialize_solib_target () solib_target_so_ops.in_dynsym_resolve_code = solib_target_in_dynsym_resolve_code; solib_target_so_ops.bfd_open = solib_bfd_open; - - /* Set current_target_so_ops to solib_target_so_ops if not already - set. */ - if (current_target_so_ops == 0) - current_target_so_ops = &solib_target_so_ops; } diff --git a/gdb/solib.c b/gdb/solib.c index 25adf586a02..859d345f39c 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -53,6 +53,7 @@ #include "debuginfod-support.h" #include "source.h" #include "cli/cli-style.h" +#include "solib-target.h" /* Architecture-specific operations. */ @@ -67,8 +68,8 @@ solib_ops (struct gdbarch *gdbarch) const struct target_so_ops *result = solib_data.get (gdbarch); if (result == nullptr) { - result = current_target_so_ops; - set_solib_ops (gdbarch, current_target_so_ops); + result = &solib_target_so_ops; + set_solib_ops (gdbarch, &solib_target_so_ops); } return result; } @@ -84,10 +85,6 @@ set_solib_ops (struct gdbarch *gdbarch, const struct target_so_ops *new_ops) /* external data declarations */ -/* FIXME: gdbarch needs to control this variable, or else every - configuration needs to call set_solib_ops. */ -struct target_so_ops *current_target_so_ops; - /* Local function prototypes */ /* If non-empty, this is a search path for loading non-absolute shared library diff --git a/gdb/solist.h b/gdb/solist.h index 34198dc0c4d..f102605e076 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -194,7 +194,4 @@ extern gdb_bfd_ref_ptr solib_bfd_fopen (const char *pathname, int fd); /* Find solib binary file and open it. */ extern gdb_bfd_ref_ptr solib_bfd_open (const char *in_pathname); -/* FIXME: gdbarch needs to control this variable. */ -extern struct target_so_ops *current_target_so_ops; - #endif -- 2.34.1