开发者

GDB can not find line numbers

开发者 https://www.devze.com 2023-03-11 06:50 出处:网络
I am using GDB for debugging a Linux kernel module. After loading the module, i use add-symbol-file to add module symbols.

I am using GDB for debugging a Linux kernel module. After loading the module, i use add-symbol-file to add module symbols.

When i use list command in GDB to find a symbol in module, it will find it for example:

(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  *      N开发者_JAVA技巧OTE: 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.

I can even set a breakpoint for it. But after the first interrupt in execution when i use list it says:

 (gdb) list __do_restart
    No line number known for __do_restart

It simply lost symbols! Why? (I am sure about presence of debugging information in object file) Thanks


I do not really know what causes this problem but once I had same trouble using add-symbol-file but adding -readnow option solved it for me!

0

精彩评论

暂无评论...
验证码 换一张
取 消