From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EMw0Et6pVWhpSxYAWB0awg (envelope-from ) for ; Fri, 20 Jun 2025 14:35:10 -0400 Received: by simark.ca (Postfix, from userid 112) id 47A0B1E11C; Fri, 20 Jun 2025 14:35:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 E0A861E089 for ; Fri, 20 Jun 2025 14:35:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B3793971975 for ; Fri, 20 Jun 2025 18:34:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B3793971975 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by sourceware.org (Postfix) with ESMTPS id DF90E38CCB36 for ; Fri, 20 Jun 2025 18:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF90E38CCB36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF90E38CCB36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750443570; cv=none; b=D7uphL5Ig6fJG6xPXjBtNTo86BYMyAL440S8O08u/xdGFHLrY+zgB2Q9ztJnbMbZk8RM720PEEQ88ACcYpVwYpNFVf6CPGWd268xVrtJ81nzBj80V8z+gJUyL5oGcBFB47OzwqQ6URfiZZQAov3xZgaK6ZabpaN7iPqAIrLux1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750443570; c=relaxed/simple; bh=Jvxv8h134fgxb8+exET5WSmCpFhlEIeBYNo+2+Nzszs=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=Zx7Jkq6zhM1YOrKGLWopKPOn21jkWzVbBm4b+o91lZajX6csB69cGg7hMG5SSo3Oqv/alkrTeSNe90BqaHbsb1BNUaU1rg3jfirlaWsskSCnoK+XcjOU4OkRV8All4SJgs4SB4an1kzCtE1NenOeF39xZkChd4vaePluWeIYJDU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF90E38CCB36 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-450ce671a08so13841805e9.3 for ; Fri, 20 Jun 2025 11:19:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443569; x=1751048369; h=content-transfer-encoding:in-reply-to:content-language:from :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WziMbcD0gQx1XRX/7K1OjRUAoEG15HGFtBTiLe73gX0=; b=Rf6y/e76uKsUZzk2jXWSBBbj6F2Z3J1nVlmic5TvZbwnkd7zWssz1lpF2B36366hXu FeAzln30rQLFE3bX+IR9g4NyVam0cvAn6URiWth9ea+b/MrR8ReKE6ExwdUJ+z+/AfJ6 PkZyItZ/gx6Sj8uWsP015a6n1OCR3AB0actlLuPJur2qNTU35qYSp40S1lIycBUW67Nx ozUNfkY1u2hLlTbUW3NAIbCAg6Lz4C+Rw8nkKHJoEpLK1IFpVvyBelDpAeypA+saFKxC 2UPIGf+0lwQ4DRXu6QTSNRlr/qXDwXOeyAJmlmYmp/V8tqNEKJaopkNmrxnQnLYyEFc0 d69w== X-Forwarded-Encrypted: i=1; AJvYcCUozou7IYhnPyU/P8NEJxeiL8q6Le+o1LY6Z2BvfggLrWur3pUkFuddHLnThu8iuUhxAsZBejSSUOWsew==@sourceware.org X-Gm-Message-State: AOJu0Yz7YrOu7DD6QODJV/v/+udlj7WHLveaTGChefeJ+dYr97vwUxWc MotS6izbvaAheK55w8c7ZRR/jZ5xuXYsANvRWf2GvdB2btSN0nsXTYeW X-Gm-Gg: ASbGncvCVjbQy8qjgJ0JvMAKLZrTBOn7XSa1COefsLGALu82jcddM/7YaSiXddkJ2mG n1UApHPMcc5XzUHmuKNhZBqddEF1XSOHprjHx+0FjMrdUBSuFR7GURg8jFViu5qXp1l3sThEvmF mvo+XCEX5mZJ2Zee2C6nRId/LK97Q5YremYUidJnJViGWjtK+s9Ga3l+E/+z71Vh/mKH8CKr4f1 apmrqyaSQOar2vT77RS2GArqQEJs1jATKN7Q3QoKyRhOAzSUe/TwIKprk11eJrmp+VzuupaoN3b NZCwKlj6lvtq6ABiY469EC+CyIBlLxtI8YefXfuK/9yj0yRUdoklhpaDBemxpDccYAK3QsCuxlI QgGN/2pXUwAhBAYvLQoact3Bp0m/BMw== X-Google-Smtp-Source: AGHT+IEvR8n+HODWsxh9ifgfIUgrf61rE2LIRmyIrS3Z3SPPLl6L5ajpGdKpUsH9b1xJ3nQ/zURsYw== X-Received: by 2002:a05:6000:4112:b0:3a4:ddd6:427f with SMTP id ffacd0b85a97d-3a6d13045f5mr3791984f8f.35.1750443568669; Fri, 20 Jun 2025 11:19:28 -0700 (PDT) Received: from ?IPV6:2001:8a0:fac3:6d00:afcc:85d3:71a5:7570? ([2001:8a0:fac3:6d00:afcc:85d3:71a5:7570]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a6d128cf7asm2654002f8f.100.2025.06.20.11.19.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jun 2025 11:19:28 -0700 (PDT) Message-ID: <99a1325c-d9f6-4862-aacb-16f3433ccede@palves.net> Date: Fri, 20 Jun 2025 19:19:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/6] gdb/progspace: add solib_ops pointer in program_space To: Simon Marchi , gdb-patches@sourceware.org References: <20250616193443.16703-1-simon.marchi@efficios.com> <20250616193443.16703-5-simon.marchi@efficios.com> From: Pedro Alves Content-Language: en-US In-Reply-To: <20250616193443.16703-5-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2025-06-16 20:33, Simon Marchi wrote: > New in v3: > > - add some ops nullptr checks in print_solib_list_table and > info_linker_namespace_command > > The subsequent C++ification patch in this series will allocate one > instance of solib_ops per program space. That instance will be held in > struct program_space. As a small step towards this, add an `solib_ops > *` field to `struct program_space`. This field represents the solib_ops > currently used to manage the solibs in that program space. Initialize > it with the result of `gdbarch_so_ops` in `post_create_inferior`, and > use it whenever we need to do some solib stuff, rather than using > `gdbarch_so_ops` directly. > > The difficulty here is knowing when exactly to set and unset the solib > ops. What I have here passes the testsuite on Linux, but with more > testing we will probably discover more spots where it's needed. One important detail is keeping the solibs listed after the inferior exits. This is so the user can set breakpoints in shared library symbols for the next re-run. Your patches preserve that, which is good. I don't recall off hand if there's a testcase ensure it. Tiny nit below. Other than that: Approved-By: Pedro Alves > diff --git a/gdb/progspace.h b/gdb/progspace.h > index 5e5d5edd9b4b..abb448195d74 100644 > --- a/gdb/progspace.h > +++ b/gdb/progspace.h > @@ -231,6 +231,23 @@ struct program_space > is outside all objfiles in this progspace. */ > struct objfile *objfile_for_address (CORE_ADDR address); > > + /* Set this program space's solib provider. > + > + The solib provider must be unset prior to call this method. */ "prior to call" -> prior to calling" > + void set_solib_ops (const struct solib_ops &ops) > + { > + gdb_assert (m_solib_ops == nullptr); > + m_solib_ops = &ops; > + }; > +