aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug.adb
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-12-05 12:12:22 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-12-05 12:12:22 +0000
commit967947ed6b3b9e1b3723b2587feccb4dac47715e (patch)
treefca443d4dc9d36a11449dda831a8b95f2b870dbe /gcc/ada/debug.adb
parent6cbd45e40605d0f77cdc4d31f5b80c1e3d656055 (diff)
downloadgcc-967947ed6b3b9e1b3723b2587feccb4dac47715e.zip
gcc-967947ed6b3b9e1b3723b2587feccb4dac47715e.tar.gz
gcc-967947ed6b3b9e1b3723b2587feccb4dac47715e.tar.bz2
[multiple changes]
2017-12-05 Olivier Hainque <hainque@adacore.com> * s-dwalin.adb (Read_And_Execute_Isn): Adjust test checking for the end of section. Add comments explaining the rationale of the computation. 2017-12-05 Bob Duff <duff@adacore.com> * exp_ch11.adb: Minor refactoring. 2017-12-05 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Add debug switches d_a, d_e, and d_p, along with documentation. (Set_Underscored_Debug_Flag): New routine. * debug.ads: Add the flags for all underscore switches. (Set_Underscored_Debug_Flag): New routine. * einfo.adb: Flag303 is now Suppress_Elaboration_Warnings. (Suppress_Elaboration_Warnings): New routine. (Set_Suppress_Elaboration_Warnings): New routine. (Write_Entity_Flags): Add output for Suppress_Elaboration_Warnings. * einfo.ads: Add new flag Suppress_Elaboration_Warnings. (Suppress_Elaboration_Warnings): New routine along with pragma Inline. (Set_Suppress_Elaboration_Warnings): New routine along with pragma Inline. * exp_ch3.adb (Build_Init_Procedure): Restore the behavior of the legacy elaboration model. (Default_Initialize_Object): Restore the behavior of the legacy elaboration model. * exp_ch9.adb: Add with and use clause for Sem_Elab. (Build_Task_Activation_Call): Restore the behavior of the legacy elaboration model. * frontend.adb (Frontend): Restore the behavior of the legacy elaboration model. * opt.ads: Add new flags Legacy_Elaboration_Checks and Relaxed_Elaboration_Checks, along with documentation. * sem_attr.adb (Analyze_Access_Attribute): Restore the behavior of the legacy elaboration model. * sem_ch5.adb (Analyze_Assignment): Restore the behavior of the legacy elaboration model. * sem_ch7.adb (Analyze_Package_Declaration): Restore the behavior of the legacy elaboration model. * sem_ch8.adb (Attribute_Renaming): Restore the behavior of the legacy elaboration model. * sem_ch12.adb (Analyze_Instance_And_Renamings): Restore the behavior of the legacy elaboration model. (Analyze_Package_Instantiation): Restore the behavior of the legacy elaboration model. (Analyze_Subprogram_Instantiation): Restore the behavior of the legacy elaboration model. * sem_elab.adb: Update the documentation of the Processing phase. Update the documentation on elaboration-related compilation switches. Update the documentation on adding a new target. Add Processing_Attributes which represent the state of the Processing phase. Resurrect the previous elaboration model as "legacy elaboration model". (Build_Call_Marker): This routine does not function when the legacy elaboration model is in effect. Do not consider entry calls and requeue statements when debug flag d_e is in effect. Do not consider calls to subprograms which verify the runtime semantics of certain assertion pragmas when debug flag d_p is in effect. (Build_Variable_Reference_Marker): This routine does not function when the legacy elaboration model is in effect. (Check_Elaboration_Scenarios): This routine does not function when the legacy elaboration model is in effect. (Ensure_Prior_Elaboration): The various flags have now been replaced with a state. Do not generate implicit Elaborate[_All] pragmas when their creation has been suppressed. (Ensure_Prior_Elaboration_Static): The with clause is marked based on the requested pragma, not on the nature of the scenario. (In_External_Context): Removed. (Is_Assertion_Pragma_Target): New routine. (Is_Potential_Scenario): Stop the traversal of a task body when reaching an accept or select statement, and debug switch d_a is in effect. (Kill_Elaboration_Scenario): This routine does not function when the legacy elaboration model is in effect. (Process_Activation_Generic): The various flags have now been replaced with a state. (Process_Conditional_ABE): The various flags have now been replaced with a state. (Process_Conditional_ABE_Access): The various flags have now been replaced with a state. (Process_Conditional_ABE_Activation_Impl): The various flags have now been replaced with a state. Do not process an activation call which activates a task whose type is defined in an external instance, and debug switch dL is in effect. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Call): The various flags have now been replaced with a state. Do not process a call which invokes a subprogram defined in an external instance, and debug switch dL is in effect. (Process_Conditional_ABE_Call_Ada): The various flags have now been replaced with a state. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Call_SPARK): The various flags have now been replaced with a state. (Process_Conditional_ABE_Instantiation): The various flags have now been replaced with a state. (Process_Conditional_ABE_Instantiation_Ada): The various flags have now been replaced with a state. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Instantiation_SPARK): The various flags have now been replaced with a state. (Process_Guaranteed_ABE_Activation_Impl): The various flags have now been replaced with a state. (Process_Single_Activation): The various flags have now been replaced with a state. (Record_Elaboration_Scenario): This routine does not function when the legacy elaboration model is in effect. (Traverse_Body): The various flags have now been replaced with a state. * sem_elab.ads: Resurrect the pre-18.x elaboration model as "legacy elaboration model". * sem_prag.adb (Analyze_Pragma): Restore the behavior of the legacy elaboration model. * sem_res.adb (Resolve_Call): Restore the behavior of the legacy elaboration model. (Resolve_Entity_Name): Restore the behavior of the legacy elaboration model. * sem_util.adb (Mark_Elaboration_Attributes): This routine does not function when the legacy elaboration model is in effect. * sinfo.adb (Is_Known_Guaranteed_ABE): Update the assertion check. (No_Elaboration_Check): New routine. (Set_Is_Known_Guaranteed_ABE): Update the assertion check. (Set_No_Elaboration_Check): New routine. * sinfo.ads: Update the documentation of flag Is_Known_Guaranteed_ABE along with occurrences in nodes. Add new flag No_Elaboration_Check along with occurrences in nodes. * switch-c.adb (Scan_Front_End_Switches): Add processing for debug switches with underscores. Add processing for switches -gnatH and -gnatJ. * usage.adb (Usage): Add output for switches -gnatH and -gnatJ. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the documentation to include the legacy and relaxed elaboration models. * gnat_ugn.texi: Regenerate. 2017-12-05 Arnaud Charlet <charlet@adacore.com> * doc/gnat_ugn/platform_specific_information.rst: Minor edit. Improve doc on required packages for linux 32bits. 2017-12-05 Doug Rupp <rupp@adacore.com> * tracebak.c (ppc64-vx7): USE_GCC_UNWINDER for 64bit. 2017-12-05 Javier Miranda <miranda@adacore.com> * checks.adb (Generate_Range_Check): Force evaluation of the node in more cases. This patch was written to improve the code generated by the CCG compiler but it is enabled for all targets since double evaluation is always a potential source of inefficiency. 2017-12-05 Gary Dismukes <dismukes@adacore.com> * doc/gnat_ugn/gnat_utility_programs.rst: Remove reference to obsolete -fdump-xref switch. From-SVN: r255412
Diffstat (limited to 'gcc/ada/debug.adb')
-rw-r--r--gcc/ada/debug.adb235
1 files changed, 233 insertions, 2 deletions
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 06bec39..0a14cec 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -145,6 +145,60 @@ package body Debug is
-- d.Y
-- d.Z Do not enable expansion in configurable run-time mode
+ -- d_a Stop elaboration checks on accept or select statement
+ -- d_b
+ -- d_c
+ -- d_d
+ -- d_e Ignore entry calls and requeue statements for elaboration
+ -- d_f
+ -- d_g
+ -- d_h
+ -- d_i
+ -- d_j
+ -- d_k
+ -- d_l
+ -- d_m
+ -- d_n
+ -- d_o
+ -- d_p Ignore assertion pragmas for elaboration
+ -- d_q
+ -- d_r
+ -- d_s
+ -- d_t
+ -- d_u
+ -- d_v
+ -- d_w
+ -- d_x
+ -- d_y
+ -- d_z
+
+ -- d_A
+ -- d_B
+ -- d_C
+ -- d_D
+ -- d_E
+ -- d_F
+ -- d_G
+ -- d_H
+ -- d_I
+ -- d_J
+ -- d_K
+ -- d_L Output trace information on elaboration checking
+ -- d_M
+ -- d_N
+ -- d_O
+ -- d_P
+ -- d_Q
+ -- d_R
+ -- d_S
+ -- d_T
+ -- d_U
+ -- d_V
+ -- d_W
+ -- d_X
+ -- d_Y
+ -- d_Z
+
-- d1 Error msgs have node numbers where possible
-- d2 Eliminate error flags in verbose form error messages
-- d3 Dump bad node in Comperr on an abort
@@ -165,6 +219,16 @@ package body Debug is
-- d.8
-- d.9 Disable build-in-place for nonlimited types
+ -- d_1
+ -- d_2
+ -- d_3
+ -- d_4
+ -- d_5
+ -- d_6
+ -- d_7
+ -- d_8
+ -- d_9
+
-- Debug flags for binder (GNATBIND)
-- da All links (including internal units) listed if there is a cycle
@@ -759,6 +823,24 @@ package body Debug is
-- case if debug flag -gnatd.Z is used. This is to deal with the case
-- where we discover difficulties in this new processing.
+ -- d_a The compiler stops the examination of a task body once it reaches
+ -- an accept or select statement for the static elaboration model. The
+ -- behavior is similar to that of No_Entry_Calls_In_Elaboration_Code,
+ -- but does not penalize actual entry calls in elaboration code.
+
+ -- d_e The compiler ignores simple entry calls, asynchronous transfer of
+ -- control, conditional entry calls, timed entry calls, and requeue
+ -- statements in both the static and dynamic elaboration models.
+
+ -- d_p The compiler ignores calls to subprograms which verify the run-time
+ -- semantics of invariants and postconditions in both the static and
+ -- dynamic elaboration models.
+
+ -- d_L Output trace information on elaboration checking. This debug switch
+ -- causes output to be generated showing each call or instantiation as
+ -- it is checked, and the progress of the recursive trace through
+ -- elaboration calls at compile time.
+
-- d1 Error messages have node numbers where possible. Normally error
-- messages have only source locations. This option is useful when
-- debugging errors caused by expanded code, where the source location
@@ -944,7 +1026,7 @@ package body Debug is
--------------------
procedure Set_Debug_Flag (C : Character; Val : Boolean := True) is
- subtype Dig is Character range '1' .. '9';
+ subtype Dig is Character range '1' .. '9';
subtype LLet is Character range 'a' .. 'z';
subtype ULet is Character range 'A' .. 'Z';
@@ -1090,7 +1172,7 @@ package body Debug is
---------------------------
procedure Set_Dotted_Debug_Flag (C : Character; Val : Boolean := True) is
- subtype Dig is Character range '1' .. '9';
+ subtype Dig is Character range '1' .. '9';
subtype LLet is Character range 'a' .. 'z';
subtype ULet is Character range 'A' .. 'Z';
@@ -1231,4 +1313,153 @@ package body Debug is
end if;
end Set_Dotted_Debug_Flag;
+ --------------------------------
+ -- Set_Underscored_Debug_Flag --
+ --------------------------------
+
+ procedure Set_Underscored_Debug_Flag
+ (C : Character;
+ Val : Boolean := True)
+ is
+ subtype Dig is Character range '1' .. '9';
+ subtype LLet is Character range 'a' .. 'z';
+ subtype ULet is Character range 'A' .. 'Z';
+
+ begin
+ if C in Dig then
+ case Dig (C) is
+ when '1' =>
+ Debug_Flag_Underscore_1 := Val;
+ when '2' =>
+ Debug_Flag_Underscore_2 := Val;
+ when '3' =>
+ Debug_Flag_Underscore_3 := Val;
+ when '4' =>
+ Debug_Flag_Underscore_4 := Val;
+ when '5' =>
+ Debug_Flag_Underscore_5 := Val;
+ when '6' =>
+ Debug_Flag_Underscore_6 := Val;
+ when '7' =>
+ Debug_Flag_Underscore_7 := Val;
+ when '8' =>
+ Debug_Flag_Underscore_8 := Val;
+ when '9' =>
+ Debug_Flag_Underscore_9 := Val;
+ end case;
+
+ elsif C in ULet then
+ case ULet (C) is
+ when 'A' =>
+ Debug_Flag_Underscore_AA := Val;
+ when 'B' =>
+ Debug_Flag_Underscore_BB := Val;
+ when 'C' =>
+ Debug_Flag_Underscore_CC := Val;
+ when 'D' =>
+ Debug_Flag_Underscore_DD := Val;
+ when 'E' =>
+ Debug_Flag_Underscore_EE := Val;
+ when 'F' =>
+ Debug_Flag_Underscore_FF := Val;
+ when 'G' =>
+ Debug_Flag_Underscore_GG := Val;
+ when 'H' =>
+ Debug_Flag_Underscore_HH := Val;
+ when 'I' =>
+ Debug_Flag_Underscore_II := Val;
+ when 'J' =>
+ Debug_Flag_Underscore_JJ := Val;
+ when 'K' =>
+ Debug_Flag_Underscore_KK := Val;
+ when 'L' =>
+ Debug_Flag_Underscore_LL := Val;
+ when 'M' =>
+ Debug_Flag_Underscore_MM := Val;
+ when 'N' =>
+ Debug_Flag_Underscore_NN := Val;
+ when 'O' =>
+ Debug_Flag_Underscore_OO := Val;
+ when 'P' =>
+ Debug_Flag_Underscore_PP := Val;
+ when 'Q' =>
+ Debug_Flag_Underscore_QQ := Val;
+ when 'R' =>
+ Debug_Flag_Underscore_RR := Val;
+ when 'S' =>
+ Debug_Flag_Underscore_SS := Val;
+ when 'T' =>
+ Debug_Flag_Underscore_TT := Val;
+ when 'U' =>
+ Debug_Flag_Underscore_UU := Val;
+ when 'V' =>
+ Debug_Flag_Underscore_VV := Val;
+ when 'W' =>
+ Debug_Flag_Underscore_WW := Val;
+ when 'X' =>
+ Debug_Flag_Underscore_XX := Val;
+ when 'Y' =>
+ Debug_Flag_Underscore_YY := Val;
+ when 'Z' =>
+ Debug_Flag_Underscore_ZZ := Val;
+ end case;
+
+ else
+ case LLet (C) is
+ when 'a' =>
+ Debug_Flag_Underscore_A := Val;
+ when 'b' =>
+ Debug_Flag_Underscore_B := Val;
+ when 'c' =>
+ Debug_Flag_Underscore_C := Val;
+ when 'd' =>
+ Debug_Flag_Underscore_D := Val;
+ when 'e' =>
+ Debug_Flag_Underscore_E := Val;
+ when 'f' =>
+ Debug_Flag_Underscore_F := Val;
+ when 'g' =>
+ Debug_Flag_Underscore_G := Val;
+ when 'h' =>
+ Debug_Flag_Underscore_H := Val;
+ when 'i' =>
+ Debug_Flag_Underscore_I := Val;
+ when 'j' =>
+ Debug_Flag_Underscore_J := Val;
+ when 'k' =>
+ Debug_Flag_Underscore_K := Val;
+ when 'l' =>
+ Debug_Flag_Underscore_L := Val;
+ when 'm' =>
+ Debug_Flag_Underscore_M := Val;
+ when 'n' =>
+ Debug_Flag_Underscore_N := Val;
+ when 'o' =>
+ Debug_Flag_Underscore_O := Val;
+ when 'p' =>
+ Debug_Flag_Underscore_P := Val;
+ when 'q' =>
+ Debug_Flag_Underscore_Q := Val;
+ when 'r' =>
+ Debug_Flag_Underscore_R := Val;
+ when 's' =>
+ Debug_Flag_Underscore_S := Val;
+ when 't' =>
+ Debug_Flag_Underscore_T := Val;
+ when 'u' =>
+ Debug_Flag_Underscore_U := Val;
+ when 'v' =>
+ Debug_Flag_Underscore_V := Val;
+ when 'w' =>
+ Debug_Flag_Underscore_W := Val;
+ when 'x' =>
+ Debug_Flag_Underscore_X := Val;
+ when 'y' =>
+ Debug_Flag_Underscore_Y := Val;
+ when 'z' =>
+ Debug_Flag_Underscore_Z := Val;
+ end case;
+ end if;
+ end Set_Underscored_Debug_Flag;
+
end Debug;