Post Go back to editing

jtag gdb kernel debug

Category: Software
Product Number: sc598
Software Version: 3.0.0

I'm using v3.0.0 which now has a fitImage instead of a zImage in v2.11.1

I would like to debug the linux kernel.
Normally for a zImage kernel I would use gdb and jtag with the following command
file vmlinux and then load

But the kernel is now Image.gz inside a fitImage
I tried the same approach and it failed with

(gdb) file vmlinux
(gdb) load
Loading section .head.text, size 0x10000 lma 0xffff800008000000
Load failed

The memory address is wrong,
according to the fit-image.its I'm expecting to load it to 0x9a200000
and the size being loaded should be 0x59A9EC

how do I load a debug uncompressed kernel into memory  ?

Thanks Chris

  • Hi Chris,

    Fitimage file won't provide the debug symbols to debug the kernel,

    Did you build the vmlinx file?  You can build your vmlinux file with the below command

    KERNEL_IMAGETYPES_append = " fitImage vmlinux"

    in your linux-adi_%.bb file

    If you have the vmlinux file already, instead of debugging in the QSPI mode, Did you try the normal boot method of using tftp or sd boot with vmlinux?

    Thanks,

    Prasanth R

  • Yes vmlinux is built and has debug information

    I can load the fitimage into memory using tftp
    TFTP from server 192.168.1.228; our IP address is 192.168.1.232
    Filename 'fitImage'.
    Load address: 0x96000000

    But gdb "file vmlinux" still gives the same  error

    Cannot access memory at address 0xffff800008ad0040

  • Hi Chris,

    U-boot loads kernel to physical addresses. When Kernel starts initialization process its also sets MMU so its best to wait after kernel have initialized MMU and then set in gdb breakpoint for debugging kernel. 

    Have you tried to use kgdb or kgdb?
    Have you tried other debugging facilities provided by kernel itself like uprobe or ftrace?