Closed unvariant closed 2 weeks ago
Is this a different feature from kmod -a
?
Is it new that you can load not only debug symbols but also type information? If so, that sounds like a good feature because it eliminates the need to check the address where the module is loaded. If it is a new feature, I'll add it.
kmod -a
grabs symbol addresses but can't apply type information, using add-symbol-file
is able to load type info if it is present in the module.
However some issues I have found while investigating this a bit more is that gdb does not properly resolve the addresses of global variables that are declared static, the type debuginfo exists but those variables are not marked as external in the dwarf which makes gdb ignore them for some reason. It would be possible to rewrite the dwarf data in a temp file before running add-symbol-file
on it.
I have implemented the command you suggested while still supporting older kernel versions. Can I close this for now?
sure
I want to try to write something to fix up the dwarf data, but I might not get around to that for a while.
The
sect_attrs
field of a module can be used to find the base addresses of all of a module's loaded sections, then the module can be fully loaded into memory while preserving debuginfo withadd-symbol-file
.