GDB Scripts commands(lx commands) not working

527 Views Asked by At

I have Beagle bone running Linux.On the Host system I am using cross gdb (arm gdb) to debug kernel and kernel modules.

In my kernel build directory,there is no symlink(vmlinux-gdb.py) pointing to /build_directory/scripts/gdb/vmlinux-gdb.py. But the vmlinux-gdb.py is present in build_directory/scripts/gdb/vmlinux-gdb.py.

So i have directly given path of vmlinux-gdb.py in /root/.gdbinit file as follows

add-auto-load-safe-path build_directory/scripts/gdb/

I am able connect to target using GDB over serial port and the KGDB breakpoint hits on target.But the GDB scripts commands are not recognised.

If i run "apropos lx" on gdb prompt on host, there is no output.

If i run "lx-symbols" on gdb prompt on host, the output is undefined symbol "lx-symbol".

The setup has following configuration :

  1. CONFIG_GDB_SCRIPTS=y set in /boot/config file on target hardware.

  2. Target kernel version : 5.10.120

  3. Host kernel version : 5.11.0

  4. Cross GDB version on host : 7.10

Any inputs on how this can be resolved.

1

There are 1 best solutions below

0
akumar On

Previously I was using default configuration for Beaglebone kernel downloaded from Beaglebone github. I removed the default configuration while building kernel. This generated the vmlinux-gdb.py symlink in Kernel build directory.

Also i have set the "add-auto-load-safe-path" command in /root/.config/gdb/gdbinit file. The path to set "add-auto-load-safe-path" is displayed when the "vmlinux" file is run with GDB. I suspect that path of gdbinit file varies from system-to-system. With these settings I am able to run lx commands.