diff options
Diffstat (limited to 'gcc/ada/a-exextr.adb')
-rw-r--r-- | gcc/ada/a-exextr.adb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gcc/ada/a-exextr.adb b/gcc/ada/a-exextr.adb index 94ec48338f9..2a6f82b83df 100644 --- a/gcc/ada/a-exextr.adb +++ b/gcc/ada/a-exextr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -85,7 +85,11 @@ package body Exception_Traces is if not Excep.Id.Not_Handled_By_Others and then (Exception_Trace = Every_Raise - or else (Exception_Trace = Unhandled_Raise and then Is_Unhandled)) + or else + (Is_Unhandled + and then + (Exception_Trace = Unhandled_Raise + or else Exception_Trace = Unhandled_Raise_In_Main))) then -- Exception trace messages need to be protected when several tasks -- can issue them at the same time. @@ -93,12 +97,15 @@ package body Exception_Traces is Lock_Task.all; To_Stderr (Nline); - if Is_Unhandled then - To_Stderr ("Unhandled "); + if Exception_Trace /= Unhandled_Raise_In_Main then + if Is_Unhandled then + To_Stderr ("Unhandled "); + end if; + + To_Stderr ("Exception raised"); + To_Stderr (Nline); end if; - To_Stderr ("Exception raised"); - To_Stderr (Nline); To_Stderr (Exception_Information (Excep.all)); Unlock_Task.all; end if; @@ -170,8 +177,8 @@ package body Exception_Traces is -- The bulk of exception traces output is centralized in Notify_Exception, -- for both the Handled and Unhandled cases. Extra task specific output is -- triggered in the task wrapper for unhandled occurrences in tasks. It is - -- not performed in this unit to avoid dragging dependencies against the - -- tasking units here. + -- not performed in this unit to avoid dependencies on the tasking units + -- here. -- We used to rely on the output performed by Unhanded_Exception_Terminate -- for the case of an unhandled occurrence in the environment thread, and @@ -191,12 +198,4 @@ package body Exception_Traces is -- Today's solution has the advantage of simplicity and better isolates -- the Exception_Traces machinery. - -- It currently outputs the information about unhandled exceptions twice - -- in the environment thread, once in the notification routine and once in - -- the termination routine. Avoiding the second output is possible but so - -- far has been considered undesirable. It would mean changing the order - -- of outputs between the two runs with or without exception traces, while - -- it seems preferable to only have additional outputs in the former - -- case. - end Exception_Traces; |