From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OX/PHqLGTmpG0iwAWB0awg (envelope-from ) for ; Wed, 08 Jul 2026 17:52:34 -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=uigZZMX7; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7C2691E04F; Wed, 08 Jul 2026 17:52:34 -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 089711E04F for ; Wed, 08 Jul 2026 17:52:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 789684BA23C4 for ; Wed, 8 Jul 2026 21:52:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 789684BA23C4 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=uigZZMX7 Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E7E844BA2E13 for ; Wed, 8 Jul 2026 21:51:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7E844BA2E13 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 E7E844BA2E13 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=1783547519; cv=none; b=AzM4VqrxhomwUPbHtZaPua7eq6LxwzvC27vrykqOZ/95DkdVxE7N6SnteHSYEfa3GlGFk/Ivqy7ZJY2CfjgqWwwOYf7see7R6n2I/9UbOr4OfQJgRHj4guK59te8XDrU1jvJdOx960Gg+n09X+MOq8eZajpLtGBFofUCsmBHmas= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783547519; c=relaxed/simple; bh=/R9BmTF7Snn8thIX5485JOV1/vStKW/myeRbJEbpQMQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=P6Tav4iOa1W8ms7+gn6mmkCxuLnyKpvAHzMqwT89lGdNxitCMPPtJPakqiFPKtunDA4F/qo9zcg+yEl0lXTa2PujaYxtVW9RqG3Tq6EHNB5mar4RGVMmLwctv9h/ealNwvOEibTGCiD47zGDbMxFymhtoOWPduZEPBnbVDbZ+B8= 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=uigZZMX7 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7E844BA2E13 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 668LpnCC117301 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 Jul 2026 17:51:54 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 668LpnCC117301 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1783547515; bh=F3meGCF3Q5J8WxFcd+JgfK8RRkOQjMF2mLI2yuKb+dU=; h=From:To:Cc:Subject:Date:From; b=uigZZMX7cZHS4ZMCAuMBkKbthW7HDUzQnKFXwMyx2VxC9wm5uUEQA8Bc9UPiTyv2w P3WYVVMrl4MJ0SXsC+gTqXECJjGc/ImE/jdS2N1zoBVKKhMcvZq6vEpeJ+sx1hab0B 7kVUbK+T+xdU6WlS4l1iFkRCB9lYBhYijbZLzTlZkujNVyY6TPCV0Ir4U9KDU/AoBK BZooYjNMWmz7eilL2JPqDDYJsOCdj/igNdEuLVWaHoqseN8gA8RmGhaGq4/EFa3tDr m6iRXabndnGuMd11mHmYBjZbGyp6GqWhn8JHP6Q+8imqOXM2Ops3RjebspzViEOVmF FqN5r/mL0oamg== Received: by simark.ca (Postfix) id 1CC511E04F; Wed, 08 Jul 2026 17:51:49 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Tom Tromey , Lancelot SIX , Simon Marchi Subject: [PATCH v3 00/10] Multiple solib_ops in a program_space Date: Wed, 8 Jul 2026 17:51:32 -0400 Message-ID: <20260708215145.93134-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 8 Jul 2026 21:51:49 +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 This is v3 of: https://inbox.sourceware.org/gdb-patches/20260608200100.666134-7-simon.marchi@efficios.com/T/#m41d7f6aa673b981591cbc1bca6833c7c6a8dc3e3 This version fixes a transient use-after-free bug (introduced by one patch, fixed later in the series) identified by Lancelot. To fix it with minimal disruption, I moved the "gdb/solib: add remove_solib function" patch earlier, and then made patch "gdb/solib-rocm: move per-inferior data to rocm_solib_ops" remove ROCm solibs when removing the rocm_solib_ops instance for the pspace. This code disappears with the last patch, which introduces the same behavior but in a more general way: when removing an solib_ops, GDB now automatically removes all the solibs from that solib_ops. The patches without explicit approvals are: - gdb/solib-rocm: move per-inferior data to rocm_solib_ops - gdb: add objfile -> solib backlink 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: add remove_solib function gdb/solib-rocm: move per-inferior data to rocm_solib_ops gdb/solib-rocm: save inferior in rocm_solib_ops 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 | 340 ++++++++++------------- gdb/solib-svr4.c | 60 ++-- gdb/solib-svr4.h | 20 +- gdb/solib-target.c | 4 +- gdb/solib-target.h | 2 +- gdb/solib.c | 314 ++++++++++++--------- 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, 1178 insertions(+), 476 deletions(-) create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.cpp create mode 100644 gdb/testsuite/gdb.rocm/symbol-lookup.exp base-commit: 46709f190eb7ddf3888226feec6c1e13984cfcc9 -- 2.55.0