From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Fabian Kilger <kilger@sec.in.tum.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2][PR GDB/32956] gdb: implement linux namespace support for fileio_stat
Date: Wed, 11 Jun 2025 15:47:30 +0100 [thread overview]
Message-ID: <87tt4mgwsd.fsf@redhat.com> (raw)
In-Reply-To: <875xh2o18y.fsf@tromey.com>
Tom Tromey <tom@tromey.com> writes:
>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> OK, so I dug into the history, and it would appear that (a) it was just
> Andrew> a mistake, and (b) it was all my fault :-/
>
> A classic programming story, I can't tell you how many times I've been
> there.
>
> Andrew> Most of this can easily be fixed, but the remote protocol part we're
> Andrew> unfortunately stuck with. Though I wonder if we can "fix" this by just
> Andrew> have a 'stat' and 'lstat' remote protocol packet, change 'stat' to do an
> Andrew> actual 'stat', then on the GDB side we'll change the internal target API
> Andrew> to be called 'lstat'. This would effectively orphan the remote 'stat'
> Andrew> packet, as nobody would use it, but that's OK I think, and only minimal
> Andrew> overhead. I'll take a look at rolling something like this together.
>
> Wouldn't this negatively affect any existing remotes that implement stat-as-lstat?
> (I don't know if any of these actually exist.)
Yes, you are correct. But:
- The vFile:stat documentation is pretty vague, it just says: get
information about a file. So if there are other remotes that
implement this then they probably implemented 'stat' anyway as that
would be the logical first choice.
I would propose, as part of this change, to better document what is
expected from 'stat' and 'lstat'.
It could (maybe) be argued that the current 'lstat' implementation
was a bug, and it should have been 'stat'.
- The vFile:stat packet was only added in GDB 16, and there's only the
one use of it from GDB. In most cases implementing vFile:stat as an
actual 'stat' will go unnoticed, though the GDB testsuite does rely
on it being an actual 'lstat', so if someone is testing a custom
remote against the GDB testsuite they might have figured out that
they needed lstat instead of stat.
My hope would be that adding a new vFile:lstat packet, and noting in
the NEWS file that the vFile:stat should _really_ be 'stat' would
allow any other remotes to course correct.
If you feel strongly though then we can for sure just leave the
vFile:stat packet implemented as 'lstat' and document it as such.
Thanks,
Andrew
>
> It might be better to just document it.
>
> Tom
next prev parent reply other threads:[~2025-06-11 14:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tt4mgwsd.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=kilger@sec.in.tum.de \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox