From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id POklKiMkMmj0WDIAWB0awg (envelope-from ) for ; Sat, 24 May 2025 15:55:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 94B5B1E11C; Sat, 24 May 2025 15:55:15 -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 C2DA61E102 for ; Sat, 24 May 2025 15:55:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 459F6385C6EC for ; Sat, 24 May 2025 19:55:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 459F6385C6EC Received: from mailout1.rbg.tum.de (mailout1.rbg.tum.de [IPv6:2a09:80c0::201]) by sourceware.org (Postfix) with ESMTPS id 30E173858D26 for ; Sat, 24 May 2025 19:54:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30E173858D26 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sec.in.tum.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sec.in.tum.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30E173858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a09:80c0::201 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1748116480; cv=none; b=KFTs8H0rD44GOUzYgYCA3g9F3J2ya7G5yqNnfb120cg2RjYExGZ9lLJV2M411AkNgVjPr2rUy5h1Nu8Wg+V1x0xQhZhg6y1VlSs5cP2DAE5SKL/wtruhVw70LSQ0ZAkeJcHaJjBP0zE3BqIfhS1QXZprEE36DeiTIuBHH/On60A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1748116480; c=relaxed/simple; bh=NLQm5tXjF2bTalTmoPp9wv4vBlaEKmDmfmPKqyNEQ/g=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=r9E/kv42cqChlYn9EEftd3W3AvldkL4oauCgofrdYXwu9HCDYON/g7C4Wv3usssHPyPNOKLVadGUsjNJQfxOBeQw4rlRPnoKX20KjN6nQteJkDBg7zTaXhYRrMP6JAghufT/s6H57WSg0YZOJ+YdHi2smBnCajXHirQpjhgMebU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30E173858D26 Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [131.159.254.14]) by mailout1.rbg.tum.de (Postfix) with ESMTPS id 139385A; Sat, 24 May 2025 21:54:39 +0200 (CEST) Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id B681A10B; Sat, 24 May 2025 21:54:34 +0200 (CEST) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 0ECD210A; Sat, 24 May 2025 21:54:30 +0200 (CEST) Received: from services.sec.in.tum.de (services.sec.in.tum.de [131.159.50.242]) by mailrelay1.rbg.tum.de (Postfix) with ESMTPS id 0B895104; Sat, 24 May 2025 21:54:30 +0200 (CEST) Received: from [192.168.178.35] (ipbcc3e067.dynamic.kabel-deutschland.de [188.195.224.103]) by services.sec.in.tum.de (Postfix) with ESMTPSA id D5508100CE80E; Sat, 24 May 2025 21:54:29 +0200 (CEST) Message-ID: <7cdc3a53-8d09-445f-a017-29084769fb76@sec.in.tum.de> Date: Sat, 24 May 2025 21:54:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2][PR GDB/32956] gdb: query inferior's filesystem for build-id debug files To: Andrew Burgess , gdb-patches@sourceware.org References: <20250511150113.3163767-1-kilger@sec.in.tum.de> <20250511150113.3163767-3-kilger@sec.in.tum.de> <877c27i3zb.fsf@redhat.com> Content-Language: en-US From: Fabian Kilger Autocrypt: addr=kilger@sec.in.tum.de; keydata= xjMEYHltfxYJKwYBBAHaRw8BAQdA7mzpLUfZIcIiMjdx+GBa8RuqZdMp/MUEpu4PDTb2YwXN JEZhYmlhbiBLaWxnZXIgPGtpbGdlckBzZWMuaW4udHVtLmRlPsKLBBMWCAAzFiEETPRi+vRL aNymGJvYr2lqRpshfmkFAmB5bX8CGwMFCwkIBwIGFQgJCgsCBRYCAwEAAAoJEK9pakabIX5p CzcA/ivCFRRbxJfpiwOzV5CvflcHPNN2LmCxSBlcrBpliBhWAP43PcAtWheftijoLpcwy3nD 0TVTDRrJY/hRkKDbvmrWCM44BGB5bX8SCisGAQQBl1UBBQEBB0BtYlZed2qkwQWmV+MaUhC7 8XgZI0ezLuU2nr8bocqXCAMBCAfCeAQYFggAIBYhBEz0Yvr0S2jcphib2K9pakabIX5pBQJg eW1/AhsMAAoJEK9pakabIX5pUNQA/juajzwCYdtbo+sXQUlZufPiPwLiPr6LuJBNZwL6Olbm AQDvyu6h+X9K2gzgLviiNEmcCAddwynvjXiLt3c+oir7AA== In-Reply-To: <877c27i3zb.fsf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------eljycr27pF00Ueh65tySwlK0" 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 is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------eljycr27pF00Ueh65tySwlK0 Content-Type: multipart/mixed; boundary="------------tfVMRmkUFQYdEmTS40eM9O28"; protected-headers="v1" From: Fabian Kilger To: Andrew Burgess , gdb-patches@sourceware.org Message-ID: <7cdc3a53-8d09-445f-a017-29084769fb76@sec.in.tum.de> Subject: Re: [PATCH 2/2][PR GDB/32956] gdb: query inferior's filesystem for build-id debug files References: <20250511150113.3163767-1-kilger@sec.in.tum.de> <20250511150113.3163767-3-kilger@sec.in.tum.de> <877c27i3zb.fsf@redhat.com> In-Reply-To: <877c27i3zb.fsf@redhat.com> --------------tfVMRmkUFQYdEmTS40eM9O28 Content-Type: multipart/mixed; boundary="------------NjkaraZ82aPvDACuL0x5IVHR" --------------NjkaraZ82aPvDACuL0x5IVHR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for approving, I'll add the link to the commit message. If I merge this ahead of #1, can I leave it out in the v2 patch submission, or should it be included for completeness' sake - not sure what is desired. Best, Fabian On 5/23/25 20:20, Andrew Burgess wrote: > Fabian Kilger writes: >=20 >> This fixes a bug related to build-id files with linux namespaces. >> Specifically, we expect the debug files to be present inside the conta= iner, >> thus the container filesystem should be queried if the program is runn= ing >> inside one. >=20 > You should add a bug link to the end of this commit message, like: >=20 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D32956 >=20 > With that added, for this patch: >=20 > Approved-By: Andrew Burgess >=20 > You are welcome to merge this ahead of patch #1 if you want, as they ar= e > related, but don't depend on each other. >=20 > Thanks, > Andrew >=20 >=20 >=20 >> >> --- >> gdb/build-id.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/build-id.c b/gdb/build-id.c >> index 43a80dd3978..abbd65a7c12 100644 >> --- a/gdb/build-id.c >> +++ b/gdb/build-id.c >> @@ -29,6 +29,7 @@ >> #include "gdbsupport/scoped_fd.h" >> #include "debuginfod-support.h" >> #include "extension.h" >> +#include "inferior.h" >> =20 >> /* See build-id.h. */ >> =20 >> @@ -128,7 +129,8 @@ build_id_to_debug_bfd_1 (const std::string &origin= al_link, >> if (supports_target_stat !=3D TRIBOOL_FALSE) >> { >> struct stat sb; >> - int res =3D target_fileio_stat (nullptr, link_on_target, &sb, >> + int res =3D target_fileio_stat (current_inferior (), >> + link_on_target, &sb, >> &target_errno); >> =20 >> if (res !=3D 0 && target_errno !=3D FILEIO_ENOSYS) >> @@ -157,7 +159,7 @@ build_id_to_debug_bfd_1 (const std::string &origin= al_link, >> the path doesn't exist, but we just assume that anything >> other than EINVAL indicates the path doesn't exist. */ >> std::optional link_target >> - =3D target_fileio_readlink (nullptr, link_on_target, >> + =3D target_fileio_readlink (current_inferior (), link_on_target, >> &target_errno); >> if (link_target.has_value () >> || target_errno =3D=3D FILEIO_EINVAL) >> --=20 >> 2.49.0 >=20 --=20 Fabian Kilger, M.Sc. Wissenschaftlicher Mitarbeiter Technische Universit=C3=A4t M=C3=BCnchen TUM School of Computation, Information and Technology Chair of IT Security Boltzmannstra=C3=9Fe 3 85748 Garching (bei M=C3=BCnchen) Tel. +49 (0)89 289-18587 Fax +49 (0)89 289-18579 kilger@sec.in.tum.de www.sec.in.tum.de --------------NjkaraZ82aPvDACuL0x5IVHR Content-Type: application/pgp-keys; name="OpenPGP_0xAF696A469B217E69.asc" Content-Disposition: attachment; filename="OpenPGP_0xAF696A469B217E69.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEYHltfxYJKwYBBAHaRw8BAQdA7mzpLUfZIcIiMjdx+GBa8RuqZdMp/MUEpu4P DTb2YwXNJEZhYmlhbiBLaWxnZXIgPGtpbGdlckBzZWMuaW4udHVtLmRlPsKLBBMW CAAzFiEETPRi+vRLaNymGJvYr2lqRpshfmkFAmB5bX8CGwMFCwkIBwIGFQgJCgsC BRYCAwEAAAoJEK9pakabIX5pCzcA/ivCFRRbxJfpiwOzV5CvflcHPNN2LmCxSBlc rBpliBhWAP43PcAtWheftijoLpcwy3nD0TVTDRrJY/hRkKDbvmrWCM44BGB5bX8S CisGAQQBl1UBBQEBB0BtYlZed2qkwQWmV+MaUhC78XgZI0ezLuU2nr8bocqXCAMB CAfCeAQYFggAIBYhBEz0Yvr0S2jcphib2K9pakabIX5pBQJgeW1/AhsMAAoJEK9p akabIX5pUNQA/juajzwCYdtbo+sXQUlZufPiPwLiPr6LuJBNZwL6OlbmAQDvyu6h +X9K2gzgLviiNEmcCAddwynvjXiLt3c+oir7AA=3D=3D =3DVdeZ -----END PGP PUBLIC KEY BLOCK----- --------------NjkaraZ82aPvDACuL0x5IVHR-- --------------tfVMRmkUFQYdEmTS40eM9O28-- --------------eljycr27pF00Ueh65tySwlK0 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQRM9GL69Eto3KYYm9ivaWpGmyF+aQUCaDIj9QUDAAAAAAAKCRCvaWpGmyF+abi/ AQDZFv9gUn5b3hI8SLTUTICke4wOTHZOqOuQr+Xy/ugBngD+NIwUpVBVuEWW4KHEzMaiHqYwA+RV kBGvWxBXl5HKrQw= =YvLX -----END PGP SIGNATURE----- --------------eljycr27pF00Ueh65tySwlK0--