From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yQFuMaHhS2r6BioAWB0awg (envelope-from ) for ; Mon, 06 Jul 2026 13:10:57 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TAUR7Gwz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C335B1E098; Mon, 06 Jul 2026 13:10:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 EB3341E024 for ; Mon, 06 Jul 2026 13:10:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 864474BA2E16 for ; Mon, 6 Jul 2026 17:10:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 864474BA2E16 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TAUR7Gwz Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013031.outbound.protection.outlook.com [40.93.201.31]) by sourceware.org (Postfix) with ESMTPS id 7947D4BA2E07 for ; Mon, 6 Jul 2026 17:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7947D4BA2E07 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7947D4BA2E07 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.93.201.31 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783357793; cv=pass; b=kZ13JcIZZxD0IGo1z3A8r7BNw+idf0Oimz3pjNELUAmHbnKd9y91fCvvUMssZKjfuZEgLTzk7PZ6/afaIJR/QyvB3LNNrhiN6w+eSKFmYP3FNyugzaOg6d0AsPFUDw55Psn57dkkPwedpYZHvUOaKlkA+sLUkIhgxFv87bQf13A= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783357793; c=relaxed/simple; bh=PuIqEQWYMHQjwjbe/0UfU5KiVKOzxUUZZ/S4vynBtHQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=DzjWS1GQy5guVZ2EDzNGRQpeuW2jGWjpLiyP1NHjUjTn0vwaxytPiA/doIIe5+VTM7HnzvH6kh9WQzjZmqKZC+ucBhXvjN3jW60EXPPdm/C0NISJzzxNdkf3ssEkowMhWnIvpH6WDYyTx/CHvaCs4aVarP9QE9uzphBXXVfiq00= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TAUR7Gwz DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7947D4BA2E07 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HlXLiPhlmKc3+6noG2q2VdDUNPA3Sl5xtrjc6xv/xwuFLbDES2nmL9Tb4RDj6vfUFJXleV7GWH/ahHlQSRxoY+cmKdgDK0fpIfGvwLBZzohSUrUBesnwhadn/T1ypObdVPUsiIqrGkixiKE86NsoxkTlKk6nEqT3Ktzr900TTBmCcUAV2zG+1HW0j7rPf+EVyXhtssu2YEEILED5NfFD+TJGezT7OMiV+SBd1esbMPVDIotpznRHIdzG4pJtGG/h4WM5YfygIyUn1BAXQsQ7+BUnOBunYkmUl+2x4ERHq6dFk2CotvaywIBIe4bF/FSdaGOsLkk86HpXbaztP3hbug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=brUH/dokYWzoKLC1uQeZqHOBbVvZnFkfHDIchKBBSmw=; b=knijJ9LdmDFz8fnVo84XbBweQYzMq4U0xM48ubWM8HQEGgjczZZqsefZbLNgDpTnhn84LYSLZtxxnQq5P4SPu9P39ZSbeHcZ4/sxO+Wa48jx22JA2acqawX6QcqaNWav0/O3F0N4oXChUgm4J2Ujzo4EaFEkl4J4LKXHO/woDH8JQsTSM9LPSIxD6NV3IqYjzgyvDYf6NIjH+pVBxsAOblb6nbga7b++Juz52M2TofmOe4EGfVmv74KkhMXyBj1le1Zh2D8jD6G0ECo4dRGbaYD/tO6OyqQtkAznuGpdo275PrBQRPSbE0f6cQjV/I2ieB3IG0wEQMRwUu86GPPEyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=efficios.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=brUH/dokYWzoKLC1uQeZqHOBbVvZnFkfHDIchKBBSmw=; b=TAUR7GwzWkbJJH/U0HARKotFlmiiwBMsBc09bY1juGzdt3INZYKN0uxeQkBRV/9JkaeKupCAZbS3joVsoEfWJg/H1OgDW0p3VQj/Z7JSTLAEIL7FL0t/dtUaH/COusmF98T33hVSiuWFgdE4lGaZ03Soqr8oxVIzFPgFt/xM7Gw= Received: from SJ0PR03CA0096.namprd03.prod.outlook.com (2603:10b6:a03:333::11) by CY8PR12MB9035.namprd12.prod.outlook.com (2603:10b6:930:77::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Mon, 6 Jul 2026 17:09:41 +0000 Received: from SJ5PEPF000001C8.namprd05.prod.outlook.com (2603:10b6:a03:333:cafe::7a) by SJ0PR03CA0096.outlook.office365.com (2603:10b6:a03:333::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.8 via Frontend Transport; Mon, 6 Jul 2026 17:09:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by SJ5PEPF000001C8.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Mon, 6 Jul 2026 17:09:41 +0000 Received: from khazad-dum (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 6 Jul 2026 12:09:40 -0500 Date: Mon, 6 Jul 2026 18:09:30 +0100 From: Lancelot SIX To: Simon Marchi , Subject: Re: [PATCH v2 5/10] gdb/solib-rocm: move per-inferior data to rocm_solib_ops Message-ID: <6fq2jwcy7nc6ande7vbiuxkd3n2u2nrrvzvezw2ivok6epyewc@zqfl6jj7qneb> References: <20260608200100.666134-6-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260608200100.666134-6-simon.marchi@efficios.com> X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb08.amd.com (10.181.42.217) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001C8:EE_|CY8PR12MB9035:EE_ X-MS-Office365-Filtering-Correlation-Id: bed79b2a-c4ff-4f65-a5cf-08dedb815e73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700016|82310400026|23010399003|1800799024|3023799007|13003099007|22082099003|18002099003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: 1ZNA6xsKJn1aB/TcF0wAcw54B25UmVhCB7L7m5OCFYYOVQWDNXBiONFkw/Ka51buM9CE241820rdug9B93BJ01owYbtq0jbNESPed4WN91RD6mgj/+qaPMEBPvfv5f7PRd68U/zzkUrPkaT+m3+RuV5rup4EfehdFwmt8ywVqelcWaEFkpoyoG70QhRo/wogQlGZYPY4cE2jvfdTC8R2P/hhVOAQrLYwX1Npt67osgdx4RDzSFL3mf/iPmJb9adRhgvuSftsdC4FaBL41k849Alw5IZPrAOJvsIsLlf9OiwIL/5PZaRdANVAatvOcdHypjmC3DiZuKYl8wl3nCfpMmfY6qZ9gth17WDqthUCDOeEuGnb6FnUi8D2ajEH2A94u9pseUIUYmkItdOrPGb9KnWuRGxLAvKkhaM0/10bbNsYeeaoSco9oVNnTeTwavcGRT90K65jpjPWWCLWCMHK8m7touVYWLQOTQFa3WeMQLGDNRFyH/uWZ88pN2/XRUMLjlFNt+OJ6hx5J6qKBQzR28vLNJGqlbErkaaWfo2rVAQLCPKeJibu4CmcQ9SImLLXN0OsN2RhRAochEzTQz8r+5boApCS2V/7nYKv884taVVBnwZmoPaacdrqMQ97IH9dKnqM7Ezm1p7ZOJmIbg83jhtHPbG4ulNTKBtUbLhAq9w= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb08.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700016)(82310400026)(23010399003)(1800799024)(3023799007)(13003099007)(22082099003)(18002099003)(56012099006)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dju6iHhhps1ORC2kWY4/5cV4OR+qm699/MyCwwLKAoS5nc5VbomxtIzLVa05Q7jAr05w6WAiP9m/8gg/PbUDuEaXdECkKd1d+B7RIQO/79rNS4TaDD1Aiq6v6yTQB+EfCXlMYbVDwg2ygMRSIzi9xwfdnSUt7ZXXAaFZ4yTJctdGqjjr1eTT1/wMW9rAl4xkWCmoAoZcANSEqqGOV5jOtWX4KhguRYiGspxqCi2VdFvqcQ9cSYdgprIuEiUtMkwmiFxtDxNlq0nFnzeNg4q6KJWWIcCMQ80BBNfWzXOXjmuaobKPGDoGL1WUq9v5PDoRAuEKQnd0S7/7TotoN87znMBmNwIbxmQDKngvKfgLEYdM16xJCLs8lx0T9pAeZ5uHL2mVFGg3TrZcn3yUPMoCXMG47XuAdc8ce1lNCbfxPSj4E1KZ+z2Qx8ovDrI/IMLd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2026 17:09:41.4066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bed79b2a-c4ff-4f65-a5cf-08dedb815e73 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001C8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB9035 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 On Mon, Jun 08, 2026 at 04:00:29PM -0400, Simon Marchi wrote: > Move the data currently stored in an inferior registry directly into > rocm_solib_ops. This changes the storage of this data from "per > inferior" to "per program-space", but it should be equivalent, since > there is usually a 1:1 mapping between those two. The only time there > isn't a 1:1 mapping is during a vfork, before the exec/exit, but no ROCm > activity happens during that slice of time. > > Function rocm_update_solib_list becomes > rocm_solib_ops::update_solib_list. > > Function rocm_bfd_iovec_open becomes rocm_solib_ops::bfd_iovec_open. > > Most of the changes consist of accessing the fields directly, instead of > going through the solib_info object. > > The rocm_solib_ops constructor has to take an inferior as a parameter, > rather than a program_space, because of the fd cache. > Hi Simon, It seems that this patch introduces a use-after-free issue when handling the "detach-on-fork on", "follow-fork-mode child" case (I see this with the gdb.rocm/fork-exec-gpu-to-non-gpu.exp testcase with ASAN enabled). When doing the case where we follow the child, we reach rocm_solib_target_inferior_forked: if (detach_on_fork && follow_child && fork_kind == TARGET_WAITKIND_FORKED) { auto rocm_ops_holder = child_inf->pspace->release_solib_ops (); auto rocm_ops = gdb::checked_static_cast (rocm_ops_holder.get ()); child_inf->pspace->set_solib_ops (rocm_ops->release_host_ops ()); } On exit here of this block, the rocm_ops is deleted (calls rocm_solib_ops::~rocm_solib_ops). However, at this stage, if there are still solibs which were opened by rocm_solib_ops, the next call to update_solib_list will lead to deleting the solib which do not exist anymore (so far so good). Any file rocm-solib still open at this point will eventually be closed when we close the associated BFD. This calls into rocm_solib_fd_cache::close, which tries to access the rocm_solib_fd_cache::m_cache field. However, this is a reference to a rocm_solib_ops::m_fd_cache, which is now gone, leading to a use after free. This was not an issue until this patch because the fd_cache was owned by the per-inferior rocm_solib_data. which is not going anywhere during the fork. Best, Lancelot. > Change-Id: I386139008b6f0eca1d897fc35be18faa9d5a104e > --- > gdb/solib-rocm.c | 90 ++++++++++++++++++------------------------------ > 1 file changed, 33 insertions(+), 57 deletions(-) > > diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c > index 4032ada28a0f..618f4f5e7905 100644 > --- a/gdb/solib-rocm.c > +++ b/gdb/solib-rocm.c > @@ -181,30 +181,15 @@ struct rocm_so > lm_info_svr4_up lm_info; > }; > > -struct solib_info > -{ > - explicit solib_info (inferior *inf) > - : fd_cache (inf) > - {}; > - > - /* List of code objects loaded into the inferior. */ > - std::vector solib_list; > - > - /* Cache of opened FD in the inferior. */ > - rocm_solib_fd_cache fd_cache; > -}; > - > -/* Per-inferior data key. */ > -static const registry::key rocm_solib_data; > - > /* solib_ops for ROCm systems. */ > > struct rocm_solib_ops : public solib_ops > { > /* HOST_OPS is the host solib_ops that rocm_solib_ops hijacks / wraps, > in order to provide support for ROCm code objects. */ > - explicit rocm_solib_ops (program_space *pspace, solib_ops_up host_ops) > - : solib_ops (pspace), m_host_ops (std::move (host_ops)) > + explicit rocm_solib_ops (inferior *inf, solib_ops_up host_ops) > + : solib_ops (inf->pspace), m_host_ops (std::move (host_ops)), > + m_fd_cache (inf) > { > gdb_assert (m_host_ops != nullptr); > gdb_assert (dynamic_cast (m_host_ops.get ()) == nullptr); > @@ -221,6 +206,10 @@ struct rocm_solib_ops : public solib_ops > void relocate_section_addresses (solib &so, target_section *) const override; > void handle_event () override; > > + /* This needs to be public because it is called from > + rocm_solib_target_inferior_created. */ > + void update_solib_list (); > + > /* Implement the following methods just to forward the calls to the host > solib_ops. We currently need to implement all the methods that > svr4_solib_ops implements. */ > @@ -271,18 +260,17 @@ struct rocm_solib_ops : public solib_ops > private: > owning_intrusive_list > solibs_from_rocm_sos (const std::vector &sos); > + gdb_bfd_iovec_base *bfd_iovec_open (bfd *abfd, inferior *inferior); > > solib_ops_up m_host_ops; > + > + /* List of code objects loaded into the inferior. */ > + std::vector m_solib_list; > + > + /* Cache of opened FD in the inferior. */ > + rocm_solib_fd_cache m_fd_cache; > }; > > -/* Fetch the solib_info data for INF. */ > - > -static struct solib_info * > -get_solib_info (inferior *inf) > -{ > - return &rocm_solib_data.try_emplace (inf, inf); > -} > - > /* Relocate section addresses. */ > > void > @@ -300,8 +288,6 @@ rocm_solib_ops::relocate_section_addresses (solib &so, > sec->endaddr = sec->endaddr + li->l_addr; > } > > -static void rocm_update_solib_list (); > - > void > rocm_solib_ops::handle_event () > { > @@ -313,7 +299,7 @@ rocm_solib_ops::handle_event () > previously loaded). */ > m_host_ops->handle_event (); > > - rocm_update_solib_list (); > + this->update_solib_list (); > } > > /* Create solib objects from rocm_so objects in SOS. */ > @@ -340,12 +326,10 @@ rocm_solib_ops::current_sos () > owning_intrusive_list sos = m_host_ops->current_sos (); > > /* Then, the device-side shared library list. */ > - std::vector &dev_sos = get_solib_info (current_inferior ())->solib_list; > - > - if (dev_sos.empty ()) > + if (m_solib_list.empty ()) > return sos; > > - owning_intrusive_list dev_solibs = solibs_from_rocm_sos (dev_sos); > + owning_intrusive_list dev_solibs = solibs_from_rocm_sos (m_solib_list); > > if (sos.empty ()) > return dev_solibs; > @@ -525,8 +509,8 @@ rocm_code_object_stream_memory::read (bfd *, void *buf, file_ptr size, > > } /* anonymous namespace */ > > -static gdb_bfd_iovec_base * > -rocm_bfd_iovec_open (bfd *abfd, inferior *inferior) > +gdb_bfd_iovec_base * > +rocm_solib_ops::bfd_iovec_open (bfd *abfd, inferior *inferior) > { > std::string_view uri (bfd_get_filename (abfd)); > std::string_view protocol_delim = "://"; > @@ -635,10 +619,9 @@ rocm_bfd_iovec_open (bfd *abfd, inferior *inferior) > && decoded_path[3] == '/') > decoded_path.erase (0, 1); > > - auto info = get_solib_info (inferior); > fileio_error target_errno; > rocm_solib_fd_cache::cached_target_fd fd > - = info->fd_cache.open (decoded_path, &target_errno); > + = m_fd_cache.open (decoded_path, &target_errno); > > if (fd.fd () == target_fd::INVALID) > { > @@ -698,9 +681,9 @@ rocm_solib_ops::bfd_open (const char *pathname) > if (strstr (pathname, "://") == nullptr) > return m_host_ops->bfd_open (pathname); > > - auto open = [] (bfd *nbfd) -> gdb_bfd_iovec_base * > + auto open = [this] (bfd *nbfd) > { > - return rocm_bfd_iovec_open (nbfd, current_inferior ()); > + return this->bfd_iovec_open (nbfd, current_inferior ()); > }; > > gdb_bfd_ref_ptr abfd = gdb_bfd_openr_iovec (pathname, "elf64-amdgcn", open); > @@ -782,13 +765,12 @@ rocm_solib_ops::bfd_open (const char *pathname) > void > rocm_solib_ops::create_inferior_hook (int from_tty) > { > - get_solib_info (current_inferior ())->solib_list.clear (); > - > + m_solib_list.clear (); > m_host_ops->create_inferior_hook (from_tty); > } > > -static void > -rocm_update_solib_list () > +void > +rocm_solib_ops::update_solib_list () > { > inferior *inf = current_inferior (); > > @@ -796,10 +778,7 @@ rocm_update_solib_list () > if (process_id.handle == AMD_DBGAPI_PROCESS_NONE.handle) > return; > > - solib_info *info = get_solib_info (inf); > - > - info->solib_list.clear (); > - std::vector &sos = info->solib_list; > + m_solib_list.clear (); > > amd_dbgapi_code_object_id_t *code_object_list; > size_t count; > @@ -846,7 +825,8 @@ rocm_update_solib_list () > std::string unique_name > = string_printf ("code_object_%ld", code_object_list[i].handle); > > - sos.emplace_back (uri_bytes, std::move (unique_name), std::move (li)); > + m_solib_list.emplace_back (uri_bytes, std::move (unique_name), > + std::move (li)); > } > } > > @@ -857,17 +837,15 @@ rocm_solib_target_inferior_created (inferior *inf) > if (inf->vfork_parent != nullptr) > return; > > - get_solib_info (inf)->solib_list.clear (); > - > auto prev_ops = inf->pspace->release_solib_ops (); > - auto rocm_ops > - = std::make_unique (inf->pspace, std::move (prev_ops)); > + auto rocm_ops = std::make_unique (inf, std::move (prev_ops)); > inf->pspace->set_solib_ops (std::move (rocm_ops)); > > - rocm_update_solib_list (); > + gdb::checked_static_cast > + (inf->pspace->solib_ops ())->update_solib_list (); > > /* Force GDB to reload the solibs. */ > - current_inferior ()->pspace->clear_solib_cache (); > + inf->pspace->clear_solib_cache (); > solib_add (nullptr, 0, auto_solib_add); > } > > @@ -882,10 +860,8 @@ rocm_solib_target_inferior_execd (inferior *exec_inf, inferior *follow_inf) > auto pspace = follow_inf->pspace; > auto prev_ops = pspace->release_solib_ops (); > auto rocm_ops > - = std::make_unique (pspace, std::move (prev_ops)); > + = std::make_unique (follow_inf, std::move (prev_ops)); > pspace->set_solib_ops (std::move (rocm_ops)); > - > - get_solib_info (exec_inf)->solib_list.clear (); > } > > static void > -- > 2.54.0