Load tombstones and coredumps plugins together in LLDB

I did override “get_loaded-images” but the reason it did not work is because get_loaded_images in scriptedprocess.cpp expects all modules to be loaded. Even if one module is not found by target.getorcreatemodule, it loads no module. I have changed the logic locally to bypass that and it loads fine now.

Coming back to my original problem, loading the elf-core modules and adding new modules from tombstones, loads the elf-core modules and unwinds stack correctly for elf-core
module but lldb does not load the newly added module. It is possible that the load address is not correct(PT_LOAD - offset from NT_FILE entry), or dynamic loader does not know how to read the .so file within apk . Alternatively, I did a hack to update the nt file entry in elf-core plugin locally to update the build-id, and lldb still does not load the module correctly. Does elf-core not load shared libraries with .apk correctly based on PT_LOAD entries in NT_FILE ? Do we need to add android specific logic similar to mini dump for dynamic loader to read modules within .apk ?

Ok, I was finally able to combine the two files, change thread names and module names from tombstones. Scripted process plugin is pretty cool, thanks everyone for your inputs :slight_smile: Definitely more extensible than having python callbacks.

The only thing that I had to change in lldb is to make loading an image in scripted process not be very restrictive, it only loads if all the modules are found. I was thinking to add an extra param passed via the dictionary to bypass and can submit a change for it.

Since I have some understanding with scripted plugins now, I can make the scripted symbol locator plugin for fetching source files as mentioned in RFC