aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyGHDL/dom/_Utils.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py
index f413351b4..a39638559 100644
--- a/pyGHDL/dom/_Utils.py
+++ b/pyGHDL/dom/_Utils.py
@@ -59,10 +59,19 @@ def CheckForErrors() -> None:
errors = []
if errorCount != 0:
for i in range(errorCount):
- errors.append(errorout_memory.Get_Error_Message(i + 1))
-
- raise DOMException("Error raised in libghdl.") \
- from LibGHDLException("libghdl: Internal error.", errors)
+ rec = errorout_memory.Get_Error_Record(i + 1)
+ fileName = name_table.Get_Name_Ptr(files_map.Get_File_Name(rec.file))
+ message = errorout_memory.Get_Error_Message(i + 1)
+
+ errors.append(
+ "{file}:{line}:{column}: {msg}".format(
+ file=fileName, line=rec.line, column=rec.offset, msg=message
+ )
+ )
+
+ raise DOMException("Error raised in libghdl.") from LibGHDLException(
+ "libghdl: Internal error.", errors
+ )
@export