From 023b2edd48f0f289364a09cc60c53c048e66373b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 13 Apr 2026 21:07:03 -0400 Subject: [PATCH] Add newline on alarm timeouts to help error parsers --- src/V3EmitCMain.cpp | 3 +++ test_regress/t/t_flag_runtime_timeout_bad.out | 1 + 2 files changed, 4 insertions(+) diff --git a/src/V3EmitCMain.cpp b/src/V3EmitCMain.cpp index d4df97d08..136eb7e4c 100644 --- a/src/V3EmitCMain.cpp +++ b/src/V3EmitCMain.cpp @@ -73,6 +73,9 @@ private: if (v3Global.opt.debugRuntimeTimeout()) { puts("void alarmHandler(int signum) {\n"); + // Add newline so %Error is at beginning-of-line, as might get the alarm + // when in the middle of some other print with no newline + puts(" VL_PRINTF_MT(\"\\n\");\n"); puts(" VL_FATAL_MT(\"\", 0, \"\", \"Alarm signal received,"s + " '--debug-runtime-timeout "s + std::to_string(v3Global.opt.debugRuntimeTimeout()) + "' exceeded\\n\");\n"); diff --git a/test_regress/t/t_flag_runtime_timeout_bad.out b/test_regress/t/t_flag_runtime_timeout_bad.out index 2566e4d39..edbddf692 100644 --- a/test_regress/t/t_flag_runtime_timeout_bad.out +++ b/test_regress/t/t_flag_runtime_timeout_bad.out @@ -1,4 +1,5 @@ Sleeping.... + %Error: Alarm signal received, '--debug-runtime-timeout 1' exceeded Aborting...