Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2][PR GDB/32956] gdb: fix GDB failing to find build-id debug files in linux mount namespaces
@ 2025-05-11 15:01 Fabian Kilger
  2025-05-11 15:01 ` [PATCH 1/2][PR GDB/32956] gdb: implement linux namespace support for fileio_stat Fabian Kilger
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Fabian Kilger @ 2025-05-11 15:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Fabian Kilger

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-06-11 18:01 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-11 15:01 [PATCH 0/2][PR GDB/32956] gdb: fix GDB failing to find build-id debug files in linux mount namespaces Fabian Kilger
2025-05-11 15:01 ` [PATCH 1/2][PR GDB/32956] gdb: implement linux namespace support for fileio_stat Fabian Kilger
2025-05-23 18:14   ` Andrew Burgess
2025-05-24 20:25     ` Fabian Kilger
2025-06-11  9:43       ` Andrew Burgess
2025-05-24 10:46   ` Andrew Burgess
2025-05-24 19:43     ` Fabian Kilger
2025-05-24 20:43       ` Fabian Kilger
2025-06-11  9:47         ` Andrew Burgess
2025-06-11  9:58           ` Andrew Burgess
2025-06-11 13:29             ` Tom Tromey
2025-06-11 14:47               ` Andrew Burgess
2025-06-11 17:45                 ` Tom Tromey
2025-06-11 15:06             ` Fabian Kilger
2025-05-11 15:01 ` [PATCH 2/2][PR GDB/32956] gdb: query inferior's filesystem for build-id debug files Fabian Kilger
2025-05-23 18:20   ` Andrew Burgess
2025-05-24 19:54     ` Fabian Kilger
2025-06-10  9:10       ` Andrew Burgess
2025-06-11  8:11         ` Fabian Kilger
2025-06-11  9:35           ` Andrew Burgess
2025-06-11 14:00             ` Simon Marchi
2025-05-30 19:50 ` [PATCH 0/2][PR GDB/32956] gdb: fix GDB failing to find build-id debug files in linux mount namespaces Tom Tromey
2025-06-10 17:02   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox