common.opt (gdwarf-): Initialize dwarf_version to -1 instead of 2.
authorOlivier Hainque <hainque@adacore.com>
Tue, 24 Apr 2012 20:34:30 +0000 (20:34 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Tue, 24 Apr 2012 20:34:30 +0000 (20:34 +0000)
        * common.opt (gdwarf-): Initialize dwarf_version to -1 instead of 2.
        * toplev.c (process_options): Default to dwarf_version 2.
        * config/vxworks.c (vxworks_override_options): Default to strict-dwarf
        and dwarf_version 2.

From-SVN: r186783

gcc/ChangeLog
gcc/common.opt
gcc/config/vxworks.c
gcc/toplev.c

index 3be610718c81d881197d4c300ec597a89d0a0c6a..a7e7ee56460007627c3810bd87687e13cd1b3fc7 100644 (file)
@@ -1,3 +1,10 @@
+2012-04-24  Olivier Hainque  <hainque@adacore.com>
+
+       * common.opt (gdwarf-): Initialize dwarf_version to -1 instead of 2.
+       * toplev.c (process_options): Default to dwarf_version 2.
+       * config/vxworks.c (vxworks_override_options): Default to strict-dwarf
+       and dwarf_version 2.
+
 2012-04-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * tree-pretty-print.h (default_tree_printer): Do not declare.
index aa6ebfe5e94e89c7dda2a7a2ab1f698954200af0..df942275d9522e8afae61cf026c9e921e0042e07 100644 (file)
@@ -2212,7 +2212,7 @@ Common JoinedOrMissing Negative(gdwarf-)
 Generate debug information in COFF format
 
 gdwarf-
-Common Joined UInteger Var(dwarf_version) Init(2) Negative(gstabs)
+Common Joined UInteger Var(dwarf_version) Init(-1) Negative(gstabs)
 Generate debug information in DWARF v2 (or later) format
 
 ggdb
index 2445c8b5a35dc1b206d348f0774a897a3ff39c44..1e5a7ad82a61748916c57ca50bc2edb79cfe4b93 100644 (file)
@@ -144,4 +144,12 @@ vxworks_override_options (void)
   /* PIC is only supported for RTPs.  */
   if (flag_pic && !TARGET_VXWORKS_RTP)
     error ("PIC is only supported for RTPs");
+
+  /* Default to strict dwarf-2 to prevent potential difficulties observed with
+     non-gdb debuggers on extensions > 2.  */
+  if (dwarf_strict < 0)
+    dwarf_strict = 1;
+
+  if (dwarf_version < 0)
+    dwarf_version = 2;
 }
index 3d9e1626b8057d36542847f589cfe9ef4aef4e2e..fcfdba2aefb7680a56c54880c04cd7e1a11b2962 100644 (file)
@@ -1380,6 +1380,10 @@ process_options (void)
   if (dwarf_strict < 0)
     dwarf_strict = 0;
 
+  /* And select a default dwarf level.  */
+  if (dwarf_version < 0)
+    dwarf_version = 2;
+
   /* A lot of code assumes write_symbols == NO_DEBUG if the debugging
      level is 0.  */
   if (debug_info_level == DINFO_LEVEL_NONE)