aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ghdldrv/ghdlsimul.adb5
-rw-r--r--src/simul/simul-vhdl_simul.adb7
-rw-r--r--src/synth/elab-debugger.adb3
-rw-r--r--src/synth/elab-debugger.ads6
-rw-r--r--src/synth/synth-vhdl_stmts.ads2
5 files changed, 13 insertions, 10 deletions
diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb
index a2c1d3ca2..44e0d133a 100644
--- a/src/ghdldrv/ghdlsimul.adb
+++ b/src/ghdldrv/ghdlsimul.adb
@@ -162,11 +162,6 @@ package body Ghdlsimul is
Simul.Vhdl_Simul.Simulation;
- -- Simul uses report_msg.
- if Errorout.Nbr_Errors > 0 then
- Grt.Errors.Exit_Status := 1;
- end if;
-
Set_Exit_Status (Exit_Status (Grt.Errors.Exit_Status));
end Run;
diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb
index 63e747e9d..383203e92 100644
--- a/src/simul/simul-vhdl_simul.adb
+++ b/src/simul/simul-vhdl_simul.adb
@@ -1067,7 +1067,7 @@ package body Simul.Vhdl_Simul is
end;
when Iir_Kind_Assertion_Statement =>
- Synth.Vhdl_Stmts.Execute_Assertion_Statement (Inst, Stmt);
+ Execute_Assertion_Statement (Inst, Stmt);
Next_Statement (Process, Stmt);
when Iir_Kind_Report_Statement =>
Synth.Vhdl_Stmts.Execute_Report_Statement (Inst, Stmt);
@@ -1275,8 +1275,7 @@ package body Simul.Vhdl_Simul is
if Elab.Debugger.Flag_Need_Debug then
Elab.Debugger.Debug_Break (Process.Instance, Process.Proc);
end if;
- Synth.Vhdl_Stmts.Execute_Assertion_Statement
- (Process.Instance, Process.Proc);
+ Execute_Assertion_Statement (Process.Instance, Process.Proc);
when Iir_Kind_Concurrent_Simple_Signal_Assignment =>
if Elab.Debugger.Flag_Need_Debug then
Elab.Debugger.Debug_Break (Process.Instance, Process.Proc);
@@ -2671,6 +2670,8 @@ package body Simul.Vhdl_Simul is
Grt.Options.Progname := To_Ghdl_C_String (Ghdl_Progname'Address);
Grt.Errors.Set_Error_Stream (Grt.Stdio.stdout);
+ Elab.Debugger.Error_Hook := Grt.Errors.Fatal_Error'Access;
+
-- Grt.Errors.Error_Hook := Debug_Error'Access;
if Flag_Debug_Elab then
diff --git a/src/synth/elab-debugger.adb b/src/synth/elab-debugger.adb
index f1138904f..0f5ecb9dc 100644
--- a/src/synth/elab-debugger.adb
+++ b/src/synth/elab-debugger.adb
@@ -1041,6 +1041,9 @@ package body Elab.Debugger is
Current_Loc := Expr;
Debug (Reason_Error);
end if;
+ if Error_Hook /= null then
+ Error_Hook.all;
+ end if;
end Debug_Error;
end Elab.Debugger;
diff --git a/src/synth/elab-debugger.ads b/src/synth/elab-debugger.ads
index cc456dfc1..bb8f91f90 100644
--- a/src/synth/elab-debugger.ads
+++ b/src/synth/elab-debugger.ads
@@ -45,8 +45,14 @@ package Elab.Debugger is
-- To be called in case of execution error, like:
-- * index out of bounds.
+ -- * assertion failuere
procedure Debug_Error (Inst : Synth_Instance_Acc; Expr : Node);
+ -- Hook called in case of fatal error.
+ type Error_Hook_Type is access procedure;
+ pragma Convention (C, Error_Hook_Type);
+ Error_Hook : Error_Hook_Type;
+
function Debug_Current_Instance return Synth_Instance_Acc;
type Menu_Procedure is access procedure (Line : String);
diff --git a/src/synth/synth-vhdl_stmts.ads b/src/synth/synth-vhdl_stmts.ads
index 3922b9242..db78c44d7 100644
--- a/src/synth/synth-vhdl_stmts.ads
+++ b/src/synth/synth-vhdl_stmts.ads
@@ -101,8 +101,6 @@ package Synth.Vhdl_Stmts is
Unit : Node;
Parent_Inst : Synth_Instance_Acc);
- procedure Execute_Assertion_Statement (Inst : Synth_Instance_Acc;
- Stmt : Node);
procedure Execute_Report_Statement (Inst : Synth_Instance_Acc;
Stmt : Node);
procedure Exec_Failed_Assertion (Syn_Inst : Synth_Instance_Acc;