Add oat symbolization support for odex files

Differential revision: http://reviews.llvm.org/D22040

llvm-svn: 274635
This commit is contained in:
Tamas Berghammer 2016-07-06 16:40:09 +00:00
parent 65c00a2b3e
commit dba6503a9b
2 changed files with 8 additions and 6 deletions

View File

@ -2184,15 +2184,16 @@ ObjectFileELF::ParseSymbols (Symtab *symtab,
static ConstString bss_section_name(".bss");
static ConstString opd_section_name(".opd"); // For ppc64
// On Android the oatdata and the oatexec symbols in the oat files covers the full .text
// section what causes issues with displaying unusable symbol name to the user and very slow
// unwinding speed because the instruction emulation based unwind plans try to emulate all
// On Android the oatdata and the oatexec symbols in the oat and odex files covers the full
// .text section what causes issues with displaying unusable symbol name to the user and very
// slow unwinding speed because the instruction emulation based unwind plans try to emulate all
// instructions in these symbols. Don't add these symbols to the symbol list as they have no
// use for the debugger and they are causing a lot of trouble.
// Filtering can't be restricted to Android because this special object file don't contain the
// note section specifying the environment to Android but the custom extension and file name
// makes it highly unlikely that this will collide with anything else.
bool skip_oatdata_oatexec = m_file.GetFileNameExtension() == ConstString("oat");
ConstString file_extension = m_file.GetFileNameExtension();
bool skip_oatdata_oatexec = file_extension == ConstString("oat") || file_extension == ConstString("odex");
ArchSpec arch;
GetArchitecture(arch);

View File

@ -317,8 +317,9 @@ PlatformAndroid::DownloadSymbolFile (const lldb::ModuleSP& module_sp,
const FileSpec& dst_file_spec)
{
// For oat file we can try to fetch additional debug info from the device
if (module_sp->GetFileSpec().GetFileNameExtension() != ConstString("oat"))
return Error("Symbol file downloading only supported for oat files");
ConstString extension = module_sp->GetFileSpec().GetFileNameExtension();
if (extension != ConstString("oat") && extension != ConstString("odex"))
return Error("Symbol file downloading only supported for oat and odex files");
// If we have no information about the platform file we can't execute oatdump
if (!module_sp->GetPlatformFileSpec())