[PATCH 06/13] remove sdb and -gcoff from non-target files
This removes the -gcoff option, and various sdb related references in non-target files. I also poison SDB_DEBUGGING_INFO and SDB_DEBUG. I didn't see any point in poisoning the other SDB_* macros, as no one has used any of them in a very long time. I noticed one odd thing from removing -gcoff, use of it or any other unrecognized debug info type now gives an odd looking error message. palantir:2016$ gcc -gfoo -S tmp.c cc1: error: unrecognised debug output level ‘foo’ palantir:2017$ We probably should only emit this error when we have a number after -g, and emit some other error when a non-number appears after -g, such as "unrecognized debug info type 'foo'". This is a separate problem that I haven't tried to fix here. Jim gcc/ * common.opt (gcoff): Delete. (gxcoff+): Update Negative chain. * defaults.h: Delete all references to SDB_DEBUGGING_INFO and SDB_DEBUG. * dwarf2out.c (gen_array_type_die): Change SDB to debuggers. * flag-types.h (enum debug_info_type): Delete SDB_DEBUG. * function.c (number_blocks): Delete SDB_DEBUGGING_INFO, SDB_DEBUG, and SDB references. (expand_function_start): Change sdb reference to past tense. (expand_function_end): Change sdb reference to past tense. * gcc.c (cpp_unique_options): Delete gcoff3 reference. * opts.c (debug_type_names): Delete coff entry. (common_handle_option): Delete OPT_gcoff case. * system.h (SDB_DEBUG, SDB_DEBUGGING_INFO): Poison. --- gcc/common.opt | 6 +- gcc/defaults.h | 9 + gcc/dwarf2out.c | 12 ++-- gcc/flag-types.h | 1 - gcc/function.c | 10 +- gcc/gcc.c| 2 +- gcc/opts.c | 6 +- gcc/system.h | 3 ++- 8 files changed, 17 insertions(+), 32 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index 836f05b..25e86ec 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2868,10 +2868,6 @@ g Common Driver RejectNegative JoinedOrMissing Generate debug information in default format. -gcoff -Common Driver JoinedOrMissing Negative(gdwarf) -Generate debug information in COFF format. - gcolumn-info Common Driver Var(debug_column_info,1) Init(1) Record DW_AT_decl_column and DW_AT_call_column in DWARF. @@ -2937,7 +2933,7 @@ Common Driver JoinedOrMissing Negative(gxcoff+) Generate debug information in XCOFF format. gxcoff+ -Common Driver JoinedOrMissing Negative(gcoff) +Common Driver JoinedOrMissing Negative(gdwarf) Generate debug information in extended XCOFF format. Enum diff --git a/gcc/defaults.h b/gcc/defaults.h index 99cd9db..768c987 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -894,14 +894,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DEFAULT_GDB_EXTENSIONS 1 #endif -#ifndef SDB_DEBUGGING_INFO -#define SDB_DEBUGGING_INFO 0 -#endif - /* If more than one debugging type is supported, you must define PREFERRED_DEBUGGING_TYPE to choose the default. */ -#if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \ +#if 1 < (defined (DBX_DEBUGGING_INFO) \ + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \ + defined (VMS_DEBUGGING_INFO)) #ifndef PREFERRED_DEBUGGING_TYPE @@ -913,9 +909,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #elif defined DBX_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG -#elif SDB_DEBUGGING_INFO -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG - #elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 81c95ec..ab66baf 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20938,12 +20938,12 @@ gen_array_type_die (tree type, dw_die_ref context_die) add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major); #if 0 - /* We default the array ordering. SDB will probably do - the right things even if DW_AT_ordering is not present. It's not even - an issue until we start to get into multidimensional arrays anyway. If - SDB is ever caught doing the Wrong Thing for multi-dimensional arrays, - then we'll have to put the DW_AT_ordering attribute back in. (But if - and when we find out that we need to put these in, we will only do so + /* We default the array ordering. Debuggers will probably do the right + things even if DW_AT_ordering is not present. It's not even an issue + until we start to get into multidimensional arrays anyway. If a debugger + is ever caught doing the Wrong Thing for multi-dimensional arrays, + then we'll have to put the DW_AT_ordering attribute back in. (But + if and when we find out that we need to put these in, we will only do so for multidimensional arrays. */ add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major); #endif diff --git a/gcc/flag-types.h b/gcc/flag-types.h index 2b23029..59
Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
On Wed, Oct 25, 2017 at 11:45 PM, Jim Wilson wrote: > This removes the -gcoff option, and various sdb related references in > non-target files. I also poison SDB_DEBUGGING_INFO and SDB_DEBUG. I > didn't see any point in poisoning the other SDB_* macros, as no one has > used any of them in a very long time. > > I noticed one odd thing from removing -gcoff, use of it or any other > unrecognized debug info type now gives an odd looking error message. > > palantir:2016$ gcc -gfoo -S tmp.c > cc1: error: unrecognised debug output level ‘foo’ > palantir:2017$ > > We probably should only emit this error when we have a number after -g, > and emit some other error when a non-number appears after -g, such as > "unrecognized debug info type 'foo'". This is a separate problem that > I haven't tried to fix here. You can eventually keep the option, marking it as Ignore (like we do for options we remove but "keep" for backward compatibility). The diagnostic (as warning, given the option will be just ignored) could be emited from option processing in opts.c then. Richard. > Jim > > gcc/ > * common.opt (gcoff): Delete. > (gxcoff+): Update Negative chain. > * defaults.h: Delete all references to SDB_DEBUGGING_INFO and > SDB_DEBUG. > * dwarf2out.c (gen_array_type_die): Change SDB to debuggers. > * flag-types.h (enum debug_info_type): Delete SDB_DEBUG. > * function.c (number_blocks): Delete SDB_DEBUGGING_INFO, SDB_DEBUG, > and SDB references. > (expand_function_start): Change sdb reference to past tense. > (expand_function_end): Change sdb reference to past tense. > * gcc.c (cpp_unique_options): Delete gcoff3 reference. > * opts.c (debug_type_names): Delete coff entry. > (common_handle_option): Delete OPT_gcoff case. > * system.h (SDB_DEBUG, SDB_DEBUGGING_INFO): Poison. > --- > gcc/common.opt | 6 +- > gcc/defaults.h | 9 + > gcc/dwarf2out.c | 12 ++-- > gcc/flag-types.h | 1 - > gcc/function.c | 10 +- > gcc/gcc.c| 2 +- > gcc/opts.c | 6 +- > gcc/system.h | 3 ++- > 8 files changed, 17 insertions(+), 32 deletions(-) > > diff --git a/gcc/common.opt b/gcc/common.opt > index 836f05b..25e86ec 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -2868,10 +2868,6 @@ g > Common Driver RejectNegative JoinedOrMissing > Generate debug information in default format. > > -gcoff > -Common Driver JoinedOrMissing Negative(gdwarf) > -Generate debug information in COFF format. > - > gcolumn-info > Common Driver Var(debug_column_info,1) Init(1) > Record DW_AT_decl_column and DW_AT_call_column in DWARF. > @@ -2937,7 +2933,7 @@ Common Driver JoinedOrMissing Negative(gxcoff+) > Generate debug information in XCOFF format. > > gxcoff+ > -Common Driver JoinedOrMissing Negative(gcoff) > +Common Driver JoinedOrMissing Negative(gdwarf) > Generate debug information in extended XCOFF format. > > Enum > diff --git a/gcc/defaults.h b/gcc/defaults.h > index 99cd9db..768c987 100644 > --- a/gcc/defaults.h > +++ b/gcc/defaults.h > @@ -894,14 +894,10 @@ see the files COPYING3 and COPYING.RUNTIME > respectively. If not, see > #define DEFAULT_GDB_EXTENSIONS 1 > #endif > > -#ifndef SDB_DEBUGGING_INFO > -#define SDB_DEBUGGING_INFO 0 > -#endif > - > /* If more than one debugging type is supported, you must define > PREFERRED_DEBUGGING_TYPE to choose the default. */ > > -#if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \ > +#if 1 < (defined (DBX_DEBUGGING_INFO) \ > + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \ > + defined (VMS_DEBUGGING_INFO)) > #ifndef PREFERRED_DEBUGGING_TYPE > @@ -913,9 +909,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. > If not, see > #elif defined DBX_DEBUGGING_INFO > #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG > > -#elif SDB_DEBUGGING_INFO > -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG > - > #elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO > #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG > > diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c > index 81c95ec..ab66baf 100644 > --- a/gcc/dwarf2out.c > +++ b/gcc/dwarf2out.c > @@ -20938,12 +20938,12 @@ gen_array_type_die (tree type, dw_die_ref > context_die) > add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major); > > #if 0 > - /* We default the array ordering. SDB will probably do > - the right things even if DW_AT_ordering is not present. It's not even > - an issue until we start to get into multidimensional arrays anyway. If > - SDB is ever caught doing the Wrong Thing for multi-dimensional arrays, > - then we'll have to put the DW_AT_ordering attribute back in. (But if > - and when we find out that we need to put these in, we will only do so > + /* We default the array ordering. Debuggers will probably do the right > + things even if DW_AT_o
Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
On Thu, 2017-10-26 at 11:38 +0200, Richard Biener wrote: > You can eventually keep the option, marking it as Ignore (like we do > for options we remove but "keep" for backward compatibility). The > diagnostic (as warning, given the option will be just ignored) could > be emited from option processing in opts.c then. I seriously doubt that anyone will miss the -gcoff option. The last bug report I can find is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9963 which was fixed in 2005. There is also a bug report from 2004 https://gcc.gnu.org/ml/gcc/2004-06/msg00708.html which suggests it should just be removed instead of fixed. I see Kai Tietz fixing some bugs in sdbout in 2014, but that is only because he was doing cygwin maintenance, and these problems turned up during testsuite debug torture testing. So it wasn't an end user problem. Also, in this thread, there are questions about why we don't just delete it instead. If we ignore the option, we can't have code in opts.c to emit a warning for it, but we can put a warning in the common.opt file. I tried this and ran into a minor problem which is that the code to check the debug level only works for options that exist. So I get palantir:2277$ ./xgcc -B./ -O -S -gcoff tmp.c xgcc: warning: switch ‘-gcoff’ no longer supported palantir:2278$ ./xgcc -B./ -O -S -gcoff3 tmp.c xgcc: warning: switch ‘-gcoff3’ no longer supported palantir:2279$ ./xgcc -B./ -O -S -gcofffoo tmp.c xgcc: warning: switch ‘-gcofffoo’ no longer supported palantir:2280$ The last one has never been a valid option. If we don't care about this, then the attached patch works. Otherwise I think I have to add 4 stanzas for the four valid options, -gcoff, -gcoff1, -gcoff2, and -gcoff3. I'd rather not do that. Or leave -gcoff in as a supported option and ignore it in opts.c, which I would also rather not do. I just want it gone. I can live with the ignored option. OK? Jim 2017-10-26 Jim Wilson gcc/ * common.opt (gcoff): Re-add as ignored option. diff --git a/gcc/common.opt b/gcc/common.opt index 25e86ec..c248d95 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2868,6 +2868,10 @@ g Common Driver RejectNegative JoinedOrMissing Generate debug information in default format. +gcoff +Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + gcolumn-info Common Driver Var(debug_column_info,1) Init(1) Record DW_AT_decl_column and DW_AT_call_column in DWARF.
Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
On Fri, Oct 27, 2017 at 12:12 AM, Jim Wilson wrote: > On Thu, 2017-10-26 at 11:38 +0200, Richard Biener wrote: >> You can eventually keep the option, marking it as Ignore (like we do >> for options we remove but "keep" for backward compatibility). The >> diagnostic (as warning, given the option will be just ignored) could >> be emited from option processing in opts.c then. > > I seriously doubt that anyone will miss the -gcoff option. The last > bug report I can find is > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9963 > which was fixed in 2005. There is also a bug report from 2004 > https://gcc.gnu.org/ml/gcc/2004-06/msg00708.html > which suggests it should just be removed instead of fixed. > > I see Kai Tietz fixing some bugs in sdbout in 2014, but that is only > because he was doing cygwin maintenance, and these problems turned up > during testsuite debug torture testing. So it wasn't an end user > problem. Also, in this thread, there are questions about why we don't > just delete it instead. > > If we ignore the option, we can't have code in opts.c to emit a warning > for it, but we can put a warning in the common.opt file. I tried this > and ran into a minor problem which is that the code to check the debug > level only works for options that exist. So I get > > palantir:2277$ ./xgcc -B./ -O -S -gcoff tmp.c > xgcc: warning: switch ‘-gcoff’ no longer supported > palantir:2278$ ./xgcc -B./ -O -S -gcoff3 tmp.c > xgcc: warning: switch ‘-gcoff3’ no longer supported > palantir:2279$ ./xgcc -B./ -O -S -gcofffoo tmp.c > xgcc: warning: switch ‘-gcofffoo’ no longer supported > palantir:2280$ > > The last one has never been a valid option. If we don't care about > this, then the attached patch works. > > Otherwise I think I have to add 4 stanzas for the four valid options, > -gcoff, -gcoff1, -gcoff2, and -gcoff3. I'd rather not do that. Or > leave -gcoff in as a supported option and ignore it in opts.c, which I > would also rather not do. I just want it gone. I can live with the > ignored option. > > OK? Does gcoff Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer supported) Does nothing. Preserved for backward compatibility. gcoff1 Common Driver Alias(gcoff) gcoff2 Common Driver Alias(gcoff) gcoff3 Common Driver Alias(gcoff) work to that effect? Not sure if we really should care ;) I'm ok with your patch as approved or the Alias variant if it avoids the odd warnings for options that never existed and you're fine with the reduced duplication. Thanks, Richard. > Jim > > 2017-10-26 Jim Wilson > > gcc/ > * common.opt (gcoff): Re-add as ignored option. > > diff --git a/gcc/common.opt b/gcc/common.opt > index 25e86ec..c248d95 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -2868,6 +2868,10 @@ g > Common Driver RejectNegative JoinedOrMissing > Generate debug information in default format. > > +gcoff > +Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer supported) > +Does nothing. Preserved for backward compatibility. > + > gcolumn-info > Common Driver Var(debug_column_info,1) Init(1) > Record DW_AT_decl_column and DW_AT_call_column in DWARF. >
Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
On Fri, 2017-10-27 at 10:45 +0200, Richard Biener wrote: > Does > > gcoff > Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer > supported) > Does nothing. Preserved for backward compatibility. > > gcoff1 > Common Driver Alias(gcoff) > > gcoff2 > Common Driver Alias(gcoff) > > gcoff3 > Common Driver Alias(gcoff) > > work to that effect? Not sure if we really should care ;) > > I'm ok with your patch as approved or the Alias variant if it > avoids the odd warnings for options that never existed > and you're fine with the reduced duplication. This doesn't work, because you can't have an alias to an ignored option. The alias support uses an OPT_x enum value to point back to the other option, and there is no OPT_x enum value created for ignored options. This does work if I duplicate the gcoff entry 4 times for the 4 options, without the JoinedOrMissing, which is unnecessary if we explicitly list them all. This seems to be the only easy way to get the exact result we need, and doesn't look too bad, so this is what I checked in. Jim 2017-10-29 Jim Wilson gcc/ * common.opt (gcoff): Re-add as ignored option. (gcoff1, gcoff2, gcoff3): Likewise. diff --git a/gcc/common.opt b/gcc/common.opt index 25e86ec..5cf270c 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2868,6 +2868,22 @@ g Common Driver RejectNegative JoinedOrMissing Generate debug information in default format. +gcoff +Common Driver Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + +gcoff1 +Common Driver Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + +gcoff2 +Common Driver Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + +gcoff3 +Common Driver Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + gcolumn-info Common Driver Var(debug_column_info,1) Init(1) Record DW_AT_decl_column and DW_AT_call_column in DWARF.