import-trace: fail gracefully if --elf is missing but needed

Change-Id: Ib154326507e307b65099f1b84c44e796b1aef98a
This commit is contained in:
Horst Schirmeier
2018-07-23 15:33:06 +02:00
parent 54f3d3f9b6
commit 8adc859223
4 changed files with 16 additions and 1 deletions

View File

@ -104,6 +104,11 @@ bool AdvancedMemoryImporter::handle_ip_event(fail::simtime_t curtime, instructio
llvm::InitializeAllTargetMCs();
llvm::InitializeAllDisassemblers();
if (!m_elf) {
LOG << "Please give an ELF binary as parameter (-e/--elf)." << std::endl;
return false;
}
Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(m_elf->getFilename());
if (!BinaryOrErr) {
std::string Buf;