diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-16 09:34:40 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-16 09:34:40 +0000 |
commit | e156dd80c9d5447d470a2a29acff4d97ba2bd355 (patch) | |
tree | 9a03f0f199ae466677c31f5513d269b09fabed84 /gcc/ada/s-tassta.adb | |
parent | bb8d99b2b1e2f1814be4bae532798e43f5ba4093 (diff) | |
download | gcc-e156dd80c9d5447d470a2a29acff4d97ba2bd355.tar.gz |
2009-04-16 Doug Rupp <rupp@adacore.com>
* s-taprop-vxworks.adb, s-taprop-tru64.adb, s-taprop-mingw.adb,
s-taprop-linux.adb, s-taprop-solaris.adb, s-taprop-irix.adb,
s-taprop-hpux-dce.adb, s-taprop-posix.adb
(Enter_Task): Move Known_Tasks initialization to s-tassta.adb
* s-taprop-vms.adb (Enter_Task): Likewise.
(Initialize): Import DBEXT, Debug_Register. Register DBGEXT callback.
* s-tassta.adb (Activate_Tasks): After task creation set state to
Activating, vice Runnable. Initialize Known_Tasks, moved here from
s-taprop.adb (Enter_Task). Set Debug_Event_Activating for debugger.
Set state to Runnable after above.
(Task_Wrapper): Set Debug_Event_Run. In exception block set
Debug_Event_Terminated.
* s-taskin.ads (Task_States): Add new states Activiting and
Activator_Delay_Sleep.
(Bit_Array, Debug_Event_Array): New types.
(Global_Task_Debug_Event_Set: New flag.
(Common_ATCB): New field Debug_Events.
* s-taskin.adb (Initialize_ATCB): Initialize Debug_Events.
* s-tasren.adb (Timed_Selective_Wait): Set Activator_Delay_Sleep vice
Activator_Sleep.
* s-tasini.adb (Locked_Abort_To_Level): Add case alternatives for when
Activating and when Acceptor_Delay_Sleep.
* s-tasdeb.ads: Add constants for Debug_Events.
(Debug_Event_Kind_Type): New subtype.
(Signal_Debug_Event): New subprogram.
* s-tasdeb.adb (Signal_Debug_Event): New null subprogram.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146155 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-tassta.adb')
-rw-r--r-- | gcc/ada/s-tassta.adb | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb index 9a5ce9fd8c1..5d4e7cbd9ad 100644 --- a/gcc/ada/s-tassta.adb +++ b/gcc/ada/s-tassta.adb @@ -300,7 +300,7 @@ package body System.Tasking.Stages is -- racing ahead. if Success then - C.Common.State := Runnable; + C.Common.State := Activating; C.Awake_Count := 1; C.Alive_Count := 1; P.Awake_Count := P.Awake_Count + 1; @@ -313,6 +313,21 @@ package body System.Tasking.Stages is P.Common.Wait_Count := P.Common.Wait_Count + 1; end if; + for J in System.Tasking.Debug.Known_Tasks'Range loop + if System.Tasking.Debug.Known_Tasks (J) = null then + System.Tasking.Debug.Known_Tasks (J) := C; + C.Known_Tasks_Index := J; + exit; + end if; + end loop; + + if Global_Task_Debug_Event_Set then + Debug.Signal_Debug_Event + (Debug.Debug_Event_Activating, C); + end if; + + C.Common.State := Runnable; + Unlock (C); Unlock (P); @@ -1130,6 +1145,11 @@ package body System.Tasking.Stages is Self_ID.Deferral_Level := 0; end if; + if Global_Task_Debug_Event_Set then + Debug.Signal_Debug_Event + (Debug.Debug_Event_Run, Self_ID); + end if; + begin -- We are separating the following portion of the code in order to -- place the exception handlers in a different block. In this way, @@ -1168,8 +1188,18 @@ package body System.Tasking.Stages is if Self_ID.Terminate_Alternative then Cause := Normal; + + if Global_Task_Debug_Event_Set then + Debug.Signal_Debug_Event + (Debug.Debug_Event_Terminated, Self_ID); + end if; else Cause := Abnormal; + + if Global_Task_Debug_Event_Set then + Debug.Signal_Debug_Event + (Debug.Debug_Event_Abort_Terminated, Self_ID); + end if; end if; when others => -- ??? Using an E : others here causes CD2C11A to fail on Tru64 @@ -1194,7 +1224,13 @@ package body System.Tasking.Stages is -- procedure, as well as the associated Exception_Occurrence. Cause := Unhandled_Exception; + Save_Occurrence (EO, SSL.Get_Current_Excep.all.all); + + if Global_Task_Debug_Event_Set then + Debug.Signal_Debug_Event + (Debug.Debug_Event_Exception_Terminated, Self_ID); + end if; end; -- Look for a task termination handler. This code is for all tasks but |