From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82748 invoked by alias); 3 Dec 2017 04:17:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 82730 invoked by uid 89); 3 Dec 2017 04:17:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=14826 X-HELO: mail-ot0-f169.google.com Received: from mail-ot0-f169.google.com (HELO mail-ot0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 03 Dec 2017 04:17:25 +0000 Received: by mail-ot0-f169.google.com with SMTP id i1so12167640oth.9 for ; Sat, 02 Dec 2017 20:17:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LH4q2njRP7ovjb26Klp+sOPvjD6bFO8eE+ZgZpp5E0w=; b=ecMUpGmnpvZGqgM1fpxUvVRv6xghzdUYNYMR5DEvnUZkwZ4G3EDIh3Wi6DNJT2ZZLU G7/ptrE1pmxSE5LL4UJK1eAEnKoWg7Q1UCfyf5UQwoOG5+PTo3+44Wk/KTn3xvfGI/A9 tXFWkHQgbwI9OmwCBM3QlX4qNvZilnzoOdjiMoaaDfJG1etWRkMHaOlKxufaCRcJ/9J4 EOCLvoIh4On4GVrdMPOLklWZt4oe+lqT9jvk4mTRPRCZ2+DENZKx1Rn6VdTyuvGWmprm 3fF9vPPRGq3TGIWeCk0Up3X8mKmBWyR5PJmkyGf/By6QwSX3D86C4V6y4ukRnDlW67Be Q+kQ== X-Gm-Message-State: AJaThX7x5H/Poa34cvQ+U+5llUtkMUI084DS0pxCQ7omTUdlBC/hrMO6 2Pt3Cf5rhWYk9AYOppjr+f6JRWdO9uI= X-Google-Smtp-Source: AGs4zMYRzOR7TJbo5fO7hga85gznh402BtR3jAL21S1ufpLLCu6tleZrdT61ZE+xOgyTwCfDrbpfDQ== X-Received: by 10.157.14.56 with SMTP id c53mr13116830otc.81.1512274643405; Sat, 02 Dec 2017 20:17:23 -0800 (PST) Received: from rohan.attlocal.net ([2602:306:80a3:c890:95a6:9004:612d:8d4c]) by smtp.gmail.com with ESMTPSA id t124sm4294701oih.48.2017.12.02.20.17.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Dec 2017 20:17:22 -0800 (PST) From: Jim Wilson To: gcc-patches@gcc.gnu.org Cc: Jim Wilson Subject: [RFA, PATCH] Deprecate stabs if dwarf2 support available. Date: Sun, 03 Dec 2017 04:17:00 -0000 Message-Id: <20171203041719.11506-1-jimw@sifive.com> X-SW-Source: 2017-12/txt/msg00102.txt.bz2 This is based on an idea from Richard Biener that was mentioned here https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02376.html If we are interested in doing this, it would be accompanied by documentation changes to state that stabs is now deprecated in favor of dwarf2, release notes to announce the change, and a configure patch to deprecate --with-stabs. We will also need a patch for the debug torture testing in the testsuite to check for the new error. There may also be other things we need that I haven't noticed yet. I tried testing a number of targets that use stabs to see what would happen with this change. There are 3 targets that default to stabs, and -g continues to emit stabs with this patch: m68k-openbsd, pdp11, vax-openbsd. There are 3 targets that default to stabs, and -g now gives an error: avr-elf, i386-lynxos, powerpc-lynxos. avr includes elfos.h which defines DWARF2_DEBUGGING_INFO. We can temporarily fix avr by adding a #undef for that. I think i386-lynxos and powerpc-lynxos should switch to dwarf2, as both i386 and powerpc support dwarf2. But if necessary, we can temporarily fix them with the same change. There are 2 targets that emit dwarf2 by default, but emit stabs when the --with-stabs configure option is used: mn10300-elf, v850-elf. They continue to work fine by default, but -g fails if you use --with-stabs. The solution here is to add a configure patch to give an error when --with-stabs is used. And of course for the vast majority of targets, which support dwarf2 by default, -g works fine, and -gstabs now gives an error. There is also a configuration for cygwin, with an old non-dwarf assembler, that defaults to stabs, but that probably doesn't even build anymore. And there is also a configuration for pre-darwin9 that defaults to stabs, but that may not be buildable anymore either. This doesn't break AIX/XCOFF, as we aren't trying to remove any code at this time. It is possible that there might also be other targets affected by the change that I haven't noticed yet. I tried searching for all targets using stabs, but might have missed a few. Jim gcc/ * toplev.c (process_options): If DWARF2_DEBUGGING_INFO defined, and write_symbols set to DBX_DEBUG, give an error. --- gcc/toplev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/toplev.c b/gcc/toplev.c index 2f154960a17..f5cee35234e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1482,6 +1482,12 @@ process_options (void) "target system does not support the %qs debug format", debug_type_names[write_symbols]); +#if defined(DWARF2_DEBUGGING_INFO) + if (write_symbols == DBX_DEBUG) + error_at (UNKNOWN_LOCATION, + "DBX/stabs debugging info format is deprecated, use DWARF2 instead."); +#endif + /* We know which debug output will be used so we can set flag_var_tracking and flag_var_tracking_uninit if the user has not specified them. */ if (debug_info_level < DINFO_LEVEL_NORMAL -- 2.14.1