Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/gdb/symbols: factor out get_vmlinux()

Patch series "scripts/gdb/symbols: determine KASLR offset on s390 during
early boot".

I noticed that debugging s390 early boot using the support I introduced in
commit 28939c3e9925 ("scripts/gdb/symbols: determine KASLR offset on
s390") does not work.

The reason is that decompressor does not provide the vmcoreinfo note, so
KASLR offset needs to be extracted in a different way, which this series
implements. Patches 1-2 are trivial refactorings, and patch 3 is the
implementation.


This patch (of 3):

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.

Link: https://lkml.kernel.org/r/20250515155811.114392-1-iii@linux.ibm.com
Link: https://lkml.kernel.org/r/20250515155811.114392-2-iii@linux.ibm.com
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Ilya Leoshkevich and committed by
Andrew Morton
3545414f 85915c6c

+10 -5
+1 -5
scripts/gdb/linux/symbols.py
··· 178 178 saved_states.append({'breakpoint': bp, 'enabled': bp.enabled}) 179 179 180 180 # drop all current symbols and reload vmlinux 181 - orig_vmlinux = 'vmlinux' 182 - for obj in gdb.objfiles(): 183 - if (obj.filename.endswith('vmlinux') or 184 - obj.filename.endswith('vmlinux.debug')): 185 - orig_vmlinux = obj.filename 181 + orig_vmlinux = utils.get_vmlinux() 186 182 gdb.execute("symbol-file", to_string=True) 187 183 kerneloffset = get_kerneloffset() 188 184 if kerneloffset is None:
+9
scripts/gdb/linux/utils.py
··· 251 251 else: 252 252 kerneloffset = int(match.group(1), 16) 253 253 return VmCore(kerneloffset=kerneloffset) 254 + 255 + 256 + def get_vmlinux(): 257 + vmlinux = 'vmlinux' 258 + for obj in gdb.objfiles(): 259 + if (obj.filename.endswith('vmlinux') or 260 + obj.filename.endswith('vmlinux.debug')): 261 + vmlinux = obj.filename 262 + return vmlinux