]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
common.opt: Add -gdwarf.
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Wed, 10 Apr 2013 14:47:55 +0000 (14:47 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 10 Apr 2013 14:47:55 +0000 (10:47 -0400)
* common.opt: Add -gdwarf.
* opts.c (common_handle_option): Handle it.
* gcc.c (ASM_DEBUG_SPEC): Don't expect "-2" for DWARF.

Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r197675

gcc/ChangeLog
gcc/common.opt
gcc/gcc.c
gcc/opts.c

index 2a95de18852d63d028bfb904477f8addbf236fad..b9bee5e91f1bd1bcab0e0913fbb4adb99cf100bc 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-10  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+            Jason Merrill  <jason@redhat.com>
+
+       * common.opt: Add -gdwarf.
+       * opts.c (common_handle_option): Handle it.
+       * gcc.c (ASM_DEBUG_SPEC): Don't expect "-2" for DWARF.
+
 2013-04-10  Richard Biener  <rguenther@suse.de>
 
        * passes.c (execute_todo): Do not call ggc_collect conditional here.
index e02e7ed1d383946a0fdd323e37153dcf14a246b3..6b9b2e192ca05e4334412c35a98c7a1172f55c6b 100644 (file)
@@ -2308,9 +2308,13 @@ Common JoinedOrMissing
 Generate debug information in default format
 
 gcoff
-Common JoinedOrMissing Negative(gdwarf-)
+Common JoinedOrMissing Negative(gdwarf)
 Generate debug information in COFF format
 
+gdwarf
+Common JoinedOrMissing Negative(gdwarf-)
+Generate debug information in default version of DWARF format
+
 gdwarf-
 Common Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs)
 Generate debug information in DWARF v2 (or later) format
index 86077f8cf321ad1ed3a3897b1259ddc06d71eeca..bcfbfc8b1131f6162513adae41b247a8b6ab01ab 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -627,7 +627,7 @@ proper position among the other output files.  */
      && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
 #  define ASM_DEBUG_SPEC                                               \
       (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG                           \
-       ? "%{!g0:%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}}" ASM_MAP   \
+       ? "%{!g0:%{gdwarf*:--gdwarf2}%{!gdwarf*:%{g*:--gstabs}}}" ASM_MAP       \
        : "%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}}" ASM_MAP)
 # else
 #  if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
index 45b12fecb8e472d3e464e67d1dc5781da722e1e5..f96ed1684599ebc927941fe408a2642b7e9c07dc 100644 (file)
@@ -1699,6 +1699,18 @@ common_handle_option (struct gcc_options *opts,
       set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
       break;
 
+    case OPT_gdwarf:
+      if (arg && strlen(arg) != 0)
+        {
+          error_at (loc, "%<-gdwarf%s%> is ambiguous; "
+                    "use %<-gdwarf-%s%> for DWARF version "
+                    "or %<-gdwarf -g%s%> for debug level", arg, arg, arg);
+          break;
+        }
+      else
+        {
+          value = opts->x_dwarf_version;
+        }
     case OPT_gdwarf_:
       if (value < 2 || value > 4)
        error_at (loc, "dwarf version %d is not supported", value);