[Ada] Fix gmem.out corruption by GNAT.Expect
authorDmitriy Anisimkov <anisimko@adacore.com>
Fri, 27 Nov 2020 05:18:46 +0000 (11:18 +0600)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 16 Dec 2020 13:01:01 +0000 (08:01 -0500)
commitbe19b8662bd2601ea761fe5adec3a7ce3940dd7c
tree228046d486e5d591b85d7d4214d0e67395d6f75e
parentc507c83b324582dc05db91d332b0de4b25c85c07
[Ada] Fix gmem.out corruption by GNAT.Expect

gcc/ada/

* adaint.h (__gnat_in_child_after_fork): New flag to express
child process side after fork call.
* adaint.c (__gnat_portable_spawn): Set flag
__gnat_in_child_after_fork.
* expect.c (__gnat_expect_fork): Set __gnat_in_child_after_fork
to one on child side.
* libgnat/memtrack.adb
(In_Child_After_Fork): Flag to disable memory tracking.
(Allow_Trace): New routine defining if memory should be tracked.
(Alloc, Realloc, Free): Use Allow_Trace in "if" condition
instead of First_Call.
gcc/ada/adaint.c
gcc/ada/adaint.h
gcc/ada/expect.c
gcc/ada/libgnat/memtrack.adb