gdb: linux: make SB_* constants gdb-parsed

Message ID 20230613211159.b1faefb1a1bd.Ie873f66db5555c014c4afc15678e4fd5cfeca226@changeid
State New
Headers
Series gdb: linux: make SB_* constants gdb-parsed |

Commit Message

Johannes Berg June 13, 2023, 7:11 p.m. UTC
  From: Johannes Berg <johannes.berg@intel.com>

These now contain "UL" suffixes due to the use of BIT(),
so they need to be parsed by gdb since python doesn't
understand that.

Also fix a comment typo while at it.

ticket=none

Fixes: f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 scripts/gdb/linux/constants.py.in | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
  

Comments

Kieran Bingham June 14, 2023, 8:48 a.m. UTC | #1
Hi Johannes,

Quoting Johannes Berg (2023-06-13 20:11:59)
> From: Johannes Berg <johannes.berg@intel.com>
> 
> These now contain "UL" suffixes due to the use of BIT(),
> so they need to be parsed by gdb since python doesn't
> understand that.
> 
Thank you for the patch, however there is an existing patch [0] submitted
and on it's way upstream [1] to resolve this.

[0] https://lore.kernel.org/all/20230607221337.2781730-1-florian.fainelli@broadcom.com/
[1] https://lore.kernel.org/all/20230609004453.2AAEEC433EF@smtp.kernel.org/

> Also fix a comment typo while at it.
> 

This typo wasn't fixed though. Perhaps that's worth a separate patch if
you wish ...

--
Regards

Kieran

> ticket=none
> 
> Fixes: f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  scripts/gdb/linux/constants.py.in | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in
> index 471300ba176c..646fffddd862 100644
> --- a/scripts/gdb/linux/constants.py.in
> +++ b/scripts/gdb/linux/constants.py.in
> @@ -48,14 +48,14 @@ 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 */
> +/* linux/hrtimer.h */
>  LX_GDBPARSED(hrtimer_resolution)
>  
>  /* linux/irq.h */
> -- 
> 2.40.1
>
  

Patch

diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in
index 471300ba176c..646fffddd862 100644
--- a/scripts/gdb/linux/constants.py.in
+++ b/scripts/gdb/linux/constants.py.in
@@ -48,14 +48,14 @@  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 */
+/* linux/hrtimer.h */
 LX_GDBPARSED(hrtimer_resolution)
 
 /* linux/irq.h */