aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-rtis_utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-25 11:29:56 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-25 11:29:56 +0200
commita8a33296493e609335177703349465712e8245e2 (patch)
tree37d4fda10f5c592724ca8feff9308238267c7dfe /src/grt/grt-rtis_utils.adb
parent2f37e351d2008e7b5be7a975dc34fe3485809a62 (diff)
downloadghdl-a8a33296493e609335177703349465712e8245e2.tar.gz
ghdl-a8a33296493e609335177703349465712e8245e2.tar.bz2
ghdl-a8a33296493e609335177703349465712e8245e2.zip
grt: handle unbounded array subtype in rtis and waves
Diffstat (limited to 'src/grt/grt-rtis_utils.adb')
-rw-r--r--src/grt/grt-rtis_utils.adb25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/grt/grt-rtis_utils.adb b/src/grt/grt-rtis_utils.adb
index 09b9d434c..ad9d33563 100644
--- a/src/grt/grt-rtis_utils.adb
+++ b/src/grt/grt-rtis_utils.adb
@@ -171,8 +171,9 @@ package body Grt.Rtis_Utils is
Addr := To_Addr_Acc (Obj_Loc).all;
end if;
when Ghdl_Rtik_Type_Array
- | Ghdl_Rtik_Type_Unbounded_Record
- | Ghdl_Rtik_Subtype_Unbounded_Record =>
+ | Ghdl_Rtik_Subtype_Unbounded_Array
+ | Ghdl_Rtik_Type_Unbounded_Record
+ | Ghdl_Rtik_Subtype_Unbounded_Record =>
-- If the type is unbounded then the location
-- for the object containts a pointer to the bounds
-- and a pointer to the data.
@@ -211,9 +212,14 @@ package body Grt.Rtis_Utils is
Off_Addr := Rec_Layout + Off;
El_Addr := Obj + To_Ghdl_Index_Ptr (Off_Addr).all;
El_Bounds := Rec_Layout + El.Layout_Off;
- if El.Eltype.Kind = Ghdl_Rtik_Type_Array then
- El_Bounds := Array_Layout_To_Bounds (El_Bounds);
- end if;
+ case El.Eltype.Kind is
+ when Ghdl_Rtik_Type_Array
+ | Ghdl_Rtik_Subtype_Unbounded_Array =>
+ El_Bounds := Array_Layout_To_Bounds (El_Bounds);
+ when others =>
+ -- Keep layout.
+ null;
+ end case;
when others =>
Internal_Error ("record_to_element");
end case;
@@ -413,6 +419,15 @@ package body Grt.Rtis_Utils is
Handle_Scalar (Rti);
when Ghdl_Rtik_Type_Array =>
Handle_Array_1 (To_Ghdl_Rtin_Type_Array_Acc (Rti), 0);
+ when Ghdl_Rtik_Subtype_Unbounded_Array =>
+ declare
+ St : constant Ghdl_Rtin_Subtype_Composite_Acc :=
+ To_Ghdl_Rtin_Subtype_Composite_Acc (Rti);
+ Bt : constant Ghdl_Rtin_Type_Array_Acc :=
+ To_Ghdl_Rtin_Type_Array_Acc (St.Basetype);
+ begin
+ Handle_Array_1 (Bt, 0);
+ end;
when Ghdl_Rtik_Subtype_Array =>
declare
St : constant Ghdl_Rtin_Subtype_Composite_Acc :=