Re: [PATCH 0/2][PR GDB/32956] gdb: fix GDB failing to find build-id debug files in linux mount namespaces

Tom Tromey
2025-05-30T19:50:50Z

>>>>> "Fabian" == Fabian Kilger <kilger@sec.in.tum.de> writes:

Fabian> GDB can no longer find build-id debug files in docker containers.
Fabian> The cause is the new algorithm to look for a build-id-based debug file
Fabian> (introduced by commit 22836ca88591ac7efacf06d5b6db191763fd8aba).
Fabian> It makes use of fileio_stat. As fileio_stat is not supported by
Fabian> gdb/nat/linux-namespace.c, all stat calls would be performed on the
Fabian> host and not inside the mount namespace. Furthermore, gdb/build-id.c
Fabian> calls target_fileio_stat with inferior none, thus stat will always be
Fabian> performed on the host mount namespace instead of the target's mount
Fabian> namespace.

Fabian> The patch is split into two parts: First, add support for fileio_stat
Fabian> querying the linux mount namespace and second, adjust gdb/build-id.c
Fabian> to call target_fileio_stat with current_inferior () instead of nullptr.

Fabian> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32956

Hi, I don't know anything at all about this area, but some keywords in
the thread triggered a memory of this patch:

https://inbox.sourceware.org/gdb-patches/20230321120126.1418012-1-benjamin@sipsolutions.net/

Can you say how it compares and whether your patch fixes that same
problem?

thanks,
Tom