aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-04-25 04:09:37 +0200
committerTristan Gingold <tgingold@free.fr>2018-04-25 04:27:09 +0200
commitb6d79c2362746b35bf276a610afaa7b9218bf183 (patch)
tree402466cb571f6e44886bba1e9c2ed9e92e87fc5c /src/grt
parent9adcbde96c2f848c6323b1468b04d28de1976c33 (diff)
downloadghdl-b6d79c2362746b35bf276a610afaa7b9218bf183.tar.gz
ghdl-b6d79c2362746b35bf276a610afaa7b9218bf183.tar.bz2
ghdl-b6d79c2362746b35bf276a610afaa7b9218bf183.zip
Use specific error message for direction mismatch.
Fix #559
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-lib.adb19
-rw-r--r--src/grt/grt-lib.ads13
2 files changed, 25 insertions, 7 deletions
diff --git a/src/grt/grt-lib.adb b/src/grt/grt-lib.adb
index 9aa3558cc..c05e97ba3 100644
--- a/src/grt/grt-lib.adb
+++ b/src/grt/grt-lib.adb
@@ -164,8 +164,8 @@ package body Grt.Lib is
Error_E ("");
end Ghdl_Program_Error;
- procedure Ghdl_Bound_Check_Failed_L1 (Filename : Ghdl_C_String;
- Line: Ghdl_I32)
+ procedure Ghdl_Bound_Check_Failed (Filename : Ghdl_C_String;
+ Line: Ghdl_I32)
is
Bt : Backtrace_Addrs;
begin
@@ -175,7 +175,20 @@ package body Grt.Lib is
Error_C (":");
Error_C (Integer (Line));
Error_E_Call_Stack (Bt);
- end Ghdl_Bound_Check_Failed_L1;
+ end Ghdl_Bound_Check_Failed;
+
+ procedure Ghdl_Direction_Check_Failed (Filename : Ghdl_C_String;
+ Line: Ghdl_I32)
+ is
+ Bt : Backtrace_Addrs;
+ begin
+ Save_Backtrace (Bt, 1);
+ Error_C ("slice direction doesn't match index direction at ");
+ Error_C (Filename);
+ Error_C (":");
+ Error_C (Integer (Line));
+ Error_E_Call_Stack (Bt);
+ end Ghdl_Direction_Check_Failed;
function Ghdl_Integer_Exp (V : Ghdl_I32; E : Ghdl_I32)
return Ghdl_I32
diff --git a/src/grt/grt-lib.ads b/src/grt/grt-lib.ads
index 6e01ea9de..5d0fdfa57 100644
--- a/src/grt/grt-lib.ads
+++ b/src/grt/grt-lib.ads
@@ -55,8 +55,11 @@ package Grt.Lib is
Error_Severity : constant Integer := 2;
Failure_Severity : constant Integer := 3;
- procedure Ghdl_Bound_Check_Failed_L1 (Filename : Ghdl_C_String;
- Line: Ghdl_I32);
+ -- Bound / Direction error.
+ procedure Ghdl_Bound_Check_Failed (Filename : Ghdl_C_String;
+ Line: Ghdl_I32);
+ procedure Ghdl_Direction_Check_Failed (Filename : Ghdl_C_String;
+ Line: Ghdl_I32);
-- Program error has occured:
-- * configuration of an already configured block.
@@ -113,8 +116,10 @@ private
pragma Export (C, Ghdl_Psl_Cover_Failed, "__ghdl_psl_cover_failed");
pragma Export (C, Ghdl_Report, "__ghdl_report");
- pragma Export (C, Ghdl_Bound_Check_Failed_L1,
- "__ghdl_bound_check_failed_l1");
+ pragma Export (C, Ghdl_Bound_Check_Failed,
+ "__ghdl_bound_check_failed");
+ pragma Export (C, Ghdl_Direction_Check_Failed,
+ "__ghdl_direction_check_failed");
pragma Export (C, Ghdl_Program_Error, "__ghdl_program_error");
pragma Export (C, Ghdl_Malloc, "__ghdl_malloc");