Skip to contentSkip to conversation

scripts/gdb: Fix importing SB_ constants

PATCH In review Brendan Jackman 1 participant 2 messages Jun 27, 2023 GDB kernel debugging helper scripts

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/gdb: Fix importing SB_ constants

Commit f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER") switched these defines over to use BIT which when, !__ASSEMBLY__, expands to something equivalent to 1UL << x. The UL suffix isn't valid python.

Luckily we already seem to have a facility in the preprocessed code to handle cases like this.

---
 scripts/gdb/linux/constants.py.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/gdb/linux/constants.py.in +6 -6
index 471300ba176c..50a92c4e9984 100644
@@ -48,12 +48,12 @@ if IS_BUILTIN(CONFIG_COMMON_CLK):
     LX_GDBPARSED(CLK_GET_RATE_NOCACHE)
 
 /* linux/fs.h */
-LX_VALUE(SB_RDONLY)
-LX_VALUE(SB_SYNCHRONOUS)
-LX_VALUE(SB_MANDLOCK)
-LX_VALUE(SB_DIRSYNC)
-LX_VALUE(SB_NOATIME)
-LX_VALUE(SB_NODIRATIME)
+LX_GDBPARSED(SB_RDONLY)
+LX_GDBPARSED(SB_SYNCHRONOUS)
+LX_GDBPARSED(SB_MANDLOCK)
+LX_GDBPARSED(SB_DIRSYNC)
+LX_GDBPARSED(SB_NOATIME)
+LX_GDBPARSED(SB_NODIRATIME)
 
 /* linux/htimer.h */
 LX_GDBPARSED(hrtimer_resolution)
Signature · 1 line
2.41.0.162.gfafddb0af9-goog
#1 lore raw
Quoted 8 lines · Brendan Jackman

Commit f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER") switched these defines over to use BIT which when, !__ASSEMBLY__, expands to something equivalent to 1UL << x. The UL suffix isn't valid python.

Luckily we already seem to have a facility in the preprocessed code to handle cases like this.

Oh. After sending I realised my tree was stale! This was already fixed by Florian in 6a59cb5158bff1.

Please ignore :)