common.opt: Add -gdwarf.

* 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
This commit is contained in:
Senthil Kumar Selvaraj 2013-04-10 14:47:55 +00:00 committed by Jason Merrill
parent bb313b932b
commit 6782438df7
4 changed files with 25 additions and 2 deletions

View 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.

View 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

View File

@ -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)

View 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);