aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-04 19:44:12 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-04 19:44:12 +0100
commit48b838e5d1ffddf45688ac32ac88f0e1982d6a4a (patch)
tree2833e0fe92844ded8c9a7f4e2a4e8c6fd2d94936 /src
parent6a678f867be2202378703935921f5eb25d156547 (diff)
downloadghdl-48b838e5d1ffddf45688ac32ac88f0e1982d6a4a.tar.gz
ghdl-48b838e5d1ffddf45688ac32ac88f0e1982d6a4a.tar.bz2
ghdl-48b838e5d1ffddf45688ac32ac88f0e1982d6a4a.zip
elab-vhdl_debug: add pheap command, improve access display
Diffstat (limited to 'src')
-rw-r--r--src/synth/elab-vhdl_debug.adb33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb
index 31ec92e49..91b25ddf2 100644
--- a/src/synth/elab-vhdl_debug.adb
+++ b/src/synth/elab-vhdl_debug.adb
@@ -28,6 +28,7 @@ with Elab.Memtype; use Elab.Memtype;
with Elab.Vhdl_Annotations;
with Elab.Vhdl_Values; use Elab.Vhdl_Values;
with Elab.Vhdl_Values.Debug; use Elab.Vhdl_Values.Debug;
+with Elab.Vhdl_Heap;
with Synth.Vhdl_Expr;
@@ -240,7 +241,16 @@ package body Elab.Vhdl_Debug is
when Type_Record =>
Disp_Value_Record (M, Vtype);
when Type_Access =>
- Put ("*access*");
+ declare
+ Idx : constant Heap_Index := Read_Access (M);
+ begin
+ if Idx = Null_Heap_Index then
+ Put ("null");
+ else
+ Put ("@");
+ Put_Uns32 (Uns32 (Idx));
+ end if;
+ end;
when Type_Protected =>
Put ("*protected*");
when Type_Unbounded_Array
@@ -1374,12 +1384,33 @@ package body Elab.Vhdl_Debug is
Release_Expr_Pool (Marker);
end Print_Proc;
+ procedure Print_Heap_Proc (Line : String)
+ is
+ F : Natural;
+ Idx : Uns32;
+ Valid : Boolean;
+ Mt : Memtyp;
+ begin
+ F := Skip_Blanks (Line, Line'First);
+ To_Num (Line (F .. Line'Last), Idx, Valid);
+ if not Valid then
+ Put_Line ("invalid heap index");
+ return;
+ end if;
+ Mt := Elab.Vhdl_Heap.Synth_Dereference (Heap_Index (Idx));
+ Debug_Memtyp (Mt);
+ end Print_Heap_Proc;
+
procedure Append_Commands is
begin
Append_Menu_Command
(Name => new String'("p*rint"),
Help => new String'("execute expression"),
Proc => Print_Proc'Access);
+ Append_Menu_Command
+ (Name => new String'("ph*eap"),
+ Help => new String'("print heap index"),
+ Proc => Print_Heap_Proc'Access);
end Append_Commands;
end Elab.Vhdl_Debug;