2011-06-09 121 views
0

我正在使用GDB调试Linux内核模块。 加载模块后,我使用add-symbol-file添加模块符号。GDB找不到行号

当我用GDB list命令查找模块的象征,它会找到它,例如:

(gdb) list __do_restart 
122 *  would provide type of error or success. In the case of early restart support from 
123 *  cr_mods a signal will be posted at appropriate time. 
124 * 
125 *  NOTE: This type of restarting could be used for migrating parallel processes. 
126 */ 
127 int __do_restart(void *data){ 
128  struct siginfo info; 
129  struct object_stored_data *sd; 
130  struct crmod_clients *clt = get_client(data); 
131  memset(&info, 0, sizeof(struct siginfo)); 
(gdb) b __do_restart 
Breakpoint 1 at 0xe081740e: file /home/amrzar/Workspace/common/commod.c, line 130. 

我甚至可以设置断点它。但是,在执行第一中断后,当我使用list它说:

(gdb) list __do_restart 
    No line number known for __do_restart 

它只是失去了符号!为什么? (我可以肯定在目标文件的调试信息存在) 感谢

回答

3

我真的不知道是什么原因导致这个问题,但一旦我不得不使用add-symbol-file但加入-readnow选项同样的麻烦解决了这个问题对我来说!

+0

我已经这样做了,它也解决了我!谢谢。 – amrzar 2011-06-21 11:59:17