public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/stabs-removal)] WIP parts 1.
Date: Thu, 25 Aug 2022 06:53:40 +0000 (GMT)	[thread overview]
Message-ID: <20220825065340.AB7DB385356C@sourceware.org> (raw)

https://gcc.gnu.org/g:3b8f87feae73da80562ca7981c99378034774a86

commit 3b8f87feae73da80562ca7981c99378034774a86
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Aug 24 15:04:37 2022 +0200

    WIP parts 1.

Diff:
---
 gcc/common.opt   | 10 +---------
 gcc/final.cc     | 40 ----------------------------------------
 gcc/flag-types.h | 17 +++++++----------
 gcc/gcc.cc       | 24 +-----------------------
 gcc/opts.cc      | 10 +---------
 gcc/toplev.cc    |  9 ---------
 6 files changed, 10 insertions(+), 100 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index fba90ff6dcb..1e2dc144520 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3323,7 +3323,7 @@ Common Driver JoinedOrMissing Negative(gdwarf-)
 Generate debug information in default version of DWARF format.
 
 gdwarf-
-Common Driver Joined UInteger Var(dwarf_version) Init(5) Negative(gstabs)
+Common Driver Joined UInteger Var(dwarf_version) Init(5)
 Generate debug information in DWARF v2 (or later) format.
 
 gdwarf32
@@ -3370,14 +3370,6 @@ gsplit-dwarf
 Common Driver Var(dwarf_split_debug_info) Init(0)
 Generate debug information in separate .dwo files.
 
-gstabs
-Common Driver JoinedOrMissing Negative(gstabs+)
-Generate debug information in STABS format.
-
-gstabs+
-Common Driver JoinedOrMissing Negative(gvms)
-Generate debug information in extended STABS format.
-
 gstatement-frontiers
 Common Driver Var(debug_nonbind_markers_p) PerFunction
 Emit progressive recommended breakpoint locations.
diff --git a/gcc/final.cc b/gcc/final.cc
index 0352786e49b..f58a90c2833 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -89,10 +89,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "dwarf2out.h"
 
-#ifdef DBX_DEBUGGING_INFO
-#include "dbxout.h"
-#endif
-
 /* Most ports don't need to define CC_STATUS_INIT.
    So define a null default for it to save conditionalization later.  */
 #ifndef CC_STATUS_INIT
@@ -2324,19 +2320,6 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
 	      TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
 	      BLOCK_IN_COLD_SECTION_P (NOTE_BLOCK (insn)) = in_cold_section_p;
 	    }
-	  if (write_symbols == DBX_DEBUG)
-	    {
-	      location_t *locus_ptr
-		= block_nonartificial_location (NOTE_BLOCK (insn));
-
-	      if (locus_ptr != NULL)
-		{
-		  override_filename = LOCATION_FILE (*locus_ptr);
-		  override_linenum = LOCATION_LINE (*locus_ptr);
-		  override_columnnum = LOCATION_COLUMN (*locus_ptr);
-		  override_discriminator = compute_discriminator (*locus_ptr);
-		}
-	    }
 	  break;
 
 	case NOTE_INSN_BLOCK_END:
@@ -2359,27 +2342,6 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
 	      gcc_assert (BLOCK_IN_COLD_SECTION_P (NOTE_BLOCK (insn))
 			  == in_cold_section_p);
 	    }
-	  if (write_symbols == DBX_DEBUG)
-	    {
-	      tree outer_block = BLOCK_SUPERCONTEXT (NOTE_BLOCK (insn));
-	      location_t *locus_ptr
-		= block_nonartificial_location (outer_block);
-
-	      if (locus_ptr != NULL)
-		{
-		  override_filename = LOCATION_FILE (*locus_ptr);
-		  override_linenum = LOCATION_LINE (*locus_ptr);
-		  override_columnnum = LOCATION_COLUMN (*locus_ptr);
-		  override_discriminator = compute_discriminator (*locus_ptr);
-		}
-	      else
-		{
-		  override_filename = NULL;
-		  override_linenum = 0;
-		  override_columnnum = 0;
-		  override_discriminator = 0;
-		}
-	    }
 	  break;
 
 	case NOTE_INSN_DELETED_LABEL:
@@ -4304,8 +4266,6 @@ rest_of_handle_final (void)
   if (! quiet_flag)
     fflush (asm_out_file);
 
-  /* Write DBX symbols if requested.  */
-
   /* Note that for those inline functions where we don't initially
      know for certain that we will be generating an out-of-line copy,
      the first invocation of this routine (rest_of_compilation) will
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index a11f99af887..ceb84d9473f 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -24,20 +24,17 @@ along with GCC; see the file COPYING3.  If not see
 
 enum debug_info_type
 {
-  DINFO_TYPE_NONE = 0,		  /* No debug info.  */
-  DINFO_TYPE_DBX = 1,		  /* BSD .stabs for DBX.  */
-  DINFO_TYPE_DWARF2 = 2,	  /* Dwarf v2 debug info.  */
-  DINFO_TYPE_XCOFF = 3,		  /* IBM/Xcoff debug info.  */
-  DINFO_TYPE_VMS = 4,		  /* VMS debug info.  */
-  DINFO_TYPE_CTF = 5,		  /* CTF debug info.  */
-  DINFO_TYPE_BTF = 6,		  /* BTF debug info.  */
-  DINFO_TYPE_BTF_WITH_CORE = 7,	  /* BTF debug info with CO-RE relocations.  */
+  DINFO_TYPE_NONE,		  /* No debug info.  */
+  DINFO_TYPE_DWARF2,		  /* Dwarf v2 debug info.  */
+  DINFO_TYPE_XCOFF,		  /* IBM/Xcoff debug info.  */
+  DINFO_TYPE_VMS,		  /* VMS debug info.  */
+  DINFO_TYPE_CTF,		  /* CTF debug info.  */
+  DINFO_TYPE_BTF,		  /* BTF debug info.  */
+  DINFO_TYPE_BTF_WITH_CORE,	  /* BTF debug info with CO-RE relocations.  */
   DINFO_TYPE_MAX = DINFO_TYPE_BTF_WITH_CORE /* Marker only.  */
 };
 
 #define NO_DEBUG      (0U)
-/* Write DBX debug info (using dbxout.cc).  */
-#define DBX_DEBUG     (1U << DINFO_TYPE_DBX)
 /* Write DWARF2 debug info (using dwarf2out.cc).  */
 #define DWARF2_DEBUG  (1U << DINFO_TYPE_DWARF2)
 /* Write IBM/XCOFF debug info (using dbxout.cc).  */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index b6d562a92f0..c1f084bdf6b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -927,26 +927,11 @@ proper position among the other output files.  */
 # else
 #  define ASM_DEBUG_DWARF_OPTION "--gdwarf2"
 # endif
-# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \
-     && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
-#  define ASM_DEBUG_SPEC						\
-      (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG				\
-       ? "%{%:debug-level-gt(0):"					\
-	 "%{gdwarf*:" ASM_DEBUG_DWARF_OPTION "};"			\
-	 ":%{g*:--gstabs}}" ASM_MAP					\
-       : "%{%:debug-level-gt(0):"					\
-	 "%{gstabs*:--gstabs;"						\
-	 ":%{g*:" ASM_DEBUG_DWARF_OPTION "}}}" ASM_MAP)
-# else
-#  if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
-#   define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):--gstabs}}" ASM_MAP
-#  endif
 #  if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
 #   define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):" \
 	ASM_DEBUG_DWARF_OPTION "}}" ASM_MAP
 #  endif
 # endif
-#endif
 #ifndef ASM_DEBUG_SPEC
 # define ASM_DEBUG_SPEC ""
 #endif
@@ -960,14 +945,7 @@ proper position among the other output files.  */
 	"%:dwarf-version-gt(3):--gdwarf-4 ;"				\
 	"%:dwarf-version-gt(2):--gdwarf-3 ;"				\
 	":--gdwarf2 }"
-#  if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO)
-#  define ASM_DEBUG_OPTION_SPEC						\
-      (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG				\
-       ? "%{%:debug-level-gt(0):"					\
-	 "%{gdwarf*:" ASM_DEBUG_OPTION_DWARF_OPT "}}" 			\
-       : "%{%:debug-level-gt(0):"					\
-	 "%{!gstabs*:%{g*:" ASM_DEBUG_OPTION_DWARF_OPT "}}}")
-# elif defined(DWARF2_DEBUGGING_INFO)
+# if defined(DWARF2_DEBUGGING_INFO)
 #   define ASM_DEBUG_OPTION_SPEC "%{g*:%{%:debug-level-gt(0):" \
 	ASM_DEBUG_OPTION_DWARF_OPT "}}"
 #  endif
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 54e57f36755..ed61626a50f 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -53,7 +53,7 @@ const char *const debug_type_names[] =
 
 static uint32_t debug_type_masks[] =
 {
-  NO_DEBUG, DBX_DEBUG, DWARF2_DEBUG, XCOFF_DEBUG, VMS_DEBUG,
+  NO_DEBUG, DWARF2_DEBUG, XCOFF_DEBUG, VMS_DEBUG,
   CTF_DEBUG, BTF_DEBUG
 };
 
@@ -3145,12 +3145,6 @@ common_handle_option (struct gcc_options *opts,
       set_debug_level (NO_DEBUG, 2, arg, opts, opts_set, loc);
       break;
 
-    case OPT_gstabs:
-    case OPT_gstabs_:
-      set_debug_level (DBX_DEBUG, code == OPT_gstabs_, arg, opts, opts_set,
-		       loc);
-      break;
-
     case OPT_gvms:
       set_debug_level (VMS_DEBUG, false, arg, opts, opts_set, loc);
       break;
@@ -3378,8 +3372,6 @@ set_debug_level (uint32_t dinfo, int extended, const char *arg,
 		opts->x_write_symbols |= DWARF2_DEBUG;
 	      else
 		opts->x_write_symbols = DWARF2_DEBUG;
-#elif defined DBX_DEBUGGING_INFO
-	      opts->x_write_symbols = DBX_DEBUG;
 #endif
 	    }
 
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 61d234a9ef4..55fff0270e3 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -1417,17 +1417,8 @@ process_options (bool no_backend)
       && ctf_debug_info_level == CTFINFO_LEVEL_NONE)
     write_symbols = NO_DEBUG;
 
-  /* Warn if STABS debug gets enabled and is not the default.  */
-  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && (write_symbols & DBX_DEBUG))
-    warning (0, "STABS debugging information is obsolete and not "
-	     "supported anymore");
-
   if (write_symbols == NO_DEBUG)
     ;
-#if defined(DBX_DEBUGGING_INFO)
-  else if (write_symbols == DBX_DEBUG)
-    debug_hooks = &dbx_debug_hooks;
-#endif
 #if defined(XCOFF_DEBUGGING_INFO)
   else if (write_symbols == XCOFF_DEBUG)
     debug_hooks = &xcoff_debug_hooks;

             reply	other threads:[~2022-08-25  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  6:53 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-24 14:26 Martin Liska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220825065340.AB7DB385356C@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).