From ac818f304d4e71ce5361684c10dbc8cabf3aefaf Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 21 Oct 2024 16:42:58 +0200 Subject: [PATCH] increases verbosity incase elf loading goes wrong --- src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 655c2b6..55d3f5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -206,13 +206,21 @@ int main(int argc, char* argv[]) { if(clim.count("elf")) for(std::string input : clim["elf"].as>()) { auto start_addr = vm->get_arch()->load_file(input); - if(start_addr.second) // FIXME: this always evaluates to true as load file always returns + if(start_addr.second) start_address = start_addr.first; + else { + LOG(ERR) << "Error occured while loading file " << input << std::endl; + return 1; + } } for(std::string input : args) { auto start_addr = vm->get_arch()->load_file(input); // treat remaining arguments as elf files - if(start_addr.second) // FIXME: this always evaluates to true as load file always returns + if(start_addr.second) start_address = start_addr.first; + else { + LOG(ERR) << "Error occured while loading file " << input << std::endl; + return 1; + } } if(clim.count("reset")) { auto str = clim["reset"].as();