我正在使用 GDB 来调试 Linux 内核模块。加载模块后,我使用add-symbol-file
添加模块符号。
当我list
在 GDB 中使用命令在模块中查找符号时,它会找到它,例如:
(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
它只是丢失了符号!为什么?(我确信目标文件中存在调试信息)谢谢