From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jJlONN98QGn8dQIAWB0awg (envelope-from ) for ; Mon, 15 Dec 2025 16:25:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765833951; bh=qzwA0Rc3zkpolcfdO4FMsHbI3m7shySM+WiZun41It0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OXQHmb0zDdcCWGw8PnbZ/YyZqdjD1qE1kGC+cy7w1olZuwRXwgdcVgib/q4Q7EtcV v09bvQJRdBGV52I/86vHPnlzr3S9NsxAeJwhprm5H7+NMzAG19DchmUKddfWKmq88A plW9WBqgiHyj+RHW1vUwHwWgAB1D/5NNyUokpELw= Received: by simark.ca (Postfix, from userid 112) id C6ABB1E0BC; Mon, 15 Dec 2025 16:25:51 -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.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ps+DjEmF; dkim-atps=neutral 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 48C451E08D for ; Mon, 15 Dec 2025 16:25:51 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id C00324BA2E04 for ; Mon, 15 Dec 2025 21:25:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C00324BA2E04 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ps+DjEmF Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 847C14BA2E1C for ; Mon, 15 Dec 2025 21:25:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 847C14BA2E1C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 847C14BA2E1C 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=1765833922; cv=none; b=sVxpyyls4SVuFd/W4IUvFboOneTmfpPENKEnYjTHlqYM0raHUUXjPPglWsnaHt1eZ9KwePFf+JIqoKFDFZ6ib8kW0o79up4dJXMBXXYSdhQ/dqi4es12WCr6lDmzE9JNWrB0Nimf7fl2MB/Fxd4WCY/Q44iOD9u62uxu60ztHVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765833922; c=relaxed/simple; bh=qzwA0Rc3zkpolcfdO4FMsHbI3m7shySM+WiZun41It0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mz9eh6qjtg6s0uDStReYa+VzBa8wDyg53nVD0yFmQZlR6zdJkxdz34ACypUyTXnu8kwqMOlET966Cb8o9TlUNiCo9A/tO8RGyU07vTo5bd8WQkUfDMQE6h2vYlDkxj+FstI4Aa5tRk5JkDZtNOCDEvGDk7PWYaXAl/vViG47H5g= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 847C14BA2E1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765833922; bh=qzwA0Rc3zkpolcfdO4FMsHbI3m7shySM+WiZun41It0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ps+DjEmF2AmDaAyLMztNwcy8KPXt30/qYrU/UueLnM9rdEkWkArzyzGpi0PuoTXIH V2PwycebnQZNWxLAMSniFYtiNVr23vrdnSaTxxTDzU2Aru1s6gscw8habChTy8pE4k A31pY6MYKl2jtXjho2MQmB8J6Q2bCgpvqXTwUIyI= Received: by simark.ca (Postfix) id E8A1A1E08D; Mon, 15 Dec 2025 16:25:21 -0500 (EST) Message-ID: <5d7b5bd1-12a1-4f9c-8247-19f6b216bb57@simark.ca> Date: Mon, 15 Dec 2025 16:25:21 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 09/44] gdb, gdbserver, ze: in-memory libraries To: "Metzger, Markus T" Cc: "Aktemur, Tankut Baris" , "gdb-patches@sourceware.org" , Thiago Jung Bauermann References: <20250801-upstream-intelgt-mvp-v3-0-59ce0f87075b@intel.com> <20250801-upstream-intelgt-mvp-v3-9-59ce0f87075b@intel.com> <683efcc8-2a5d-4afe-b44d-8364e6868ecd@simark.ca> <1c2082a9-02df-41ca-84bb-abdf6546ab35@simark.ca> Content-Language: fr From: Simon Marchi In-Reply-To: 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 12/15/25 8:07 AM, Metzger, Markus T wrote: >> Would it work to just make gdbserver return these in-memory-library >> elements, without even a qSupported flag? Would older GDBs just ignore >> them? > > GDB silently ignores unknown elements and unknown attributes. > > I will drop most of this patch and just send the new in-memory-library > response without opt-in and without fallback. Ack, glad to know it works. >> Ok, so "info shared" shows solib->name. For in-memory solibs, you don't >> set solib->name? Does this mean that no name is shown in "info shared" >> for these libraries? > > No, 'info shared' prints the name given by > > /* Constructor. BASE and SIZE define where the BFD can be found in > target memory. */ > target_buffer (CORE_ADDR base, ULONGEST size) > : m_base (base), > m_size (size), > m_filename (xstrprintf ("", > core_addr_to_string_nz (m_base), > core_addr_to_string_nz (m_base + m_size))) > > This is existing code. I'm no longer setting solib->name for in-memory libs. Ok, I am a bit confused, because I see that we pass a "name" at the constructor of struct solib, but then solib_map_sections does: so.name = bfd_get_filename (so.abfd.get ()); I guess these is how target_buffer::m_filename ends up as the solib name. >> As of today, even with this change, solib-rocm.c could set solib->name >> to whatever it wants. If we ever want to support remote debugging with >> ROCm, we would want to find a way to get our `memory://...` string as >> the name. >> >> Do you think that the remote side could provide a name inside an >> element? A ROCm would put that `memory://...` >> string. But in general, it would be a place to put a user-friendly name >> that will end up in "info shared". > > We'd need to route that through. I have not looked into it. I'm quite happy > with the name GDB chooses. It makes it easy to copy&paste to a 'dump > memory' command. For ROCm, I think we'd really want to keep that syntax, because it's used and understood by other tools in the ecosystem. As long as there is a backwards-compatible way to implement it in the future, I am happy. >>>>> + if (so.end <= so.begin) >>>>> + error (_("Bad address range [%s; %s) for in-memory shared library."), >>>>> + core_addr_to_string_nz (so.begin), >>>>> + core_addr_to_string_nz (so.end)); >>>> >>>> Sounds like we should never end up with an solib like this, I don't >>>> think we need to handle this case here. >>> >>> We're subtracting so.begin from so.end. If you don't like the error, we >>> should assert this. The only place that currently adds such solibs ignores >>> those with a warning, so asserting it should be fine. >> >> Yes I think an assert makes sense here (or in an eventual solib >> constructor that takes these two addresses). Filtering for bad solib >> data would always be done earlier than that. > > I'd leave the assert here. This is where we need that property asserted. Assert yes, not error(). Simon