From 20ce64f00c737aa18b785bfb1b84c1137dff8948 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 16 Sep 2018 08:25:00 +0200 Subject: Improve info message for --stop-delta. For #654 --- src/grt/grt-errors.adb | 12 ++++++++---- src/grt/grt-errors.ads | 3 ++- src/grt/grt-processes.adb | 10 ++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src/grt') diff --git a/src/grt/grt-errors.adb b/src/grt/grt-errors.adb index 5070031e5..11b529014 100644 --- a/src/grt/grt-errors.adb +++ b/src/grt/grt-errors.adb @@ -162,7 +162,7 @@ package body Grt.Errors is procedure Warning_S (Str : String := "") is begin - Diag_C ("warning: "); + Put_Err ("warning: "); Diag_C (Str); end Warning_S; @@ -213,13 +213,17 @@ package body Grt.Errors is Error_E; end Error; - procedure Info (Str : String) is + procedure Info_S (Str : String := "") is begin Put_Err (Progname); Put_Err (":info: "); - Put_Err (Str); + Diag_C (Str); + end Info_S; + + procedure Info_E is + begin Newline_Err; - end Info; + end Info_E; procedure Warning (Str : String) is begin diff --git a/src/grt/grt-errors.ads b/src/grt/grt-errors.ads index a0ba1a03e..f97d25573 100644 --- a/src/grt/grt-errors.ads +++ b/src/grt/grt-errors.ads @@ -95,7 +95,8 @@ package Grt.Errors is pragma No_Return (Internal_Error); -- Display a message which is not an error. - procedure Info (Str : String); + procedure Info_S (Str : String := ""); + procedure Info_E; -- Backtrace used to report call stack in case of error. -- Note: for simplicity we assume that a PC is enough to display the diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb index e4248f0ab..5a657a5de 100644 --- a/src/grt/grt-processes.adb +++ b/src/grt/grt-processes.adb @@ -1109,10 +1109,16 @@ package body Grt.Processes is -- in 2 steps: an after_delay for the time and then a read_only -- to finish the current cycle. Note that no message should be -- printed if the simulation is already finished at the stop time. - Info ("simulation stopped by --stop-time"); + Info_S ("simulation stopped by --stop-time @"); + Diag_C_Now; + Info_E; return True; elsif Current_Delta >= Stop_Delta then - Info ("simulation stopped by --stop-delta"); + Info_S ("simulation stopped @"); + Diag_C_Now; + Diag_C (" by --stop-delta="); + Diag_C (Stop_Delta); + Info_E; return True; else return False; -- cgit v1.2.3