From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sRqrB7kfJ2oVnDwAWB0awg (envelope-from ) for ; Mon, 08 Jun 2026 16:02:01 -0400 Received: by simark.ca (Postfix, from userid 112) id 1BE301E0A3; Mon, 08 Jun 2026 16:02:01 -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.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 88BD41E070 for ; Mon, 08 Jun 2026 16:02:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 198464B19686 for ; Mon, 8 Jun 2026 20:02:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 198464B19686 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B49F34BA2E25 for ; Mon, 8 Jun 2026 20:01:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B49F34BA2E25 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 B49F34BA2E25 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780948861; cv=none; b=ZvvgRByZz5fsDx7JYNjMtBjW0QUBbMk0fA9pEgF8OAXzasE/5eRErMFTJyzFLUl8AyQZy9FwRGx9iReQT/KdL3ZRjpp8V4pUpm0vYWMEmdtnpy6K68qZBbCrTzdrAHUSmoTZYWaYUKqZgOvg4CYUinMkZxbLZXNydVoZM4yIQcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780948861; c=relaxed/simple; bh=Luol3dcRqGXsJ+NohDW7urzx0+PbmsqEo/AmWovoMjk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xCXlV7mAaY04diF/W4ahkr2LyGTHoTrHbUDnKJghn3gi7KgWlibE0Rz+pWzuVTQkRLNiMvHW52HinNeGzFqw/XTOG7ETzleL2QofzYFZCLENdJVjYuKNfdFzTpYQoYfoq/abOHIo4HUBYO0eOp/YxMKRqbjqaMGruNmlJwIIp0E= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B49F34BA2E25 Received: by simark.ca (Postfix) id 5C3261E070; Mon, 08 Jun 2026 16:01:01 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH RESEND v2 00/10] Multiple solib_ops in a program_space Date: Mon, 8 Jun 2026 16:00:24 -0400 Message-ID: <20260608200100.666134-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.54.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 Looks like I'm having trouble with my outbound emails, I tried to fix it, let me attempt a resend. This is v2 of: https://inbox.sourceware.org/20251209193610.296085-1-simon.marchi%40efficios.com The changes mainly happened in the ROCm preparatory patches, following review on v1. There were also some non-trivial rebase conflicts. I have pushed patch "gdb/solib: use early return in solib_read_symbols". The following patches are missing explicit approvals: [01/10] gdb/solib-rocm: assert that host ops isn't rocm_solib_ops [03/10] gdb/solib-rocm: add cached_target_fd to manage cached fd lifetime [04/10] gdb: de-constify some methods of solib_ops [05/10] gdb/solib-rocm: move per-inferior data to rocm_solib_ops [06/10] gdb/solib-rocm: save inferior in rocm_solib_ops [08/10] gdb: add objfile -> solib backlink During review of v1, Tom Tromey raised the idea of using multiple program spaces per inferior to represent the host and device code. I think it would be a good idea to give it a try, and it might be a conceptually better idea. But it would also be a significantly larger and more difficult change, I can't do it in a reasonable time frame, and there are features coming up waiting for a solution to this problem. I therefore plan to merge this multiple solib ops series (which isn't inherently bad) and explore the multiple program space idea separately without pressure of having to deliver quickly. If that multiple program space idea ends up working, then the multiple solib ops thing will become unnecessary, in which case we can remove it. Below is the original cover letter, which still applies. 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 (10): gdb/solib-rocm: assert that host ops isn't rocm_solib_ops gdb/solib-rocm: pass reference to cache to rocm_code_object_stream_file gdb/solib-rocm: add cached_target_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 | 342 ++++++++++------------- gdb/solib-svr4.c | 60 ++-- gdb/solib-svr4.h | 20 +- gdb/solib-target.c | 4 +- gdb/solib-target.h | 2 +- gdb/solib.c | 320 ++++++++++++--------- gdb/solib.h | 44 ++- 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, 1182 insertions(+), 480 deletions(-) create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.cpp create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.exp base-commit: 748350ae9e20d4698527c57bb3d3d76a33242cab -- 2.54.0