diff options
| author | Jason Molenda <jmolenda@apple.com> | 2014-05-07 23:14:04 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2014-05-07 23:14:04 +0000 |
| commit | 8cb27bb911b69a3c00247968a0d9c40bd05a7ea3 (patch) | |
| tree | 6b4a8fda424344d81e884409762d6f086ac0395b /lldb/source/Plugins/Process | |
| parent | e60adfdbd0d8ee91d6b48d29381d68acf192b385 (diff) | |
| download | bcm5719-llvm-8cb27bb911b69a3c00247968a0d9c40bd05a7ea3.tar.gz bcm5719-llvm-8cb27bb911b69a3c00247968a0d9c40bd05a7ea3.zip | |
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
Diffstat (limited to 'lldb/source/Plugins/Process')
| -rw-r--r-- | lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index c82f79becf2..0fa253d7e0e 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -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); |

