Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load symbols for kernel module to allow natural debugging by symbol names #137

Open
usiegj00 opened this issue Dec 27, 2022 · 1 comment

Comments

@usiegj00
Copy link

usiegj00 commented Dec 27, 2022

Currently, a debugging session starts with symbols unmapped to addresses. This limits ease of debugging and operations like b some_func are not available.

Typically, this is solved by finding the symbol offsets from an active kernel module and then loading a symbol file like:

# On debugee:
cat /sys/module/the_mod/sections/.text
cat /sys/module/the_mod/sections/.data
cat /sys/module/the_mod/sections/.bss
# On debuger:
add-symbol-file the_mod.ko 0xffffffff... -s .data 0xffffffff... -s .bss 0xffffffff...

Or alternatively using /proc/kallsyms.

A workaround could be made if #71 were available because a kernel module could be easily uploaded and the rest orchestrated.

@0xricksanchez
Copy link
Owner

It may be worth looking into something like this:
https://github.com/marin-m/vmlinux-to-elf/blob/master/vmlinux_to_elf/kallsyms_finder.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants