From ac906d15ce76115e1ef6796b2201ebf4d188bd34 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 7 Oct 2022 15:00:19 +0200 Subject: [PATCH] Add YOSYS_ABORT_ON_LOG_ERROR environment variable for debugging. --- CHANGELOG | 4 ++++ kernel/log.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 602e3f670..bb55c0c59 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,10 @@ List of major changes and improvements between releases Yosys 0.22 .. Yosys 0.22-dev -------------------------- + * Various + - Added YOSYS_ABORT_ON_LOG_ERROR environment variable for debugging. + Setting it to 1 causes abort() to be called when Yosys terminates with an + error message. Yosys 0.21 .. Yosys 0.22 -------------------------- diff --git a/kernel/log.cc b/kernel/log.cc index 4403dd0c7..af8c422b8 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -352,6 +352,9 @@ static void logv_error_with_prefix(const char *prefix, log_error_atexit(); YS_DEBUGTRAP_IF_DEBUGGING; + const char *e = getenv("YOSYS_ABORT_ON_LOG_ERROR"); + if (e && atoi(e)) + abort(); #ifdef EMSCRIPTEN log_files = backup_log_files;