The diffs are committed. Users now can use SBPlatform
SetLocateModuleCallback
to set ‘locate module callback’ (renamed from ‘get module callback’).
def locate_module(
module_spec: lldb.SBModuleSpec,
module_file_spec: lldb.SBFileSpec,
symbol_file_spec: lldb.SBFileSpec,
) -> lldb.SBError:
name = module_spec.GetFileSpec().GetFilename()
uuid = bytes(
ctypes.pointer(
(ctypes.c_char * module_spec.GetUUIDLength()).from_address(
int(module_spec.GetUUIDBytes())
)
).contents
).hex()
# Implement module locating logic with module_spec arg.
# e.g. find module file and symbol file from cache with UUID.
if module_dir and module_file:
module_file_spec.SetDirectory(module_dir)
module_file_spec.SetFilename(module_file)
if symbol_dir and symbol_file:
symbol_file_spec.SetDirectory(symbol_dir)
symbol_file_spec.SetFilename(symbol_file)
return lldb.SBError()
platform.SetLocateModuleCallback(locate_module)