I am trying to write a Python plugin for lldb that will make a breakpoint based on a given module name and an offset from the start of that module. Currenlty I'm doing so manually, with commands like:
(lldb) image list my_module
[ 0] XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX 0x00000000deadbeef /path/to/my_module
(lldb) breakpoint set -a 0x00000000deadbeef + 0x1234
And I want to automate this. For that, I need to get the load address of my_module
. Something similar to using lldb's image list
command and reading the resulting address.
I found the method SBModule.ResolveFileAddress()
, which does the reverse conversion - It takes the absolute address and converts it into a relative-to-module one.
Is there a function that takes an SBModule
object, or a module name, and returns the load of that module?