From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cFW5FwO8IGg+vh4AWB0awg (envelope-from ) for ; Sun, 11 May 2025 11:02:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 595B01E10E; Sun, 11 May 2025 11:02:27 -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 9F7231E092 for ; Sun, 11 May 2025 11:02:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 966FF385AC1E for ; Sun, 11 May 2025 15:02:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 966FF385AC1E Received: from mailout1.rbg.tum.de (mailout1.rbg.tum.de [IPv6:2a09:80c0::201]) by sourceware.org (Postfix) with ESMTPS id 908283857BBF for ; Sun, 11 May 2025 15:01:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 908283857BBF 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 908283857BBF 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=1746975712; cv=none; b=vF72VLcNrASKn5AaST3Ar6Hy81d4cDlMrMNYUGnM0z7YwCHCOwULRXJqphgjMykRIa0GZNivgYzMRR64lnPQMxR9Rvh/n32P/Zq7RKaSDb4cnZoGE75Iv5gECGNlK9Mc40UXb8Btrl25dInkBVFJ+P5ngCZwxQhvAfC9e9a4jtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1746975712; c=relaxed/simple; bh=QRfprGAqThXGf3E7zykX/A7lTasHO/oJ3GyBqOkkwUw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=cPkfir7sW11VM+6U50pdgjrgtf4aszkGOsw8J1hpKbZ0J3U68TEDqDdcrx2JHpLkyeLwabXRu8KiuVZvsEx0g/v0M7pySDnvt1CBM0nRT7/wu2YgKI8Aqvambb+RLXQnikHMLWtw68lNHsXracogz8crTPZev7Xp+7Ywkt4hufI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 908283857BBF Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [IPv6:2a09:80c0:254::14]) by mailout1.rbg.tum.de (Postfix) with ESMTPS id BBCEB61 for ; Sun, 11 May 2025 17:01:51 +0200 (CEST) Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id B6FCF10B; Sun, 11 May 2025 17:01:51 +0200 (CEST) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id E286B10A for ; Sun, 11 May 2025 17:01:47 +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 D949945 for ; Sun, 11 May 2025 17:01:47 +0200 (CEST) Received: from frederica.fritz.box (unknown [192.168.253.2]) by services.sec.in.tum.de (Postfix) with ESMTPSA id 9DB4F100B93CA; Sun, 11 May 2025 17:01:47 +0200 (CEST) From: Fabian Kilger To: gdb-patches@sourceware.org Cc: Fabian Kilger Subject: [PATCH 0/2][PR GDB/32956] gdb: fix GDB failing to find build-id debug files in linux mount namespaces Date: Sun, 11 May 2025 17:01:11 +0200 Message-ID: <20250511150113.3163767-1-kilger@sec.in.tum.de> X-Mailer: git-send-email 2.49.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 GDB can no longer find build-id debug files in docker containers. The cause is the new algorithm to look for a build-id-based debug file (introduced by commit 22836ca88591ac7efacf06d5b6db191763fd8aba). It makes use of fileio_stat. As fileio_stat is not supported by gdb/nat/linux-namespace.c, all stat calls would be performed on the host and not inside the mount namespace. Furthermore, gdb/build-id.c calls target_fileio_stat with inferior none, thus stat will always be performed on the host mount namespace instead of the target's mount namespace. The patch is split into two parts: First, add support for fileio_stat querying the linux mount namespace and second, adjust gdb/build-id.c to call target_fileio_stat with current_inferior () instead of nullptr. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32956 Fabian Kilger (2): gdb: implement linux namespace support for fileio_stat gdb: query inferior's filesystem for build-id debug files gdb/build-id.c | 6 ++-- gdb/linux-nat.c | 14 ++++++++ gdb/linux-nat.h | 3 ++ gdb/nat/linux-namespaces.c | 71 ++++++++++++++++++++++++++++++++++++++ gdb/nat/linux-namespaces.h | 6 ++++ 5 files changed, 98 insertions(+), 2 deletions(-) -- 2.49.0