From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0qW1LUx6OGksTikAWB0awg (envelope-from ) for ; Tue, 09 Dec 2025 14:36:44 -0500 Received: by simark.ca (Postfix, from userid 112) id 98DCA1E0AB; Tue, 09 Dec 2025 14:36:44 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED 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 B79FD1E0AB for ; Tue, 09 Dec 2025 14:36:43 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A2F494BA23E9 for ; Tue, 9 Dec 2025 19:36:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2F494BA23E9 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 9DDC24BA2E00 for ; Tue, 9 Dec 2025 19:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DDC24BA2E00 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DDC24BA2E00 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765308975; cv=none; b=JyINzr2+XogT3ieiw9t0PjhUyLka3x08MUZJgeZ8Xi5xng95i5kWhWssV76fm7yF1RoNw4WcUDGzOcHr3medryJnc4uA49wBgxs3fPl8IGPAQCscZf8sC+5cL8CaPxXKUdvMapi2FiQ2UcQoOb9dPcdNzvq0nqPlZ5k1CCTvBFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765308975; c=relaxed/simple; bh=lQLzFOO11DCXlQKtu3XZcymmI2Xrzm9A5XIr9Lkv1m4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=n7xlNE57RLVkNPo9gA05m4ZV+UfRdQSa+OgvC5SvTyj2aq+vlIvriCS/tb6qsw5sccIcwYAoQMqLfibMD+d+MwrJH0OIvvkztv6QJQeJcyd9iIBBNr89xoK0KUirgWhJhMyuPbZWNsrFSayn4yLJ4IOR/UHKmv/CVwmsRG/ruwc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DDC24BA2E00 Received: by simark.ca (Postfix) id F12011E08D; Tue, 09 Dec 2025 14:36:14 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 00/11] Multiple solib_ops in a program_space Date: Tue, 9 Dec 2025 14:32:04 -0500 Message-ID: <20251209193610.296085-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This series adds support for having multiple solib_ops instances providing solibs for a given program_space. The main use case to justify this change is to make rocm_solib_ops less clunky. When debugging ROCm programs, we need to have an instance of svr4_solib_ops providing solibs for host shared libraries, and an instance of rocm_solib_ops providing solibs for device code objects. Since there can only be one solib_ops in a program, rocm_solib_ops has to wrap and replce the svr4_solib_ops instance previously installed. By allowing multiple solib_ops in the same program_space, the two solib_ops instances can co-exist without knowing each other. The main change is contained in the last patch. The patches before that are cleanup or preparatory patches. Simon Marchi (11): gdb/solib-rocm: assert that host ops isn't rocm_solib_ops gdb/solib: use early return in solib_read_symbols gdb/solib-rocm: pass reference to cache to rocm_code_object_stream_file gdb/solib-rocm: add cached_fd to manage cached fd lifetime gdb: de-constify some methods of solib_ops gdb/solib-rocm: move per-inferior data to rocm_solib_ops gdb/solib-rocm: save inferior in rocm_solib_ops gdb/solib: add remove_solib function gdb: add objfile -> solib backlink gdb: change default objfile iteration order to start with current objfile gdb: multiple solib_ops per program space gdb/amd-dbgapi-target.c | 3 +- gdb/infcmd.c | 16 +- gdb/inferior.h | 6 +- gdb/infrun.c | 7 +- gdb/objfiles.h | 23 ++ gdb/observable.h | 8 +- gdb/progspace.c | 91 +++++- gdb/progspace.h | 57 +++- gdb/solib-aix.c | 14 +- gdb/solib-darwin.c | 14 +- gdb/solib-dsbt.c | 10 +- gdb/solib-frv.c | 10 +- gdb/solib-rocm.c | 348 +++++++++----------- gdb/solib-svr4.c | 60 ++-- gdb/solib-svr4.h | 20 +- gdb/solib-target.c | 4 +- gdb/solib-target.h | 2 +- gdb/solib.c | 393 +++++++++++++---------- gdb/solib.h | 50 ++- gdb/target.c | 2 +- gdb/testsuite/gdb.rocm/symbol-lookup.cpp | 320 ++++++++++++++++++ gdb/testsuite/gdb.rocm/symbol-lookup.exp | 243 ++++++++++++++ gdb/windows-tdep.c | 46 +-- 23 files changed, 1221 insertions(+), 526 deletions(-) create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.cpp create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.exp base-commit: bfc430c99b66ab12643a65388c4ace925ebd68b2 -- 2.52.0