From 4251a598c9583601952649829e456ee645a693b5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 17 Jul 2016 10:19:02 +0200 Subject: o Catch at least std exceptions to show a error message that can start to explain why it failed. --- elfinfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elfinfo.cpp b/elfinfo.cpp index 5982dd1..6ddbceb 100644 --- a/elfinfo.cpp +++ b/elfinfo.cpp @@ -192,6 +192,8 @@ int main(int argc, char **argv) { LdScript file = loader.load(ld_filename); memoryAreas.insert(memoryAreas.end(), file.memoryAreas.begin(), file.memoryAreas.end()); + } catch (std::exception &e) { + errx(EX_DATAERR, "Unhandled exception when parsing LD script. The parser is new and fragile, so please file a bug and send me your LD script: %s", e.what()); } catch (...) { errx(EX_DATAERR, "Unhandled exception when parsing LD script. The parser is new and fragile, so please file a bug and send me your LD script."); } -- cgit v1.2.3