aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-files.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-06-02 20:26:09 +0200
committerTristan Gingold <tgingold@free.fr>2016-06-02 20:26:09 +0200
commit9f3567a554b78b200ea91cb66e5945a80fd0ceb3 (patch)
treef5e8c42809ee3c534ae920a33d7152631cefee9f /src/grt/grt-files.adb
parent39d035c3673f513c54e6fe57cd42e2b88d0d68ff (diff)
downloadghdl-9f3567a554b78b200ea91cb66e5945a80fd0ceb3.tar.gz
ghdl-9f3567a554b78b200ea91cb66e5945a80fd0ceb3.tar.bz2
ghdl-9f3567a554b78b200ea91cb66e5945a80fd0ceb3.zip
Handle default parameters for file_open.
Display backtrace for error in file_open.
Diffstat (limited to 'src/grt/grt-files.adb')
-rw-r--r--src/grt/grt-files.adb14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/grt/grt-files.adb b/src/grt/grt-files.adb
index 1f037a76e..a47381289 100644
--- a/src/grt/grt-files.adb
+++ b/src/grt/grt-files.adb
@@ -245,15 +245,18 @@ package body Grt.Files is
(File : Ghdl_File_Index; Mode : Ghdl_I32; Str : Std_String_Ptr)
is
Res : Ghdl_I32;
+ Bt : Backtrace_Addrs;
begin
Check_File_Mode (File, True);
Res := File_Open (File, Mode, Str);
if Res /= Open_Ok then
- Error_C ("open: cannot open text file ");
+ Save_Backtrace (Bt, 1);
+ Error_C ("cannot open text file """);
Error_C_Std (Str.Base (0 .. Str.Bounds.Dim_1.Length - 1));
- Error_E;
+ Error_C ("""");
+ Error_E_Call_Stack (Bt);
end if;
end Ghdl_Text_File_Open;
@@ -261,15 +264,18 @@ package body Grt.Files is
(File : Ghdl_File_Index; Mode : Ghdl_I32; Str : Std_String_Ptr)
is
Res : Ghdl_I32;
+ Bt : Backtrace_Addrs;
begin
Check_File_Mode (File, False);
Res := File_Open (File, Mode, Str);
if Res /= Open_Ok then
- Error_C ("open: cannot open file ");
+ Save_Backtrace (Bt, 1);
+ Error_C ("cannot open file """);
Error_C_Std (Str.Base (0 .. Str.Bounds.Dim_1.Length - 1));
- Error_E;
+ Error_C ("""");
+ Error_E_Call_Stack (Bt);
end if;
end Ghdl_File_Open;