gdb not loading kernel module symbols at the correct offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On the guest VM, I'm parsing kernel module's .text address with:

> # cat /sys/module/dm_crypt/sections/{.text,.data}
> 0xffffffffa04ee000
> 0xffffffffa04f3000
> root@ubuntu-zesty:~# cat /proc/kallsyms | grep dm_crypt_exit
> ffffffffa04f14d2 t dm_crypt_exit [dm_crypt]

When I load the module symbols at the .text address, it prompts me for
the correct address:

> (gdb) add-symbol-file drivers/md/dm-crypt.ko 0xffffffffa04ee000 -s .data 0xffffffffa04f3000
> add symbol table from file "drivers/md/dm-crypt.ko" at
> .text_addr = 0xffffffffa04ee000
> .data_addr = 0xffffffffa04f3000
> (y or n) y
> Reading symbols from drivers/md/dm-crypt.ko...done.

But when I query for the module's symbols, they're not loaded at the
appropriate offset, making it impossible to set breakpoints.

> (gdb) info address dm_crypt_exit
> Symbol "dm_crypt_exit" is a function at address 0x4e.
> (gdb) b dm_crypt_exit
> Cannot access memory at address 0x4e

Any ideas what's going wrong?

Thanks,
Kamran.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux