[PATCH 1/3] scripts/get_gdb_base_port: strip leading zeros for the Kconfig int type

Daniel Gomez <[email protected]> Tue, 26 May 2026 14:16:47 +0200
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

libvirt/Kconfig has LIBVIRT_GDB_BASEPORT as a Kconfig `int` whose
default comes from this script. The script extracts the last 4
digits of the script's own md5sum, which can begin with a zero
(today the script emits "0016"). Kconfig's int parser rejects
that with:

  libvirt/Kconfig:1177:warning: 'LIBVIRT_GDB_BASEPORT': number is invalid

Run the value through arithmetic expansion with the 10#-base
prefix to force base-10 interpretation and emit it without
leading zeros.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 scripts/get_gdb_base_port.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/get_gdb_base_port.sh b/scripts/get_gdb_base_port.sh
index bdd80044..91048617 100755
--- a/scripts/get_gdb_base_port.sh
+++ b/scripts/get_gdb_base_port.sh
@@ -11,4 +11,5 @@ digits_only=$(echo $base_md5sum | tr -cd '0-9')
 # extract the last 4 digits from md5sum
 
 base_port=${digits_only: -4}
-echo $base_port
+# Strip leading zeros so the Kconfig `int` type accepts the value.
+echo $((10#$base_port))

-- 
2.53.0