我想使用 kgdb 调试用户模块。编码 :
#include<linux/init.h>
#include<linux/module.h>
#include<linux/kernel.h>
int r_day,rday1=10;
static int hello_init(void)
{
printk(KERN_ALERT "Hello World");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye World");
}
module_init(hello_init);
module_exit(hello_exit);
生成文件:
_CFLAGS=-g
obj-m := hello-kernel.o
hello-kernel-objs := hello.o
我用正确的调试符号(CONFIG_DEBUG_INFO=y)编译了我的内核。但是,当我检查模块中的部分时,所有段的地址仍然为 0x0000000000000000。请帮忙。