Ответ 1
Мои флажки были неправильными. Отладка таблицы символов построена с помощью этого make файла:
obj-m += mmaptest.o
MY_CFLAGS += -g -DDEBUG
ccflags-y += ${MY_CFLAGS}
CC += ${MY_CFLAGS}
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
debug:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
EXTRA_CFLAGS="$(MY_CFLAGS)"
clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Теперь это можно проверить с помощью:
[email protected]:$ readelf -S mmaptest.ko | grep debug
[24] .debug_info PROGBITS 0000000000000000 00000d40
[25] .rela.debug_info RELA 0000000000000000 00018260
[26] .debug_abbrev PROGBITS 0000000000000000 0000d577
[27] .debug_loc PROGBITS 0000000000000000 0000dd54
[28] .rela.debug_loc RELA 0000000000000000 00029510
[29] .debug_aranges PROGBITS 0000000000000000 0000e5d5
[30] .rela.debug_arang RELA 0000000000000000 0002a3e0
[31] .debug_ranges PROGBITS 0000000000000000 0000e645
[32] .rela.debug_range RELA 0000000000000000 0002a458
[33] .debug_line PROGBITS 0000000000000000 0000e815
[34] .rela.debug_line RELA 0000000000000000 0002a878
[35] .debug_str PROGBITS 0000000000000000 0000f4cd
[38] .debug_frame PROGBITS 0000000000000000 00016e80
[39] .rela.debug_frame RELA 0000000000000000 0002a8c0
add symbol table from file "/home/peter/projects/svn/linux_kernel/mmaptest/mmaptest.ko"
at .text_addr = 0x0
(y or n) y
Reading symbols from /home/peter/projects/svn/linux_kernel/mmaptest/mmaptest.ko...done.
(gdb)