Beesdeckar writes: > Hello, > I build kernel module with these line in Makefile: > CFLAGS:=$(CFLAGS) -DDEBUG -DMKDEBUG=yes -DMKCTF=yes -Wno-multichar -O0 -g > > and when I loaded crash dump into gdb and use > add-symbol-file path_to_module.kmod <address of .text> > > then after bt I see function names but not line numbers. > I tried to switch off CTF with -DMKCTF=no, add -gdwarf-4 and another > variants, still I have no line numbers and I dont see section named .debug. > when I use compiler switch -v still I am seeing that ctfconvert is > called on every compiled object file. > > How to change Makefile to see line numbers in gdb ?
with MKDEBUG=yes, your kernel module has it's debug info moved into a separate file -- in a ".debug" file, and there should be a link in the original for where it is expected to me installed. put it there, and i bet gdb works.. eg, random example on my host: -r--r--r-- 1 root wheel 24072 Nov 12 00:17 /stand/amd64/11.99.3/modules/scmd/scmd.kmod -r--r--r-- 1 root wheel 81496 Nov 12 00:17 /usr/libdata/debug/stand/amd64/11.99.3/modules/scmd/scmd.kmod.debug try that. .mrg.
