Linux debuggers
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Stephen Brennan <stephen.s.brennan@oracle.com>,
	Tony Ambardar <tony.ambardar@gmail.com>,
	linux-kernel@vger.kernel.org, linux-debuggers@vger.kernel.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Kieran Bingham <kbingham@kernel.org>,
	Christian Brauner <brauner@kernel.org>
Subject: Re: [PATCH v1] scripts/gdb: fix parsing of MNT_* constants
Date: Thu, 19 Jun 2025 14:51:16 -0700	[thread overview]
Message-ID: <7ab95eac-47c0-437b-aa45-5b2871c31a8d@broadcom.com> (raw)
In-Reply-To: <6388ccbc-3189-46ad-a146-b6b732417a09@broadcom.com>

On 6/3/25 09:17, Florian Fainelli wrote:
> On 6/2/25 21:42, Stephen Brennan wrote:
>> On 5/31/25 22:50, Tony Ambardar wrote:
>>> Recently, constants in linux/mount.h were changed from integer macros
>>> parsable by LX_VALUE() to enums which are not, thus breaking gdb python
>>> scripts:
>>>
>>>    Reading symbols from vmlinux...
>>>    Traceback (most recent call last):
>>>      File ".../linux/vmlinux-gdb.py", line 25, in <module>
>>>        import linux.constants
>>>      File ".../linux/scripts/gdb/linux/constants.py", line 19, in 
>>> <module>
>>>        LX_MNT_NOSUID = MNT_NOSUID
>>>    NameError: name 'MNT_NOSUID' is not defined
>>>
>>> Update to parse with LX_GDBPARSED(), which correctly handles enums.
>>>
>>> Fixes: 101f2bbab541 ("fs: convert mount flags to enum")
>>> Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
>>
>> Hi Tony,
>>
>> I was totally unaware that these constants were being consumed by
>> another debugger, and having fixed them for one, I broke them for 
>> another!
>>
>> Thanks for the fix. Having read through the preprocessor magic and this
>> change, they make sense to me. In the future, I'll be sure to make an
>> extra check for GDB users when updating enums.
>>
>> Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> 
> Not targeted to anyone in particular but this is a recurring problem, 
> the GDB scripts are typically not part of any CI and it is not natural 
> to grep for constant names outside of the C/Rust code where they are 
> being used...
> 
> I suppose that QEMU it should be much easier to ensure that GDB scripts 
> are being exercised than with my current set-up using OpenOCD + real 
> hardware...

And also:

Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>

Jan, Kieran, can you please pick this up? Thanks!
-- 
Florian

  reply	other threads:[~2025-06-19 21:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-01  5:50 [PATCH v1] scripts/gdb: fix parsing of MNT_* constants Tony Ambardar
2025-06-03  4:42 ` Stephen Brennan
2025-06-03 16:17   ` Florian Fainelli
2025-06-19 21:51     ` Florian Fainelli [this message]
2025-06-20  5:50       ` Jan Kiszka

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=7ab95eac-47c0-437b-aa45-5b2871c31a8d@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=brauner@kernel.org \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-debuggers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephen.s.brennan@oracle.com \
    --cc=tony.ambardar@gmail.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