From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gYAoNq7ITmqn1CwAWB0awg (envelope-from ) for ; Wed, 08 Jul 2026 18:01:18 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=axLlCIrz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D9A931E04F; Wed, 08 Jul 2026 18:01:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A9DA31E04F for ; Wed, 08 Jul 2026 18:01:17 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4AFE4BA2E3A for ; Wed, 8 Jul 2026 22:01:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4AFE4BA2E3A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=axLlCIrz Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 35C4D4BA2E11 for ; Wed, 8 Jul 2026 22:00:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 35C4D4BA2E11 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 35C4D4BA2E11 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783548036; cv=none; b=eEFReLxVbcAwGmVmrgwjd3sI9XyantMDRBMmxkkKDI2WJe5eM6ngJDpcNfkqG9g/NyFT2tm4tKLtYj3L1nS5TQU4ycczrb/4DiXKyIE8n/B5lS3kmcuVH7TZ3vmFQ7HV6prBFbwiev5Pm2QDaQNFsRWz3sGpEdpRfFOjJgr3VIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783548036; c=relaxed/simple; bh=pG9DH/HBESLj0rN/fOY5pzvYV4qYNS+y22URgEpu7qE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wrN9e4zznRNO+CJgdxomR8MbotFzdVma8l/jMNC6zo42mmyat+BMC2PYgl2o+W+wJMwyIq0med81l1MFFI1XyMqB+pYHAjOhFDfYuTJhGQECGDcDk6fmWJi5UnhrSFaa38m/QEvBFDKWnjq9XRsAJNcEAycJAcPzy9HxHoRszIA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=axLlCIrz DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35C4D4BA2E11 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 668M0RC8120689 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 Jul 2026 18:00:32 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 668M0RC8120689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1783548033; bh=XUiEaNl6uSl+Qet+4FexL5FI/744sLHO0JmaVw7y4X4=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=axLlCIrzKaY246BmefjpXjCRaGRBaDscJvYH/U3ZEBMb0BT/crXhV78VpjVd+e++s ijG6abETVwpenfdGo2biPaOfH053ZJzFRiV22h3D8s7eBi3I36NS7oYGDBx+x6N7ZI BfPpP9mAmi0QSpp5gfCXEexsxGjj7idw0nRF6WmBf1/ouvieaifVImm/CU1OF6DEo7 O17EUkAR88edpVILrBkQaBptvBvBLbl0Ha+CCcGVvPxHz0ZoTbek+liYlUPsmXkrws Mp+yyAUDAqWERJUtOcKbJViKBqzc/MeUNUIs6XA7exCoa+GbA5ZBjXan/4kzK4cvjX JjhjRYkW5wzJA== Received: by simark.ca (Postfix) id 0689B1E0AA; Wed, 08 Jul 2026 17:51:51 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Tom Tromey , Lancelot SIX , Simon Marchi , Lancelot Six Subject: [PATCH v3 04/10] gdb: de-constify some methods of solib_ops Date: Wed, 8 Jul 2026 17:51:36 -0400 Message-ID: <20260708215145.93134-5-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260708215145.93134-1-simon.marchi@polymtl.ca> References: <20260708215145.93134-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 8 Jul 2026 22:00:27 +0000 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~public-inbox=simark.ca@sourceware.org From: Simon Marchi The following commit moves the ROCm solib data from a registry to the rocm_solib_ops object itself. This requires making some methods non-const, and it then cascades to a bunch of things. This will have to be done one day or another, when (I suspect) we'll move more solib_ops data out of registries and into the solib_ops objects themselves. Do it in this separate patch to avoid polluting that patch. No behavior change expected. Change-Id: Icb5e921a82e235817f8817a3aa3c20b2c9dc959f Approved-by: Lancelot Six (amdgpu) --- gdb/progspace.h | 2 +- gdb/solib-aix.c | 12 ++++++------ gdb/solib-darwin.c | 12 ++++++------ gdb/solib-dsbt.c | 8 ++++---- gdb/solib-frv.c | 8 ++++---- gdb/solib-rocm.c | 20 ++++++++++---------- gdb/solib-svr4.c | 14 +++++++------- gdb/solib-svr4.h | 14 +++++++------- gdb/solib-target.c | 2 +- gdb/solib-target.h | 2 +- gdb/solib.c | 10 +++++----- gdb/solib.h | 14 +++++++------- gdb/windows-tdep.c | 4 ++-- 13 files changed, 61 insertions(+), 61 deletions(-) diff --git a/gdb/progspace.h b/gdb/progspace.h index e9261ff8590d..21977747cb94 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -260,7 +260,7 @@ struct program_space { return std::move (m_solib_ops); } /* Get this program space's solib provider. */ - const struct solib_ops *solib_ops () const + struct solib_ops *solib_ops () const { return m_solib_ops.get (); } /* Return the list of all the solibs in this program space. */ diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 705760651217..28f69ed9cbb4 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -32,9 +32,9 @@ struct aix_solib_ops : public solib_ops using solib_ops::solib_ops; void relocate_section_addresses (solib &so, target_section *) const override; - void create_inferior_hook (int from_tty) const override; - owning_intrusive_list current_sos () const override; - gdb_bfd_ref_ptr bfd_open (const char *pathname) const override; + void create_inferior_hook (int from_tty) override; + owning_intrusive_list current_sos () override; + gdb_bfd_ref_ptr bfd_open (const char *pathname) override; }; /* See solib-aix.h. */ @@ -425,7 +425,7 @@ solib_aix_get_section_offsets (struct objfile *objfile, } void -aix_solib_ops::create_inferior_hook (int from_tty) const +aix_solib_ops::create_inferior_hook (int from_tty) { const char *warning_msg = "unable to relocate main executable"; @@ -454,7 +454,7 @@ aix_solib_ops::create_inferior_hook (int from_tty) const } owning_intrusive_list -aix_solib_ops::current_sos () const +aix_solib_ops::current_sos () { std::optional> &library_list = solib_aix_get_library_list (current_inferior (), NULL); @@ -498,7 +498,7 @@ aix_solib_ops::current_sos () const } gdb_bfd_ref_ptr -aix_solib_ops::bfd_open (const char *pathname) const +aix_solib_ops::bfd_open (const char *pathname) { /* The pathname is actually a synthetic filename with the following form: "/path/to/sharedlib(member.o)" (double-quotes excluded). diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 6e2535ca427f..07cd88d0e0c6 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -42,9 +42,9 @@ struct darwin_solib_ops : public solib_ops void relocate_section_addresses (solib &so, target_section *) const override; void clear_solib (program_space *pspace) const override; - void create_inferior_hook (int from_tty) const override; - owning_intrusive_list current_sos () const override; - gdb_bfd_ref_ptr bfd_open (const char *pathname) const override; + void create_inferior_hook (int from_tty) override; + owning_intrusive_list current_sos () override; + gdb_bfd_ref_ptr bfd_open (const char *pathname) override; }; /* See solib-darwin.h. */ @@ -211,7 +211,7 @@ find_program_interpreter (void) } owning_intrusive_list -darwin_solib_ops::current_sos () const +darwin_solib_ops::current_sos () { type *ptr_type = builtin_type (current_inferior ()->arch ())->builtin_data_ptr; @@ -471,7 +471,7 @@ darwin_solib_read_all_image_info_addr (struct darwin_info *info) } void -darwin_solib_ops::create_inferior_hook (int from_tty) const +darwin_solib_ops::create_inferior_hook (int from_tty) { /* Everything below only makes sense if we have a running inferior. */ if (!target_has_execution ()) @@ -606,7 +606,7 @@ darwin_solib_ops::relocate_section_addresses (solib &so, } gdb_bfd_ref_ptr -darwin_solib_ops::bfd_open (const char *pathname) const +darwin_solib_ops::bfd_open (const char *pathname) { int found_file; diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 052b170fd9a6..22b9a581546a 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -128,8 +128,8 @@ struct dsbt_solib_ops : public solib_ops void relocate_section_addresses (solib &so, target_section *) const override; void clear_solib (program_space *pspace) const override; - void create_inferior_hook (int from_tty) const override; - owning_intrusive_list current_sos () const override; + void create_inferior_hook (int from_tty) override; + owning_intrusive_list current_sos () override; bool in_dynsym_resolve_code (CORE_ADDR pc) const override; }; @@ -526,7 +526,7 @@ lm_base (void) we provide values for. */ owning_intrusive_list -dsbt_solib_ops::current_sos () const +dsbt_solib_ops::current_sos () { bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ()); CORE_ADDR lm_addr; @@ -860,7 +860,7 @@ dsbt_relocate_main_executable (void) The shared library breakpoints also need to be enabled. */ void -dsbt_solib_ops::create_inferior_hook (int from_tty) const +dsbt_solib_ops::create_inferior_hook (int from_tty) { /* Relocate main executable. */ dsbt_relocate_main_executable (); diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 4f0aac31e733..cff3c3ca0193 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -36,8 +36,8 @@ struct frv_solib_ops : public solib_ops void relocate_section_addresses (solib &so, target_section *) const override; void clear_solib (program_space *pspace) const override; - void create_inferior_hook (int from_tty) const override; - owning_intrusive_list current_sos () const override; + void create_inferior_hook (int from_tty) override; + owning_intrusive_list current_sos () override; bool in_dynsym_resolve_code (CORE_ADDR pc) const override; }; @@ -321,7 +321,7 @@ lm_base (void) } owning_intrusive_list -frv_solib_ops::current_sos () const +frv_solib_ops::current_sos () { bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ()); CORE_ADDR lm_addr, mgot; @@ -789,7 +789,7 @@ frv_relocate_main_executable (void) enabled. */ void -frv_solib_ops::create_inferior_hook (int from_tty) const +frv_solib_ops::create_inferior_hook (int from_tty) { /* Relocate main executable. */ frv_relocate_main_executable (); diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c index a54e3a5a400b..9f2fc915b12b 100644 --- a/gdb/solib-rocm.c +++ b/gdb/solib-rocm.c @@ -215,11 +215,11 @@ struct rocm_solib_ops : public solib_ops { return std::move (m_host_ops); } /* The methods implemented by rocm_solib_ops. */ - owning_intrusive_list current_sos () const override; - void create_inferior_hook (int from_tty) const override; - gdb_bfd_ref_ptr bfd_open (const char *pathname) const override; + owning_intrusive_list current_sos () override; + void create_inferior_hook (int from_tty) override; + gdb_bfd_ref_ptr bfd_open (const char *pathname) override; void relocate_section_addresses (solib &so, target_section *) const override; - void handle_event () const override; + void handle_event () override; /* Implement the following methods just to forward the calls to the host solib_ops. We currently need to implement all the methods that @@ -270,7 +270,7 @@ struct rocm_solib_ops : public solib_ops private: owning_intrusive_list - solibs_from_rocm_sos (const std::vector &sos) const; + solibs_from_rocm_sos (const std::vector &sos); solib_ops_up m_host_ops; }; @@ -303,7 +303,7 @@ rocm_solib_ops::relocate_section_addresses (solib &so, static void rocm_update_solib_list (); void -rocm_solib_ops::handle_event () const +rocm_solib_ops::handle_event () { /* Since we sit on top of a host solib_ops, we might get called following an event concerning host libraries. We must therefore forward the call. If @@ -319,7 +319,7 @@ rocm_solib_ops::handle_event () const /* Create solib objects from rocm_so objects in SOS. */ owning_intrusive_list -rocm_solib_ops::solibs_from_rocm_sos (const std::vector &sos) const +rocm_solib_ops::solibs_from_rocm_sos (const std::vector &sos) { owning_intrusive_list dst; @@ -334,7 +334,7 @@ rocm_solib_ops::solibs_from_rocm_sos (const std::vector &sos) const objects currently loaded in the inferior. */ owning_intrusive_list -rocm_solib_ops::current_sos () const +rocm_solib_ops::current_sos () { /* First, retrieve the host-side shared library list. */ owning_intrusive_list sos = m_host_ops->current_sos (); @@ -692,7 +692,7 @@ rocm_bfd_iovec_open (bfd *abfd, inferior *inferior) } gdb_bfd_ref_ptr -rocm_solib_ops::bfd_open (const char *pathname) const +rocm_solib_ops::bfd_open (const char *pathname) { /* Handle regular files with SVR4 open. */ if (strstr (pathname, "://") == nullptr) @@ -780,7 +780,7 @@ rocm_solib_ops::bfd_open (const char *pathname) const } void -rocm_solib_ops::create_inferior_hook (int from_tty) const +rocm_solib_ops::create_inferior_hook (int from_tty) { get_solib_info (current_inferior ())->solib_list.clear (); diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 8e3de4d3ea1a..35c81000b10a 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1059,7 +1059,7 @@ svr4_solib_ops::clear_so (const solib &so) const /* Create the solib objects equivalent to the svr4_sos in SOS. */ owning_intrusive_list -svr4_solib_ops::solibs_from_svr4_sos (const std::vector &sos) const +svr4_solib_ops::solibs_from_svr4_sos (const std::vector &sos) { owning_intrusive_list dst; @@ -1253,7 +1253,7 @@ svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list, linker, build a fallback list from other sources. */ owning_intrusive_list -svr4_solib_ops::default_sos (svr4_info *info) const +svr4_solib_ops::default_sos (svr4_info *info) { if (!info->debug_loader_offset_p) return {}; @@ -1452,7 +1452,7 @@ svr4_solib_ops::current_sos_direct (svr4_info *info) const /* Collect sos read and stored by the probes interface. */ owning_intrusive_list -svr4_solib_ops::collect_probes_sos (svr4_info *info) const +svr4_solib_ops::collect_probes_sos (svr4_info *info) { owning_intrusive_list res; @@ -1469,7 +1469,7 @@ svr4_solib_ops::collect_probes_sos (svr4_info *info) const method. */ owning_intrusive_list -svr4_solib_ops::current_sos_1 (svr4_info *info) const +svr4_solib_ops::current_sos_1 (svr4_info *info) { owning_intrusive_list sos; @@ -1496,7 +1496,7 @@ svr4_solib_ops::current_sos_1 (svr4_info *info) const /* Implement the "current_sos" solib_ops method. */ owning_intrusive_list -svr4_solib_ops::current_sos () const +svr4_solib_ops::current_sos () { svr4_info *info = get_svr4_info (current_program_space); @@ -2143,7 +2143,7 @@ svr4_solib_ops::disable_probes_interface (svr4_info *info) const standard interface. */ void -svr4_solib_ops::handle_event () const +svr4_solib_ops::handle_event () { struct svr4_info *info = get_svr4_info (current_program_space); struct probe_and_action *pa; @@ -3318,7 +3318,7 @@ svr4_relocate_main_executable (void) their symbols to be read at a later time. */ void -svr4_solib_ops::create_inferior_hook (int from_tty) const +svr4_solib_ops::create_inferior_hook (int from_tty) { struct svr4_info *info; diff --git a/gdb/solib-svr4.h b/gdb/solib-svr4.h index 3078a092778c..d7f58a76224d 100644 --- a/gdb/solib-svr4.h +++ b/gdb/solib-svr4.h @@ -99,14 +99,14 @@ struct svr4_solib_ops : public solib_ops void relocate_section_addresses (solib &so, target_section *) const override; void clear_so (const solib &so) const override; void clear_solib (program_space *pspace) const override; - void create_inferior_hook (int from_tty) const override; - owning_intrusive_list current_sos () const override; + void create_inferior_hook (int from_tty) override; + owning_intrusive_list current_sos () override; bool open_symbol_file_object (int from_tty) const override; bool in_dynsym_resolve_code (CORE_ADDR pc) const override; bool same (const solib &gdb, const solib &inferior) const override; bool keep_data_in_core (CORE_ADDR vaddr, unsigned long size) const override; void update_breakpoints () const override; - void handle_event () const override; + void handle_event () override; std::optional find_solib_addr (solib &so) const override; bool supports_namespaces () const override { return true; } int find_solib_ns (const solib &so) const override; @@ -135,7 +135,7 @@ struct svr4_solib_ops : public solib_ops void free_probes_table (svr4_info *info) const; CORE_ADDR find_r_brk (svr4_info *info) const; CORE_ADDR find_r_ldsomap (svr4_info *info) const; - owning_intrusive_list default_sos (svr4_info *info) const; + owning_intrusive_list default_sos (svr4_info *info); int read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, CORE_ADDR debug_base, std::vector &sos, int ignore_first) const; @@ -144,10 +144,10 @@ struct svr4_solib_ops : public solib_ops CORE_ADDR lm_addr_check (const solib &so, bfd *abfd) const; CORE_ADDR read_r_next (CORE_ADDR debug_base) const; CORE_ADDR read_r_map (CORE_ADDR debug_base) const; - owning_intrusive_list collect_probes_sos (svr4_info *info) const; - owning_intrusive_list current_sos_1 (svr4_info *info) const; + owning_intrusive_list collect_probes_sos (svr4_info *info); + owning_intrusive_list current_sos_1 (svr4_info *info); owning_intrusive_list solibs_from_svr4_sos - (const std::vector &sos) const; + (const std::vector &sos); void disable_probes_interface (svr4_info *info) const; void update_full (svr4_info *info) const; int update_incremental (svr4_info *info, CORE_ADDR debug_base, diff --git a/gdb/solib-target.c b/gdb/solib-target.c index ac965df20e94..0df8c6048aef 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -232,7 +232,7 @@ solib_target_parse_libraries (const char *library) #endif owning_intrusive_list -target_solib_ops::current_sos () const +target_solib_ops::current_sos () { owning_intrusive_list sos; diff --git a/gdb/solib-target.h b/gdb/solib-target.h index 0d2f0840aa63..abfa0b513742 100644 --- a/gdb/solib-target.h +++ b/gdb/solib-target.h @@ -29,7 +29,7 @@ struct target_solib_ops : solib_ops using solib_ops::solib_ops; void relocate_section_addresses (solib &so, target_section *) const override; - owning_intrusive_list current_sos () const override; + owning_intrusive_list current_sos () override; bool in_dynsym_resolve_code (CORE_ADDR pc) const override; }; diff --git a/gdb/solib.c b/gdb/solib.c index 869b769d0439..561a1448cfe6 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -439,7 +439,7 @@ solib_bfd_open (const char *pathname) } gdb_bfd_ref_ptr -solib_ops::bfd_open (const char *pathname) const +solib_ops::bfd_open (const char *pathname) { return solib_bfd_open (pathname); } @@ -572,7 +572,7 @@ solib_map_sections (solib &so) /* See solib.h. */ solib::solib (lm_info_up lm_info, std::string original_name_, - std::string name_, const solib_ops &ops) + std::string name_, solib_ops &ops) : lm_info (std::move (lm_info)), original_name (std::move (original_name_)), name (std::move (name_)), @@ -706,7 +706,7 @@ notify_solib_unloaded (program_space *pspace, const solib &so, void update_solib_list (int from_tty) { - const solib_ops *ops = current_program_space->solib_ops (); + solib_ops *ops = current_program_space->solib_ops (); if (ops == nullptr) return; @@ -1306,7 +1306,7 @@ clear_solib (program_space *pspace) void solib_create_inferior_hook (int from_tty) { - if (const solib_ops *ops = current_program_space->solib_ops (); + if (solib_ops *ops = current_program_space->solib_ops (); ops != nullptr) ops->create_inferior_hook (from_tty); } @@ -1371,7 +1371,7 @@ update_solib_breakpoints (void) void handle_solib_event (void) { - if (const solib_ops *ops = current_program_space->solib_ops (); + if (solib_ops *ops = current_program_space->solib_ops (); ops != nullptr) ops->handle_event (); diff --git a/gdb/solib.h b/gdb/solib.h index 662d467b0cca..b2523906596a 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -62,10 +62,10 @@ struct solib : intrusive_list_node OPS is the solib_ops implementation providing this solib. */ explicit solib (lm_info_up lm_info, std::string original_name, - std::string name, const solib_ops &ops); + std::string name, solib_ops &ops); /* Return the solib_ops implementation providing this solib. */ - const solib_ops &ops () const + solib_ops &ops () const { return *m_ops; } /* Free symbol-file related contents of SO and reset for possible reloading @@ -126,7 +126,7 @@ struct solib : intrusive_list_node private: /* The solib_ops responsible for this solib. */ - const solib_ops *m_ops; + solib_ops *m_ops; }; /* A unique pointer to an solib. */ @@ -168,7 +168,7 @@ struct solib_ops /* Target dependent code to run after child process fork. Defaults to no-op. */ - virtual void create_inferior_hook (int from_tty) const {}; + virtual void create_inferior_hook (int from_tty) {}; /* Construct a list of the currently loaded shared objects. This list does not include an entry for the main executable file. @@ -177,7 +177,7 @@ struct solib_ops inferior --- we don't examine any of the shared library files themselves. The declaration of `struct solib' says which fields we provide values for. */ - virtual owning_intrusive_list current_sos () const = 0; + virtual owning_intrusive_list current_sos () = 0; /* Find, open, and read the symbols for the main executable. If FROM_TTY is non-zero, allow messages to be printed. @@ -193,7 +193,7 @@ struct solib_ops { return false; }; /* Find and open shared library binary file. */ - virtual gdb_bfd_ref_ptr bfd_open (const char *pathname) const; + virtual gdb_bfd_ref_ptr bfd_open (const char *pathname); /* Given two solib objects, GDB from the GDB thread list and INFERIOR from the list returned by current_sos, return true if they represent the same library. @@ -221,7 +221,7 @@ struct solib_ops solib_add is called. Defaults to no-op. */ - virtual void handle_event () const {}; + virtual void handle_event () {}; /* Return an address within the inferior's address space which is known to be part of SO. If there is no such address, or GDB doesn't know diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 78bf49b9c81f..261c38b35635 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -828,7 +828,7 @@ struct windows_solib_ops : target_solib_ops { using target_solib_ops::target_solib_ops; - void create_inferior_hook (int from_tty) const override; + void create_inferior_hook (int from_tty) override; void iterate_over_objfiles_in_search_order (iterate_over_objfiles_in_search_order_cb_ftype cb, objfile *current_objfile) const override; @@ -845,7 +845,7 @@ make_windows_solib_ops (program_space *pspace) /* Implement the "solib_create_inferior_hook" solib_ops method. */ void -windows_solib_ops::create_inferior_hook (int from_tty) const +windows_solib_ops::create_inferior_hook (int from_tty) { CORE_ADDR exec_base = 0; -- 2.55.0