This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA, PATCH] Deprecate stabs if dwarf2 support available.


On Mon, Dec 4, 2017 at 2:38 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> Note that "deprecation" doesn't match up with giving an error when using.
> We should warn (or maybe just document deprecation) instead.

OK.  I can warn instead.  That makes a lot of things simpler for
gcc-8.  Nothing will be broken by the change, except for the debug
torture support in the gcc testsuite, which is easy enough to fix.

> Maybe we can add a DWARF2_ONLY_DEBUGGING_INFO or
> NO_DBX_DEBUGGING_INFO macro so targets can decide they do not
> want to support -gstabs and reject it this way?  I'm not sure if
> #undefing DBX_DEBUGGING_INFO for those targets would be enough to
> achieve this?  It seems clearly not.  Thus sth like

I think we have too many *_DEBUGGING_INFO macros already.  And some of
them are undocumented and/or incorrectly documented.  So I'd rather
not add more.  DWARF2_LINENO_DEBUGGING_INFO is undocumented.
XCOFF_DEBUGGING_INFO is incorrectly documented.  The docs say it emits
a stabs variant, but it is used in both dbxout.c and dwarf2out.c, so
it is also emitting a dwarf2 variant.

> +#ifndef DBX_DEBUGGING_INFO
> +      warning ("-gstabs is deprecated on this target");
> +
> +#endif

It is already the case that you can't emit stabs if DBX_DEBUGGING_INFO
is not defined.  So this patch would do nothing useful.

rohan:2017$ ./xgcc -B./ -gstabs tmp.c
cc1: error: target system does not support the ‘stabs’ debug format
rohan:2018$

> and/or ignore stabs and use -gdwarf -g1 when -gstabs is specified?

Except that we can't emit dwarf-2 unless DWARF2_DEBUGGING_INFO is
defined.  So that takes us back to my patch which checks for
DWARF2_DEBUGGING_INFO.  It just needs to emit a warning instead of an
error, and then force a switch to dwarf2.

That leaves open the question of what to do about targets that only
support stabs.  We could do nothing for now and continue to emit
stabs.  We could call inform() to emit the deprecation message, to
avoid breaking -Werror, and continue to emit stabs.  I think the
latter is more useful, so I will try that.

> So unless we want to remove any support for GCC 8 I'd suggest to document
> the deprecation in gcc-8/changes.html and emit a deprecation warning from
> the --with-stabs configure option.  Note that deprecating stabs means
> deprecating
> those targets (or just debugging on those?) that only support stabs.

No, I don't want to remove stabs support at this time.  I just want to
start nudging people in the right direction, to switch to dwarf2.  I
think avr is the only actively maintained target that depends on
stabs, and we can ask them to add dwarf support.  For the other
targets, we can just drop debugging support if people are still
interested in the target, or drop the target if no one is still
interested in it.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]