I'm trying to put Adacore's Gem on dynamic stack size analysis into action on our project.
Our project uses a lot of different tasks and is killed using
procedure C_Exit (Status : Interfaces.C.int);
pragma Import (C, C_Exit, "exit");
This is rather equivalent to GNAT's specific solution suggested by Simon Wright which would lead to the MWE
with GNAT.OS_Lib;
procedure Main is
task T is
entry E (Size : Integer);
end T;
task body T is
begin
accept E (Size : Integer) do
declare
V : array (1 .. Size) of Integer := (others => 0);
begin
GNAT.OS_Lib.OS_Exit (0); -- this is the only difference to Adacores example
end;
end E;
end T;
begin
T.E (500_000);
end Main;
Binding this program with the -u10
option (using Gnat 19.1 and 20.1) won't output any report (while it does when not exiting).
Is there a solution to get the report without changing "too much" my existent code base?