- 論壇徽章:
- 0
|
我的driver makefile 如下:
DEBUG=y
CC = gcc
# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
DEBFLAGS = -O -g # "-O" is needed to expand inlines
else
DEBFLAGS = -O2
endif
ccflags-y += $(DEBFLAGS)
ccflags-y += -I$(LDDINC)
ifneq ($(KERNELRELEASE),)
# call from kernel build system
df-objs := mod.o chr_dev.o
obj-m := df.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
endif
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
depend .depend dep:
$(CC) $(CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif
看上去應(yīng)該是加了-g -O
將df.ko上傳到server, 并且insmod,獲得.text地址
在客戶機(jī)上開gdb, add-symbol-file /usr/src/kernels/test/my_driver/df.ko 0xffffffffa006f000 一切正常。
設(shè)置斷點(diǎn)。
當(dāng)kgdb運(yùn)行到斷點(diǎn)后,bt顯示正確,但按n后顯示Single stepping until exit from function df_ctldev__ioctl,
which has no line number information.
請(qǐng)問是哪里設(shè)置的問題?
謝謝 |
|