From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey 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-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2022 19:28:08 -0000 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