1
votes

I am building a custom linux kernel (4.15.0 x86_64) with debug symbol enabled. I find that addr2line fails to point to the source code line.

addr2line -e vmlinux 0xffffffff9be625f0

gdb also returns "No line number information available for address" with following command

$ gdb ../linux/vmlinux /proc/kcore

... Reading symbols from ../linux/vmlinux...done.

$ info line *0xffffffff9be625f0

What should be done to get the line number from address? Here is the .config file.

1
Are you sure that the address is inside vmlinux image? What if it is from some kernel module? (plus.google.com/+TheodoreTso/posts/h8H9z4EopkS stackoverflow.com/questions/6151538/addr2line-on-kernel-module/…)osgx
@osgx, It's an address of a kernel symbol, not from kernel module. Got it from /proc/kallsym.Proy

1 Answers

2
votes

First - try to find out which procedure this address belongs to from /proc/kallsyms. Then compute the offset of this address from the beginning of this proc. Then:

objdump -D -S -l ./vmlinux | less

find your procedure name and then move to your offset. Of course your kernel vmlinux should be compiled with debugging symbols.