[lldb-dev] Not able to find process plugin for core file
Bhushan Attarde via lldb-dev
lldb-dev at lists.llvm.org
Thu Mar 10 04:34:15 PST 2016
I am working on adding support for MIPS coredump file in LLDB.
I tried below command:
(lldb) target create "app_mips.elf" --core "core_mips"
error: Unable to find process plug-in for core file '/home/battarde/test/ core_mips'
Currently LLDB is not able to find a Process plugin for MIPS core file. I debugged this and found that while finding the process plugin, "ProcessElfCore::CanDebug" calls "ModuleList::GetSharedModule"
to create a Module for corefile. But Module constructor in Module.cpp has this:
// First extract all module specifications from the file using the local
// file path. If there are no specifications, then don't fill anything in
if (ObjectFile::GetModuleSpecifications(module_spec.GetFileSpec(), 0, 0, modules_specs) == 0)
The issue here is that the targets like MIPS depends on elf flags to determine the actual architecture but core file doesn't contain any arch information (header.e_flags is 0) so it can't decide the arch contained in core file.
As no specifications are found, Module constructor takes an early exit leaving its members uninitialized.
Going further, Module also fails to get the ObjectFile representation as it doesn't contain enough information (Module::m_file, Module::m_arch) required to get ObjectFile.
So, "ProcessElfCore::CanDebug" returns false and because of this LLDB gives error saying that it is unable to find process plug-in for core file.
I can make mipsVariantFromElfFlags() to return some default architecture (to ensure we always have valid arch when it can't be decided from elf flags) but this won't always work (core's default arch and executable_elf's arch may not "match" always).
What could be the proper fix to this issue?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev