GDB cannot find line numbers

I use GDB to debug a Linux kernel module. After loading the module, I use add-symbol-file to add module symbols.

When I use the list command in GDB to search for a character in a 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 * 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. 

I can even set a breakpoint for it. But after the first interruption of execution, when I use list , it says:

  (gdb) list __do_restart No line number known for __do_restart 

He just lost the characters! What for? (I'm sure there is debugging information in the object file) Thanks

0
source share
1 answer

I really don't know what causes this problem, but as soon as I had problems using add-symbol-file , but adding the -readnow option resolved this for me!

+3
source

Source: https://habr.com/ru/post/1392467/


All Articles