From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 54E9338582BB; Tue, 20 Sep 2022 18:40:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54E9338582BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663699243; bh=/JMXkjlcCP8tsi3H82BXE47Eva/hvHWdUu0Xy/2xICs=; h=From:To:Subject:Date:From; b=FjN0aRQcouap7pmm2DT2FfI2pti223ifQ6XCWImBwy5N1xfxFlWyWOx3ED/L4hXoR 5X3oMK6XPWmczqNStAM+3IkOQTkwZrgp0u1xB1L8De9QXtEnWj4HXjrrPzNCrotB2j CClOjF13igTfyfX/vokvffFOANnkRTwKpXQ/M48M= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove current_target_so_ops X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 430676bc51fb5278e89fd9ef84ac9e7ab71f46c5 X-Git-Newrev: 5898c79ae692ed02dd9267888541b352423a9331 Message-Id: <20220920184043.54E9338582BB@sourceware.org> Date: Tue, 20 Sep 2022 18:40:43 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5898c79ae692= ed02dd9267888541b352423a9331 commit 5898c79ae692ed02dd9267888541b352423a9331 Author: Tom Tromey Date: Mon Aug 8 10:14:53 2022 -0600 Remove current_target_so_ops =20 current_target_so_ops is only set in a single place. It seems better to simply remove it. Diff: --- 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 =3D solib_target_in_dynsym_resolve_code; solib_target_so_ops.bfd_open =3D solib_bfd_open; - - /* Set current_target_so_ops to solib_target_so_ops if not already - set. */ - if (current_target_so_ops =3D=3D 0) - current_target_so_ops =3D &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" =20 /* Architecture-specific operations. */ =20 @@ -67,8 +68,8 @@ solib_ops (struct gdbarch *gdbarch) const struct target_so_ops *result =3D solib_data.get (gdbarch); if (result =3D=3D nullptr) { - result =3D current_target_so_ops; - set_solib_ops (gdbarch, current_target_so_ops); + result =3D &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 tar= get_so_ops *new_ops) =20 /* external data declarations */ =20 -/* 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 */ =20 /* If non-empty, this is a search path for loading non-absolute shared lib= rary 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 *pat= hname, int fd); /* Find solib binary file and open it. */ extern gdb_bfd_ref_ptr solib_bfd_open (const char *in_pathname); =20 -/* FIXME: gdbarch needs to control this variable. */ -extern struct target_so_ops *current_target_so_ops; - #endif