Ftrace, KASLR and gdb

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

 



Hi,

Ftrace is a jewel to dig into the kernel, be it for troubleshooting, perf tuning or just understanding. But when one needs to disassemble the running kernel (eg to move kprobes around in a function, in order to understand a given code path), KASLR makes it impossible for gdb to get useful symbol addresses, even with a debug image. That said, /proc/kallsyms always gives the accurate, present symbol addresses. But, to my knowledge, gdb isn't able to import /proc/kallsyms as a symbol table. To circumvent this, I've written a small userland tool, usling libbfd, that creates an ELF file out of /proc/kallsyms. Passing this ELF file to gdb instead of "vmlinux", and /proc/kcore as core, then allows for a perfect gdb session on the running kernel. Of course this ELF file is only valid until the next reboot, but that's okay as its creation is fast.

Now, my question: did I miss an alternative ?

In other words, is there some kind of "kallsyms plug-in" for gdb somewhere ?
Or, taking the problem from the other side, some kernel module exposing a "/proc/kallsyms.elf" or similar, for direct consumption by gdb ?
Or another method, that people routinely use for the same purpose ?

Thanks in advance,

-Alex




____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux