[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250515155811.114392-2-iii@linux.ibm.com>
Date: Thu, 15 May 2025 17:52:11 +0200
From: Ilya Leoshkevich <iii@...ux.ibm.com>
To: Jan Kiszka <jan.kiszka@...mens.com>, Kieran Bingham <kbingham@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>
Subject: [PATCH 1/3] scripts/gdb/symbols: factor out get_vmlinux()
Move the code that determines the current vmlinux file into a separate
function. It will be useful later in order to analyze the kernel image
in physical memory during s390 early boot.
Signed-off-by: Ilya Leoshkevich <iii@...ux.ibm.com>
---
scripts/gdb/linux/symbols.py | 6 +-----
scripts/gdb/linux/utils.py | 9 +++++++++
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index b255177301e9..25c4627c60e5 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -178,11 +178,7 @@ lx-symbols command."""
saved_states.append({'breakpoint': bp, 'enabled': bp.enabled})
# drop all current symbols and reload vmlinux
- orig_vmlinux = 'vmlinux'
- for obj in gdb.objfiles():
- if (obj.filename.endswith('vmlinux') or
- obj.filename.endswith('vmlinux.debug')):
- orig_vmlinux = obj.filename
+ orig_vmlinux = utils.get_vmlinux()
gdb.execute("symbol-file", to_string=True)
kerneloffset = get_kerneloffset()
if kerneloffset is None:
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index 03ebdccf5f69..fc94ff6a6d72 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -251,3 +251,12 @@ def parse_vmcore(s):
else:
kerneloffset = int(match.group(1), 16)
return VmCore(kerneloffset=kerneloffset)
+
+
+def get_vmlinux():
+ vmlinux = 'vmlinux'
+ for obj in gdb.objfiles():
+ if (obj.filename.endswith('vmlinux') or
+ obj.filename.endswith('vmlinux.debug')):
+ vmlinux = obj.filename
+ return vmlinux
--
2.49.0
Powered by blists - more mailing lists