]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add a flag to control the balance between GNAT encodings and std. DWARF
authorPierre-Marie de Rodat <derodat@adacore.com>
Thu, 17 Dec 2015 14:09:26 +0000 (14:09 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 17 Dec 2015 14:09:26 +0000 (14:09 +0000)
In order to accomodate the debugger's support evolution for "new" DWARF
constructs, we need to have an flag that controls the amount of GNAT
encodings/standard DWARF information that is emitted in the debug info.
Propagate this new parameter into the Ada front-end.

gcc/ChangeLog:

* common.opt (gnat_encodings): New variable
(dwarf_gnat_encodings): New enum type.
(fgnat_encodings): New option.
* flag-types.h (enum dwarf_gnat_encodings): New.

gcc/ada/ChangeLog:

* gcc-interface/misc.c (gnat_encodings): Undefine macro and
declare a global variable.
(gnat_post_options): Initialize this global from options.

From-SVN: r231761

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/misc.c
gcc/common.opt
gcc/defaults.h
gcc/flag-types.h

index 1db66d6583bb23a5156444bad7aae9cc1a2561de..c55482b6a0b030f03cc168313a9212a6cf64ad45 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-17  Pierre-Marie de Rodat  <derodat@adacore.com>
+
+       * common.opt (gnat_encodings): New variable
+       (dwarf_gnat_encodings): New enum type.
+       (fgnat_encodings): New option.
+       * flag-types.h (enum dwarf_gnat_encodings): New.
+
 2015-12-17  Christian Bruel  <christian.bruel@st.com>
 
        * tree.h (TYPE_MODE_RAW): New macro.
index 6e2e7b14a99c20eee0cfc9735e01c594673ec8f7..4d802d20b1a14b95c79214fdbfc011facb02aebc 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-17  Pierre-Marie de Rodat  <derodat@adacore.com>
+
+       * gcc-interface/misc.c (gnat_encodings): Undefine macro and
+       declare a global variable.
+       (gnat_post_options): Initialize this global from options.
+
 2015-12-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/48013
index 2a651427865315b24dbf91234278a15b5f53dbef..ef0fe3f0daf734ba9a4f72df9fb650145b8e192f 100644 (file)
@@ -68,7 +68,8 @@ extern const char **gnat_argv;
 
 /* Ada code requires variables for these settings rather than elements
    of the global_options structure because they are imported.  */
-int gnat_encodings = 0;
+#undef gnat_encodings
+enum dwarf_gnat_encodings gnat_encodings = DWARF_GNAT_ENCODINGS_DEFAULT;
 
 #undef optimize
 int optimize;
@@ -276,6 +277,7 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
                "supported anymore");
 
   /* Copy global settings to local versions.  */
+  gnat_encodings = global_options.x_gnat_encodings;
   optimize = global_options.x_optimize;
   optimize_size = global_options.x_optimize_size;
   flag_compare_debug = global_options.x_flag_compare_debug;
index 6264bc03bcabdd45193466029a891e8913d439ab..d66013aa5612cc170ac74c3b85300e6a5c4b26ce 100644 (file)
@@ -167,6 +167,11 @@ bool flag_stack_usage_info = false
 Variable
 int flag_debug_asm
 
+
+; Balance between GNAT encodings and standard DWARF to emit.
+Variable
+enum dwarf_gnat_encodings gnat_encodings = DWARF_GNAT_ENCODINGS_DEFAULT
+
 ; -dP causes the rtl to be emitted as a comment in assembly.
 Variable
 int flag_dump_rtl_in_asm
@@ -1337,6 +1342,22 @@ Common Report Var(flag_gcse_after_reload) Optimization
 Perform global common subexpression elimination after register allocation has
 finished.
 
+Enum
+Name(dwarf_gnat_encodings) Type(int)
+
+EnumValue
+Enum(dwarf_gnat_encodings) String(all) Value(DWARF_GNAT_ENCODINGS_ALL)
+
+EnumValue
+Enum(dwarf_gnat_encodings) String(gdb) Value(DWARF_GNAT_ENCODINGS_GDB)
+
+EnumValue
+Enum(dwarf_gnat_encodings) String(minimal) Value(DWARF_GNAT_ENCODINGS_MINIMAL)
+
+fgnat-encodings=
+Common Enum(dwarf_gnat_encodings) Joined RejectNegative Report Undocumented Var(gnat_encodings)
+-fgnat-encodings=[all|gdb|minimal]     Select the balance between GNAT encodings and standard DWARF emitted in the debug information
+
 ; This option is not documented yet as its semantics will change.
 fgraphite
 Common Report Var(flag_graphite) Optimization
index 0f1c713c889d87d87896a62fd55c6c15b02b0aaa..35836272c2b20baa16c74f61a16774d0fbd2eb50 100644 (file)
@@ -1488,4 +1488,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #endif /* GCC_INSN_FLAGS_H  */
 
+#ifndef DWARF_GNAT_ENCODINGS_DEFAULT
+#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB
+#endif
+
 #endif  /* ! GCC_DEFAULTS_H */
index b130fc5806a53251bc31dad9b1152fd995a5c543..c81a8a2465c9db6a44019c507fbae5492da01e33 100644 (file)
@@ -91,6 +91,21 @@ enum debug_struct_file
   DINFO_STRUCT_FILE_ANY     /* Debug structs defined in all files. */
 };
 
+/* Balance between GNAT encodings and standard DWARF to emit.  */
+
+enum dwarf_gnat_encodings
+{
+  DWARF_GNAT_ENCODINGS_ALL = 0,            /* Emit all GNAT encodings, then emit as
+                                      much standard DWARF as possible so it
+                                      does not conflict with GNAT
+                                      encodings.  */
+  DWARF_GNAT_ENCODINGS_GDB = 1,            /* Emit as much standard DWARF as possible
+                                      as long as GDB handles them.  Emit GNAT
+                                      encodings for the rest.  */
+  DWARF_GNAT_ENCODINGS_MINIMAL = 2  /* Emit all the standard DWARF we can.
+                                      Emit GNAT encodings for the rest.  */
+};
+
 /* Enumerate Objective-c instance variable visibility settings. */
 
 enum ivar_visibility