forked from OSchip/llvm-project
Change ProcessElfCore::CreateInstance() to check if the ELF magic bytes
appear in the file before it assumes the file is ELF. It was incorrectly activating for Mach-O core files. <rdar://problem/16836816> llvm-svn: 208265
This commit is contained in:
parent
e60adfdbd0
commit
8cb27bb911
|
@ -63,7 +63,7 @@ ProcessElfCore::CreateInstance (Target &target, Listener &listener, const FileSp
|
|||
const size_t header_size = sizeof(llvm::ELF::Elf64_Ehdr);
|
||||
|
||||
lldb::DataBufferSP data_sp (crash_file->ReadFileContents(0, header_size));
|
||||
if (data_sp->GetByteSize() == header_size)
|
||||
if (data_sp->GetByteSize() == header_size && elf::ELFHeader::MagicBytesMatch (data_sp->GetBytes()))
|
||||
{
|
||||
elf::ELFHeader elf_header;
|
||||
DataExtractor data(data_sp, lldb::eByteOrderLittle, 4);
|
||||
|
|
Loading…
Reference in New Issue