Message ID | 20130410132502.GA28317@atmel.com |
---|---|
State | New |
Headers | show |
Applied, thanks. Jason
On Wed, Apr 10, 2013 at 06:55:10PM +0530, Senthil Kumar Selvaraj wrote: > --- gcc/opts.c > +++ gcc/opts.c > @@ -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) The formatting is wrong. Space before ( above missing. > + { > + 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; > + } A single line statement shouldn't be surrounded inside { }. ALso, if the OPT_gdwarf case is meant to fallthru into OPT_gdwarf_, there should be /* FALLTHRU */ or similar comment. > case OPT_gdwarf_: > if (value < 2 || value > 4) > error_at (loc, "dwarf version %d is not supported", value); Jakub
diff --git gcc/common.opt gcc/common.opt index e02e7ed..e3645c3 100644 --- gcc/common.opt +++ gcc/common.opt @@ -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 UInteger Negative(gdwarf-) +Generate debug information in the default DWARF version format + gdwarf- Common Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs) Generate debug information in DWARF v2 (or later) format diff --git gcc/opts.c gcc/opts.c index 45b12fe..f96ed16 100644 --- gcc/opts.c +++ gcc/opts.c @@ -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);