Issue
I am trying to debug an aarch64 Linux kernel loaded in QEMU from x86 host. When 'lx-symbols' command executed for loading the symbols from gdb, it has shown
Undefined command: "lx-symbols"
The I have tried executing 'add-auto-load-safe-path' command as shown below
gdb-multiarch /mykernelbuild/linux/arch/arm64/boot/Image
gdb) target remote localhost:9000
Remote debugging using localhost:9000
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
add-auto-load-safe-path /mykernelbuild/linux/scripts/gdb
Still 'lx-symbols' is returning error. I have tried adding this to '~/.gdbint' and restarting 'gdb-multiarch' as well. I have tried adding the filename also to the path
add-auto-load-safe-path /mykernelbuild/linux/scripts/gdb/vmlinux-gdb.py
still no success, any hint is greatly appreciated...
Solution
gdb-multiarch /mykernelbuild/linux/arch/arm64/boot/Image
You are debugging Image
, and not vmlinux
. So GDB will attempt to auto-load Image-gdb.py
(which is nowhere to be found).
I have no idea what boot/Image
is, but you probably want to be debugging boot/vmlinux
instead.
Update:
add-auto-load-safe-path /mykernelbuild/linux/scripts/gdb
Now GDB is complaining about the /mykernelbuild/linux/scripts/gdb
not being in the auto-load-safe-path
(which it wouldn't be since you haven't added it yet).
You want something like:
gdb-multiarch -ex 'add-auto-load-safe-path /mykernelbuild/linux/scripts/gdb' \
/mykernel/linux/vmlinux
Answered By - Employed Russian Answer Checked By - Candace Johnson (WPSolving Volunteer)