* [PATCH 00/13] Removal of SDB debug info support
@ 2017-10-25 21:28 Jim Wilson
2017-10-25 21:30 ` [PATCH 01/13] remove sdbout.h and associated code Jim Wilson
` (14 more replies)
0 siblings, 15 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:28 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
We have no targets that emit SDB debug info by default. We dropped all
of the SVR3 Unix and embedded COFF targets a while ago. The only
targets that are still able to emit SDB debug info are cygwin, mingw,
and msdosdjgpp.
I tried a cygwin build with sources modified to emit SDB by default, to
see if the support was still usable. I ran into multiple problems.
There is no SDB support for IMPORTED_DECL which was added in 2008. -
freorder-functions and -freorder-blocks-and-partition did not work and
had to be disabled. I hit a cgraph assert because sdbout.c uses
assemble_name on types, which fails if there is a function and type
with the same name. This also causes types to be added to the debug
info with prepended underscores which is wrong. I then ran into a
problem with the i386_pe_declare_function_type call from
i386_pe_file_end and gave up because I didn't see an easy workaround.
It seems clear that the SDB support is no longer usable, and probably
hasn't been for a while. This support should just be removed.
SDB is both a debug info format and an old Unix debugger. There were
some references to the debugger that I left in, changing to past tense,
as the comments are useful history to explain why the code was written
the was it was. Otherwise, I tried to eliminate all references to sdb
as a debug info format.
This patch series was tested with a C only cross compiler build for all
modified embedded targets, a default languages build for power aix,
i686 cygwin, and x86_64 linux. I also did gdb testsuite runs for
cygwin and linux. There were no regressions.
As a debug info maintainer, I can self approve some of this stuff,
would be would be good to get a review from one of the other global
reviewers, and/or target maintainers.
Jim
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 01/13] remove sdbout.h and associated code
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
@ 2017-10-25 21:30 ` Jim Wilson
2017-10-25 22:46 ` Jim Wilson
2017-10-25 21:31 ` [PATCH 02/13] fix sdbout.c references in xcoffout.c Jim Wilson
` (13 subsequent siblings)
14 siblings, 1 reply; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:30 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 87 bytes --]
This just removes the header file and references to symbols defined in
that file.
Jim
[-- Attachment #2: 0001-Remove-sdbout.h-includes-and-associated-code.txt --]
[-- Type: text/plain, Size: 3868 bytes --]
gcc/
* debug.h: Delete sdb_debug_hooks.
* final.c: Delete sdbout.h include.
(final_scan_insn): Delete SDB_DEBUG check.
(rest_of_clean_state): Likewise.
* output.h: Delete sdb_begin_function_line.
* toplev.c: Delete sdbout.h include.
(process_options): Delete SDB_DEBUG check.
---
gcc/debug.h | 1 -
gcc/final.c | 14 ++------------
gcc/output.h | 5 -----
gcc/toplev.c | 4 ----
4 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/gcc/debug.h b/gcc/debug.h
index 915420b..19b2784 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -228,7 +228,6 @@ extern void debug_nothing_tree_charstar_uhwi (tree, const char *,
/* Hooks for various debug formats. */
extern const struct gcc_debug_hooks do_nothing_debug_hooks;
extern const struct gcc_debug_hooks dbx_debug_hooks;
-extern const struct gcc_debug_hooks sdb_debug_hooks;
extern const struct gcc_debug_hooks xcoff_debug_hooks;
extern const struct gcc_debug_hooks dwarf2_debug_hooks;
extern const struct gcc_debug_hooks dwarf2_lineno_debug_hooks;
diff --git a/gcc/final.c b/gcc/final.c
index 0ddf779..840931b 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -92,8 +92,6 @@ along with GCC; see the file COPYING3. If not see
#include "dbxout.h"
#endif
-#include "sdbout.h"
-
/* Most ports that aren't using cc0 don't need to define CC_STATUS_INIT.
So define a null default for it to save conditionalization later. */
#ifndef CC_STATUS_INIT
@@ -2328,8 +2326,7 @@ final_scan_insn (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
- || write_symbols == SDB_DEBUG)
+ if (write_symbols == DBX_DEBUG)
{
location_t *locus_ptr
= block_nonartificial_location (NOTE_BLOCK (insn));
@@ -2363,8 +2360,7 @@ final_scan_insn (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
- || write_symbols == SDB_DEBUG)
+ if (write_symbols == DBX_DEBUG)
{
tree outer_block = BLOCK_SUPERCONTEXT (NOTE_BLOCK (insn));
location_t *locus_ptr
@@ -4684,12 +4680,6 @@ rest_of_clean_state (void)
}
}
- /* In case the function was not output,
- don't leave any temporary anonymous types
- queued up for sdb output. */
- if (SDB_DEBUGGING_INFO && write_symbols == SDB_DEBUG)
- sdbout_types (NULL_TREE);
-
flag_rerun_cse_after_global_opts = 0;
reload_completed = 0;
epilogue_completed = 0;
diff --git a/gcc/output.h b/gcc/output.h
index e98a911..ede4447 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -308,11 +308,6 @@ extern void output_quoted_string (FILE *, const char *);
This variable is defined in final.c. */
extern rtx_sequence *final_sequence;
-/* The line number of the beginning of the current function. Various
- md code needs this so that it can output relative linenumbers. */
-
-extern int sdb_begin_function_line;
-
/* File in which assembler code is being written. */
#ifdef BUFSIZ
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 8c45e1d..81a7cf6 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -88,8 +88,6 @@ along with GCC; see the file COPYING3. If not see
#include "dbxout.h"
#endif
-#include "sdbout.h"
-
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data declarations. */
#endif
@@ -1467,8 +1465,6 @@ process_options (void)
else if (write_symbols == XCOFF_DEBUG)
debug_hooks = &xcoff_debug_hooks;
#endif
- else if (SDB_DEBUGGING_INFO && write_symbols == SDB_DEBUG)
- debug_hooks = &sdb_debug_hooks;
#ifdef DWARF2_DEBUGGING_INFO
else if (write_symbols == DWARF2_DEBUG)
debug_hooks = &dwarf2_debug_hooks;
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 02/13] fix sdbout.c references in xcoffout.c
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
2017-10-25 21:30 ` [PATCH 01/13] remove sdbout.h and associated code Jim Wilson
@ 2017-10-25 21:31 ` Jim Wilson
2017-10-25 21:36 ` [PATCH 04/13] Delete the sdbout files Jim Wilson
` (12 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:31 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 137 bytes --]
This changes some sdbout.c file references to past tense, since they
are still useful to explain why the code was written this way.
Jim
[-- Attachment #2: Type: text/plain, Size: 1241 bytes --]
gcc/
* xcoffout.c: Refer to former sdbout.c file.
(xcoffout_begin_prologue): Use past tense for sdbout.c reference.
---
gcc/xcoffout.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 17b201a..cf2064d 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
/* Output xcoff-format symbol table data. The main functionality is contained
in dbxout.c. This file implements the sdbout-like parts of the xcoff
interface. Many functions are very similar to their counterparts in
- sdbout.c. */
+ the former sdbout.c file. */
#include "config.h"
#include "system.h"
@@ -452,7 +452,7 @@ xcoffout_begin_prologue (unsigned int line,
ASM_OUTPUT_LFB (asm_out_file, line);
dbxout_parms (DECL_ARGUMENTS (current_function_decl));
- /* Emit the symbols for the outermost BLOCK's variables. sdbout.c does this
+ /* Emit the symbols for the outermost BLOCK's variables. sdbout.c did this
in sdbout_begin_block, but there is no guarantee that there will be any
inner block 1, so we must do it here. This gives a result similar to
dbxout, so it does make some sense. */
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 04/13] Delete the sdbout files
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
2017-10-25 21:30 ` [PATCH 01/13] remove sdbout.h and associated code Jim Wilson
2017-10-25 21:31 ` [PATCH 02/13] fix sdbout.c references in xcoffout.c Jim Wilson
@ 2017-10-25 21:36 ` Jim Wilson
2017-10-25 21:36 ` [PATCH 03/13] drop TYPE_SYMTAB_POINTER Jim Wilson
` (11 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:36 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 57 bytes --]
This patch deletes the sdbout.c and sdbout.h files.
Jim
[-- Attachment #2: Type: text/plain, Size: 52772 bytes --]
gcc/
* Makefile.in (OBJS): Delete sdbout.o.
(GTFILES): Delete $(srcdir)/sdbout.c.
* sdbout.c: Delete.
* sdbout.h: Delete.
---
gcc/Makefile.in | 3 +-
gcc/sdbout.c | 1661 -------------------------------------------------------
gcc/sdbout.h | 26 -
3 files changed, 1 insertion(+), 1689 deletions(-)
delete mode 100644 gcc/sdbout.c
delete mode 100644 gcc/sdbout.h
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 2809619..9b4cedf 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1446,7 +1446,6 @@ OBJS = \
sched-deps.o \
sched-ebb.o \
sched-rgn.o \
- sdbout.o \
sel-sched-ir.o \
sel-sched-dump.o \
sel-sched.o \
@@ -2525,7 +2524,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/lists.c $(srcdir)/optabs-libfuncs.c \
$(srcdir)/profile.c $(srcdir)/mcf.c \
$(srcdir)/reg-stack.c $(srcdir)/cfgrtl.c \
- $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
+ $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(srcdir)/gimple.h \
$(srcdir)/gimple-ssa.h \
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
deleted file mode 100644
index acd25a3..0000000
--- a/gcc/sdbout.c
+++ /dev/null
@@ -1,1661 +0,0 @@
-/* Output sdb-format symbol table information from GNU compiler.
- Copyright (C) 1988-2017 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-/* mike@tredysvr.Tredydev.Unisys.COM says:
-I modified the struct.c example and have a nm of a .o resulting from the
-AT&T C compiler. From the example below I would conclude the following:
-
-1. All .defs from structures are emitted as scanned. The example below
- clearly shows the symbol table entries for BoxRec2 are after the first
- function.
-
-2. All functions and their locals (including statics) are emitted as scanned.
-
-3. All nested unnamed union and structure .defs must be emitted before
- the structure in which they are nested. The AT&T assembler is a
- one pass beast as far as symbolics are concerned.
-
-4. All structure .defs are emitted before the typedefs that refer to them.
-
-5. All top level static and external variable definitions are moved to the
- end of file with all top level statics occurring first before externs.
-
-6. All undefined references are at the end of the file.
-*/
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "gsyms.h"
-#include "tm.h"
-#include "debug.h"
-#include "tree.h"
-#include "varasm.h"
-#include "stor-layout.h"
-
-static GTY(()) tree anonymous_types;
-
-/* Counter to generate unique "names" for nameless struct members. */
-
-static GTY(()) int unnamed_struct_number;
-
-/* Declarations whose debug info was deferred till end of compilation. */
-
-static GTY(()) vec<tree, va_gc> *deferred_global_decls;
-
-/* The C front end may call sdbout_symbol before sdbout_init runs.
- We save all such decls in this list and output them when we get
- to sdbout_init. */
-
-static GTY(()) tree preinit_symbols;
-static GTY(()) bool sdbout_initialized;
-
-#include "rtl.h"
-#include "regs.h"
-#include "function.h"
-#include "memmodel.h"
-#include "emit-rtl.h"
-#include "flags.h"
-#include "insn-config.h"
-#include "reload.h"
-#include "output.h"
-#include "diagnostic-core.h"
-#include "tm_p.h"
-#include "langhooks.h"
-#include "target.h"
-
-/* 1 if PARM is passed to this function in memory. */
-
-#define PARM_PASSED_IN_MEMORY(PARM) \
- (MEM_P (DECL_INCOMING_RTL (PARM)))
-
-/* A C expression for the integer offset value of an automatic variable
- (C_AUTO) having address X (an RTX). */
-#ifndef DEBUGGER_AUTO_OFFSET
-#define DEBUGGER_AUTO_OFFSET(X) \
- (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
-#endif
-
-/* A C expression for the integer offset value of an argument (C_ARG)
- having address X (an RTX). The nominal offset is OFFSET. */
-#ifndef DEBUGGER_ARG_OFFSET
-#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET)
-#endif
-
-/* Line number of beginning of current function, minus one.
- Negative means not in a function or not using sdb. */
-
-int sdb_begin_function_line = -1;
-
-
-extern FILE *asm_out_file;
-
-extern tree current_function_decl;
-
-#include "sdbout.h"
-
-static void sdbout_init (const char *);
-static void sdbout_finish (const char *);
-static void sdbout_start_source_file (unsigned int, const char *);
-static void sdbout_end_source_file (unsigned int);
-static void sdbout_begin_block (unsigned int, unsigned int);
-static void sdbout_end_block (unsigned int, unsigned int);
-static void sdbout_source_line (unsigned int, unsigned int,
- const char *, int, bool);
-static void sdbout_end_epilogue (unsigned int, const char *);
-static void sdbout_early_global_decl (tree);
-static void sdbout_late_global_decl (tree);
-static void sdbout_begin_prologue (unsigned int, unsigned int,
- const char *);
-static void sdbout_end_prologue (unsigned int, const char *);
-static void sdbout_begin_function (tree);
-static void sdbout_end_function (unsigned int);
-static void sdbout_toplevel_data (tree);
-static void sdbout_label (rtx_code_label *);
-static char *gen_fake_label (void);
-static int plain_type (tree);
-static int template_name_p (tree);
-static void sdbout_record_type_name (tree);
-static int plain_type_1 (tree, int);
-static void sdbout_block (tree);
-static void sdbout_syms (tree);
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
-static void sdbout_queue_anonymous_type (tree);
-static void sdbout_dequeue_anonymous_types (void);
-#endif
-static void sdbout_type (tree);
-static void sdbout_field_types (tree);
-static void sdbout_one_type (tree);
-static void sdbout_parms (tree);
-static void sdbout_reg_parms (tree);
-
-/* Random macros describing parts of SDB data. */
-
-/* Default value of delimiter is ";". */
-#ifndef SDB_DELIM
-#define SDB_DELIM ";"
-#endif
-
-/* Maximum number of dimensions the assembler will allow. */
-#ifndef SDB_MAX_DIM
-#define SDB_MAX_DIM 4
-#endif
-
-#ifndef PUT_SDB_SCL
-#define PUT_SDB_SCL(a) fprintf (asm_out_file, "\t.scl\t%d%s", (a), SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_INT_VAL
-#define PUT_SDB_INT_VAL(a) \
- do { \
- fprintf (asm_out_file, "\t.val\t" HOST_WIDE_INT_PRINT_DEC "%s", \
- (HOST_WIDE_INT) (a), SDB_DELIM); \
- } while (0)
-
-#endif
-
-#ifndef PUT_SDB_VAL
-#define PUT_SDB_VAL(a) \
-( fputs ("\t.val\t", asm_out_file), \
- output_addr_const (asm_out_file, (a)), \
- fprintf (asm_out_file, SDB_DELIM))
-#endif
-
-#ifndef PUT_SDB_DEF
-#define PUT_SDB_DEF(a) \
-do { fprintf (asm_out_file, "\t.def\t"); \
- assemble_name (asm_out_file, a); \
- fprintf (asm_out_file, SDB_DELIM); } while (0)
-#endif
-
-#ifndef PUT_SDB_PLAIN_DEF
-#define PUT_SDB_PLAIN_DEF(a) \
- fprintf (asm_out_file, "\t.def\t.%s%s", a, SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_ENDEF
-#define PUT_SDB_ENDEF fputs ("\t.endef\n", asm_out_file)
-#endif
-
-#ifndef PUT_SDB_TYPE
-#define PUT_SDB_TYPE(a) fprintf (asm_out_file, "\t.type\t0%o%s", a, SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_SIZE
-#define PUT_SDB_SIZE(a) \
- do { \
- fprintf (asm_out_file, "\t.size\t" HOST_WIDE_INT_PRINT_DEC "%s", \
- (HOST_WIDE_INT) (a), SDB_DELIM); \
- } while (0)
-#endif
-
-#ifndef PUT_SDB_START_DIM
-#define PUT_SDB_START_DIM fprintf (asm_out_file, "\t.dim\t")
-#endif
-
-#ifndef PUT_SDB_NEXT_DIM
-#define PUT_SDB_NEXT_DIM(a) fprintf (asm_out_file, "%d,", a)
-#endif
-
-#ifndef PUT_SDB_LAST_DIM
-#define PUT_SDB_LAST_DIM(a) fprintf (asm_out_file, "%d%s", a, SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_TAG
-#define PUT_SDB_TAG(a) \
-do { fprintf (asm_out_file, "\t.tag\t"); \
- assemble_name (asm_out_file, a); \
- fprintf (asm_out_file, SDB_DELIM); } while (0)
-#endif
-
-#ifndef PUT_SDB_BLOCK_START
-#define PUT_SDB_BLOCK_START(LINE) \
- fprintf (asm_out_file, \
- "\t.def\t.bb%s\t.val\t.%s\t.scl\t100%s\t.line\t%d%s\t.endef\n", \
- SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_BLOCK_END
-#define PUT_SDB_BLOCK_END(LINE) \
- fprintf (asm_out_file, \
- "\t.def\t.eb%s\t.val\t.%s\t.scl\t100%s\t.line\t%d%s\t.endef\n", \
- SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_FUNCTION_START
-#define PUT_SDB_FUNCTION_START(LINE) \
- fprintf (asm_out_file, \
- "\t.def\t.bf%s\t.val\t.%s\t.scl\t101%s\t.line\t%d%s\t.endef\n", \
- SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
-#endif
-
-#ifndef PUT_SDB_FUNCTION_END
-#define PUT_SDB_FUNCTION_END(LINE) \
- fprintf (asm_out_file, \
- "\t.def\t.ef%s\t.val\t.%s\t.scl\t101%s\t.line\t%d%s\t.endef\n", \
- SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
-#endif
-
-/* Return the sdb tag identifier string for TYPE
- if TYPE has already been defined; otherwise return a null pointer. */
-
-#define KNOWN_TYPE_TAG(type) TYPE_SYMTAB_POINTER (type)
-
-/* Set the sdb tag identifier string for TYPE to NAME. */
-
-#define SET_KNOWN_TYPE_TAG(TYPE, NAME) \
- TYPE_SYMTAB_POINTER (TYPE) = (const char *)(NAME)
-
-/* Return the name (a string) of the struct, union or enum tag
- described by the TREE_LIST node LINK. This is 0 for an anonymous one. */
-
-#define TAG_NAME(link) \
- (((link) && TREE_PURPOSE ((link)) \
- && IDENTIFIER_POINTER (TREE_PURPOSE ((link)))) \
- ? IDENTIFIER_POINTER (TREE_PURPOSE ((link))) : (char *) 0)
-
-/* Ensure we don't output a negative line number. */
-#define MAKE_LINE_SAFE(line) \
- if ((int) line <= sdb_begin_function_line) \
- line = sdb_begin_function_line + 1
-
-/* The debug hooks structure. */
-const struct gcc_debug_hooks sdb_debug_hooks =
-{
- sdbout_init, /* init */
- sdbout_finish, /* finish */
- debug_nothing_charstar, /* early_finish */
- debug_nothing_void, /* assembly_start */
- debug_nothing_int_charstar, /* define */
- debug_nothing_int_charstar, /* undef */
- sdbout_start_source_file, /* start_source_file */
- sdbout_end_source_file, /* end_source_file */
- sdbout_begin_block, /* begin_block */
- sdbout_end_block, /* end_block */
- debug_true_const_tree, /* ignore_block */
- sdbout_source_line, /* source_line */
- sdbout_begin_prologue, /* begin_prologue */
- debug_nothing_int_charstar, /* end_prologue */
- debug_nothing_int_charstar, /* begin_epilogue */
- sdbout_end_epilogue, /* end_epilogue */
- sdbout_begin_function, /* begin_function */
- sdbout_end_function, /* end_function */
- debug_nothing_tree, /* register_main_translation_unit */
- debug_nothing_tree, /* function_decl */
- sdbout_early_global_decl, /* early_global_decl */
- sdbout_late_global_decl, /* late_global_decl */
- sdbout_symbol, /* type_decl */
- debug_nothing_tree_tree_tree_bool_bool,/* imported_module_or_decl */
- debug_false_tree_charstarstar_uhwistar,/* die_ref_for_decl */
- debug_nothing_tree_charstar_uhwi, /* register_external_die */
- debug_nothing_tree, /* deferred_inline_function */
- debug_nothing_tree, /* outlining_inline_function */
- sdbout_label, /* label */
- debug_nothing_int, /* handle_pch */
- debug_nothing_rtx_insn, /* var_location */
- debug_nothing_tree, /* size_function */
- debug_nothing_void, /* switch_text_section */
- debug_nothing_tree_tree, /* set_name */
- 0, /* start_end_main_source_file */
- TYPE_SYMTAB_IS_POINTER /* tree_type_symtab_field */
-};
-
-/* Return a unique string to name an anonymous type. */
-
-static char *
-gen_fake_label (void)
-{
- char label[10];
- char *labelstr;
- sprintf (label, ".%dfake", unnamed_struct_number);
- unnamed_struct_number++;
- labelstr = xstrdup (label);
- return labelstr;
-}
-
-/* Return the number which describes TYPE for SDB.
- For pointers, etc., this function is recursive.
- Each record, union or enumeral type must already have had a
- tag number output. */
-
-/* The number is given by d6d5d4d3d2d1bbbb
- where bbbb is 4 bit basic type, and di indicate one of notype,ptr,fn,array.
- Thus, char *foo () has bbbb=T_CHAR
- d1=D_FCN
- d2=D_PTR
- N_BTMASK= 017 1111 basic type field.
- N_TSHIFT= 2 derived type shift
- N_BTSHFT= 4 Basic type shift */
-
-/* Produce the number that describes a pointer, function or array type.
- PREV is the number describing the target, value or element type.
- DT_type describes how to transform that type. */
-#define PUSH_DERIVED_LEVEL(DT_type,PREV) \
- ((((PREV) & ~(int) N_BTMASK) << (int) N_TSHIFT) \
- | ((int) DT_type << (int) N_BTSHFT) \
- | ((PREV) & (int) N_BTMASK))
-
-/* Number of elements used in sdb_dims. */
-static int sdb_n_dims = 0;
-
-/* Table of array dimensions of current type. */
-static int sdb_dims[SDB_MAX_DIM];
-
-/* Size of outermost array currently being processed. */
-static int sdb_type_size = -1;
-
-static int
-plain_type (tree type)
-{
- int val = plain_type_1 (type, 0);
-
- /* If we have already saved up some array dimensions, print them now. */
- if (sdb_n_dims > 0)
- {
- int i;
- PUT_SDB_START_DIM;
- for (i = sdb_n_dims - 1; i > 0; i--)
- PUT_SDB_NEXT_DIM (sdb_dims[i]);
- PUT_SDB_LAST_DIM (sdb_dims[0]);
- sdb_n_dims = 0;
-
- sdb_type_size = int_size_in_bytes (type);
- /* Don't kill sdb if type is not laid out or has variable size. */
- if (sdb_type_size < 0)
- sdb_type_size = 0;
- }
- /* If we have computed the size of an array containing this type,
- print it now. */
- if (sdb_type_size >= 0)
- {
- PUT_SDB_SIZE (sdb_type_size);
- sdb_type_size = -1;
- }
- return val;
-}
-
-static int
-template_name_p (tree name)
-{
- const char *ptr = IDENTIFIER_POINTER (name);
- while (*ptr && *ptr != '<')
- ptr++;
-
- return *ptr != '\0';
-}
-
-static void
-sdbout_record_type_name (tree type)
-{
- const char *name = 0;
- int no_name;
-
- if (KNOWN_TYPE_TAG (type))
- return;
-
- if (TYPE_NAME (type) != 0)
- {
- tree t = 0;
-
- /* Find the IDENTIFIER_NODE for the type name. */
- if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
- t = TYPE_NAME (type);
- else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
- {
- t = DECL_NAME (TYPE_NAME (type));
- /* The DECL_NAME for templates includes "<>", which breaks
- most assemblers. Use its assembler name instead, which
- has been mangled into being safe. */
- if (t && template_name_p (t))
- t = DECL_ASSEMBLER_NAME (TYPE_NAME (type));
- }
-
- /* Now get the name as a string, or invent one. */
- if (t != NULL_TREE)
- name = IDENTIFIER_POINTER (t);
- }
-
- no_name = (name == 0 || *name == 0);
- if (no_name)
- name = gen_fake_label ();
-
- SET_KNOWN_TYPE_TAG (type, name);
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- if (no_name)
- sdbout_queue_anonymous_type (type);
-#endif
-}
-
-/* Return the .type value for type TYPE.
-
- LEVEL indicates how many levels deep we have recursed into the type.
- The SDB debug format can only represent 6 derived levels of types.
- After that, we must output inaccurate debug info. We deliberately
- stop before the 7th level, so that ADA recursive types will not give an
- infinite loop. */
-
-static int
-plain_type_1 (tree type, int level)
-{
- if (type == 0)
- type = void_type_node;
- else if (type == error_mark_node)
- type = integer_type_node;
- else
- type = TYPE_MAIN_VARIANT (type);
-
- switch (TREE_CODE (type))
- {
- case VOID_TYPE:
- case NULLPTR_TYPE:
- return T_VOID;
- case BOOLEAN_TYPE:
- case INTEGER_TYPE:
- {
- int size = int_size_in_bytes (type) * BITS_PER_UNIT;
-
- /* Carefully distinguish all the standard types of C,
- without messing up if the language is not C.
- Note that we check only for the names that contain spaces;
- other names might occur by coincidence in other languages. */
- if (TYPE_NAME (type) != 0
- && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (type)) != 0
- && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
- {
- const char *const name
- = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
-
- if (!strcmp (name, "char"))
- return T_CHAR;
- if (!strcmp (name, "unsigned char"))
- return T_UCHAR;
- if (!strcmp (name, "signed char"))
- return T_CHAR;
- if (!strcmp (name, "int"))
- return T_INT;
- if (!strcmp (name, "unsigned int"))
- return T_UINT;
- if (!strcmp (name, "short int"))
- return T_SHORT;
- if (!strcmp (name, "short unsigned int"))
- return T_USHORT;
- if (!strcmp (name, "long int"))
- return T_LONG;
- if (!strcmp (name, "long unsigned int"))
- return T_ULONG;
- }
-
- if (size == INT_TYPE_SIZE)
- return (TYPE_UNSIGNED (type) ? T_UINT : T_INT);
- if (size == CHAR_TYPE_SIZE)
- return (TYPE_UNSIGNED (type) ? T_UCHAR : T_CHAR);
- if (size == SHORT_TYPE_SIZE)
- return (TYPE_UNSIGNED (type) ? T_USHORT : T_SHORT);
- if (size == LONG_TYPE_SIZE)
- return (TYPE_UNSIGNED (type) ? T_ULONG : T_LONG);
- if (size == LONG_LONG_TYPE_SIZE) /* better than nothing */
- return (TYPE_UNSIGNED (type) ? T_ULONG : T_LONG);
- return 0;
- }
-
- case REAL_TYPE:
- {
- int precision = TYPE_PRECISION (type);
- if (precision == FLOAT_TYPE_SIZE)
- return T_FLOAT;
- if (precision == DOUBLE_TYPE_SIZE)
- return T_DOUBLE;
- if (precision == LONG_DOUBLE_TYPE_SIZE)
- return T_DOUBLE; /* better than nothing */
-
- return 0;
- }
-
- case ARRAY_TYPE:
- {
- int m;
- if (level >= 6)
- return T_VOID;
- else
- m = plain_type_1 (TREE_TYPE (type), level+1);
- if (sdb_n_dims < SDB_MAX_DIM)
- sdb_dims[sdb_n_dims++]
- = (TYPE_DOMAIN (type)
- && TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != 0
- && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
- && tree_fits_shwi_p (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
- && tree_fits_shwi_p (TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
- ? (tree_to_shwi (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
- - tree_to_shwi (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1)
- : 0);
-
- return PUSH_DERIVED_LEVEL (DT_ARY, m);
- }
-
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- case ENUMERAL_TYPE:
- {
- const char *tag;
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- sdbout_record_type_name (type);
-#endif
-#ifndef SDB_ALLOW_UNKNOWN_REFERENCES
- if ((TREE_ASM_WRITTEN (type) && KNOWN_TYPE_TAG (type) != 0)
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- || TYPE_MODE (type) != VOIDmode
-#endif
- )
-#endif
- {
- /* Output the referenced structure tag name
- only if the .def has already been finished.
- At least on 386, the Unix assembler
- cannot handle forward references to tags. */
- /* But the 88100, it requires them, sigh... */
- /* And the MIPS requires unknown refs as well... */
- tag = KNOWN_TYPE_TAG (type);
- PUT_SDB_TAG (tag);
- /* These 3 lines used to follow the close brace.
- However, a size of 0 without a tag implies a tag of 0,
- so if we don't know a tag, we can't mention the size. */
- sdb_type_size = int_size_in_bytes (type);
- if (sdb_type_size < 0)
- sdb_type_size = 0;
- }
- return ((TREE_CODE (type) == RECORD_TYPE) ? T_STRUCT
- : (TREE_CODE (type) == UNION_TYPE) ? T_UNION
- : (TREE_CODE (type) == QUAL_UNION_TYPE) ? T_UNION
- : T_ENUM);
- }
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- {
- int m;
- if (level >= 6)
- return T_VOID;
- else
- m = plain_type_1 (TREE_TYPE (type), level+1);
- return PUSH_DERIVED_LEVEL (DT_PTR, m);
- }
- case FUNCTION_TYPE:
- case METHOD_TYPE:
- {
- int m;
- if (level >= 6)
- return T_VOID;
- else
- m = plain_type_1 (TREE_TYPE (type), level+1);
- return PUSH_DERIVED_LEVEL (DT_FCN, m);
- }
- default:
- return 0;
- }
-}
-
-/* Output the symbols defined in block number DO_BLOCK.
-
- This function works by walking the tree structure of blocks,
- counting blocks until it finds the desired block. */
-
-static int do_block = 0;
-
-static void
-sdbout_block (tree block)
-{
- while (block)
- {
- /* Ignore blocks never expanded or otherwise marked as real. */
- if (TREE_USED (block))
- {
- /* When we reach the specified block, output its symbols. */
- if (BLOCK_NUMBER (block) == do_block)
- sdbout_syms (BLOCK_VARS (block));
-
- /* If we are past the specified block, stop the scan. */
- if (BLOCK_NUMBER (block) > do_block)
- return;
-
- /* Scan the blocks within this block. */
- sdbout_block (BLOCK_SUBBLOCKS (block));
- }
-
- block = BLOCK_CHAIN (block);
- }
-}
-
-/* Call sdbout_symbol on each decl in the chain SYMS. */
-
-static void
-sdbout_syms (tree syms)
-{
- while (syms)
- {
- if (TREE_CODE (syms) != LABEL_DECL)
- sdbout_symbol (syms, 1);
- syms = TREE_CHAIN (syms);
- }
-}
-
-/* Output SDB information for a symbol described by DECL.
- LOCAL is nonzero if the symbol is not file-scope. */
-
-void
-sdbout_symbol (tree decl, int local)
-{
- tree type = TREE_TYPE (decl);
- tree context = NULL_TREE;
- rtx value;
- int regno = -1;
- const char *name;
-
- /* If we are called before sdbout_init is run, just save the symbol
- for later. */
- if (!sdbout_initialized)
- {
- preinit_symbols = tree_cons (0, decl, preinit_symbols);
- return;
- }
-
- sdbout_one_type (type);
-
- switch (TREE_CODE (decl))
- {
- case CONST_DECL:
- /* Enum values are defined by defining the enum type. */
- return;
-
- case FUNCTION_DECL:
- /* Don't mention a nested function under its parent. */
- context = decl_function_context (decl);
- if (context == current_function_decl)
- return;
- /* Check DECL_INITIAL to distinguish declarations from definitions.
- Don't output debug info here for declarations; they will have
- a DECL_INITIAL value of 0. */
- if (! DECL_INITIAL (decl))
- return;
- if (!MEM_P (DECL_RTL (decl))
- || GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
- return;
- PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
- PUT_SDB_SCL (TREE_PUBLIC (decl) ? C_EXT : C_STAT);
- break;
-
- case TYPE_DECL:
- /* Done with tagged types. */
- if (DECL_NAME (decl) == 0)
- return;
- if (DECL_IGNORED_P (decl))
- return;
- /* Don't output intrinsic types. GAS chokes on SDB .def
- statements that contain identifiers with embedded spaces
- (eg "unsigned long"). */
- if (DECL_IS_BUILTIN (decl))
- return;
-
- /* Output typedef name. */
- if (template_name_p (DECL_NAME (decl)))
- PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- else
- PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl)));
- PUT_SDB_SCL (C_TPDEF);
- break;
-
- case PARM_DECL:
- /* Parm decls go in their own separate chains
- and are output by sdbout_reg_parms and sdbout_parms. */
- gcc_unreachable ();
-
- case VAR_DECL:
- /* Don't mention a variable that is external.
- Let the file that defines it describe it. */
- if (DECL_EXTERNAL (decl))
- return;
-
- /* Ignore __FUNCTION__, etc. */
- if (DECL_IGNORED_P (decl))
- return;
-
- /* If there was an error in the declaration, don't dump core
- if there is no RTL associated with the variable doesn't
- exist. */
- if (!DECL_RTL_SET_P (decl))
- return;
-
- value = DECL_RTL (decl);
-
- if (!is_global_var (decl))
- value = eliminate_regs (value, VOIDmode, NULL_RTX);
-
- SET_DECL_RTL (decl, value);
-#ifdef LEAF_REG_REMAP
- if (crtl->uses_only_leaf_regs)
- leaf_renumber_regs_insn (value);
-#endif
-
- /* Don't mention a variable at all
- if it was completely optimized into nothingness.
-
- If DECL was from an inline function, then its rtl
- is not identically the rtl that was used in this
- particular compilation. */
- if (REG_P (value))
- {
- regno = REGNO (value);
- if (regno >= FIRST_PSEUDO_REGISTER)
- return;
- }
- else if (GET_CODE (value) == SUBREG)
- {
- while (GET_CODE (value) == SUBREG)
- value = SUBREG_REG (value);
- if (REG_P (value))
- {
- if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
- return;
- }
- regno = REGNO (alter_subreg (&value, true));
- SET_DECL_RTL (decl, value);
- }
- /* Don't output anything if an auto variable
- gets RTL that is static.
- GAS version 2.2 can't handle such output. */
- else if (MEM_P (value) && CONSTANT_P (XEXP (value, 0))
- && ! TREE_STATIC (decl))
- return;
-
- /* Emit any structure, union, or enum type that has not been output.
- This occurs for tag-less structs (et al) used to declare variables
- within functions. */
- if (TREE_CODE (type) == ENUMERAL_TYPE
- || TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE)
- {
- if (COMPLETE_TYPE_P (type) /* not a forward reference */
- && KNOWN_TYPE_TAG (type) == 0) /* not yet declared */
- sdbout_one_type (type);
- }
-
- /* Defer SDB information for top-level initialized variables! */
- if (! local
- && MEM_P (value)
- && DECL_INITIAL (decl))
- return;
-
- /* C++ in 2.3 makes nameless symbols. That will be fixed later.
- For now, avoid crashing. */
- if (DECL_NAME (decl) == NULL_TREE)
- return;
-
- /* Record the name for, starting a symtab entry. */
- if (local)
- name = IDENTIFIER_POINTER (DECL_NAME (decl));
- else
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
- if (MEM_P (value)
- && GET_CODE (XEXP (value, 0)) == SYMBOL_REF)
- {
- PUT_SDB_DEF (name);
- if (TREE_PUBLIC (decl))
- {
- PUT_SDB_VAL (XEXP (value, 0));
- PUT_SDB_SCL (C_EXT);
- }
- else
- {
- PUT_SDB_VAL (XEXP (value, 0));
- PUT_SDB_SCL (C_STAT);
- }
- }
- else if (regno >= 0)
- {
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (regno));
- PUT_SDB_SCL (C_REG);
- }
- else if (MEM_P (value)
- && (MEM_P (XEXP (value, 0))
- || (REG_P (XEXP (value, 0))
- && REGNO (XEXP (value, 0)) != HARD_FRAME_POINTER_REGNUM
- && REGNO (XEXP (value, 0)) != STACK_POINTER_REGNUM)))
- /* If the value is indirect by memory or by a register
- that isn't the frame pointer
- then it means the object is variable-sized and address through
- that register or stack slot. COFF has no way to represent this
- so all we can do is output the variable as a pointer. */
- {
- PUT_SDB_DEF (name);
- if (REG_P (XEXP (value, 0)))
- {
- PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (XEXP (value, 0))));
- PUT_SDB_SCL (C_REG);
- }
- else
- {
- /* DECL_RTL looks like (MEM (MEM (PLUS (REG...)
- (CONST_INT...)))).
- We want the value of that CONST_INT. */
- /* Encore compiler hates a newline in a macro arg, it seems. */
- PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET
- (XEXP (XEXP (value, 0), 0)));
- PUT_SDB_SCL (C_AUTO);
- }
-
- /* Effectively do build_pointer_type, but don't cache this type,
- since it might be temporary whereas the type it points to
- might have been saved for inlining. */
- /* Don't use REFERENCE_TYPE because dbx can't handle that. */
- type = make_node (POINTER_TYPE);
- TREE_TYPE (type) = TREE_TYPE (decl);
- }
- else if (MEM_P (value)
- && ((GET_CODE (XEXP (value, 0)) == PLUS
- && REG_P (XEXP (XEXP (value, 0), 0))
- && CONST_INT_P (XEXP (XEXP (value, 0), 1)))
- /* This is for variables which are at offset zero from
- the frame pointer. This happens on the Alpha.
- Non-frame pointer registers are excluded above. */
- || (REG_P (XEXP (value, 0)))))
- {
- /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
- or (MEM (REG...)). We want the value of that CONST_INT
- or zero. */
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET (XEXP (value, 0)));
- PUT_SDB_SCL (C_AUTO);
- }
- else
- {
- /* It is something we don't know how to represent for SDB. */
- return;
- }
- break;
-
- default:
- break;
- }
- PUT_SDB_TYPE (plain_type (type));
- PUT_SDB_ENDEF;
-}
-
-/* Output SDB information for a top-level initialized variable
- that has been delayed. */
-
-static void
-sdbout_toplevel_data (tree decl)
-{
- tree type = TREE_TYPE (decl);
-
- if (DECL_IGNORED_P (decl))
- return;
-
- gcc_assert (VAR_P (decl));
- gcc_assert (MEM_P (DECL_RTL (decl)));
- gcc_assert (DECL_INITIAL (decl));
-
- PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
- if (TREE_PUBLIC (decl))
- {
- PUT_SDB_SCL (C_EXT);
- }
- else
- {
- PUT_SDB_SCL (C_STAT);
- }
- PUT_SDB_TYPE (plain_type (type));
- PUT_SDB_ENDEF;
-}
-
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
-
-/* Machinery to record and output anonymous types. */
-
-static void
-sdbout_queue_anonymous_type (tree type)
-{
- anonymous_types = tree_cons (NULL_TREE, type, anonymous_types);
-}
-
-static void
-sdbout_dequeue_anonymous_types (void)
-{
- tree types, link;
-
- while (anonymous_types)
- {
- types = nreverse (anonymous_types);
- anonymous_types = NULL_TREE;
-
- for (link = types; link; link = TREE_CHAIN (link))
- {
- tree type = TREE_VALUE (link);
-
- if (type && ! TREE_ASM_WRITTEN (type))
- sdbout_one_type (type);
- }
- }
-}
-
-#endif
-
-/* Given a chain of ..._TYPE nodes, all of which have names,
- output definitions of those names, as typedefs. */
-
-void
-sdbout_types (tree types)
-{
- tree link;
-
- for (link = types; link; link = TREE_CHAIN (link))
- sdbout_one_type (link);
-
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- sdbout_dequeue_anonymous_types ();
-#endif
-}
-
-static void
-sdbout_type (tree type)
-{
- if (type == error_mark_node)
- type = integer_type_node;
- PUT_SDB_TYPE (plain_type (type));
-}
-
-/* Output types of the fields of type TYPE, if they are structs.
-
- Formerly did not chase through pointer types, since that could be circular.
- They must come before TYPE, since forward refs are not allowed.
- Now james@bigtex.cactus.org says to try them. */
-
-static void
-sdbout_field_types (tree type)
-{
- tree tail;
-
- for (tail = TYPE_FIELDS (type); tail; tail = TREE_CHAIN (tail))
- /* This condition should match the one for emitting the actual
- members below. */
- if (TREE_CODE (tail) == FIELD_DECL
- && DECL_NAME (tail)
- && DECL_SIZE (tail)
- && tree_fits_uhwi_p (DECL_SIZE (tail))
- && tree_fits_shwi_p (bit_position (tail)))
- {
- if (POINTER_TYPE_P (TREE_TYPE (tail)))
- sdbout_one_type (TREE_TYPE (TREE_TYPE (tail)));
- else
- sdbout_one_type (TREE_TYPE (tail));
- }
-}
-
-/* Use this to put out the top level defined record and union types
- for later reference. If this is a struct with a name, then put that
- name out. Other unnamed structs will have .xxfake labels generated so
- that they may be referred to later.
- The label will be stored in the KNOWN_TYPE_TAG slot of a type.
- It may NOT be called recursively. */
-
-static void
-sdbout_one_type (tree type)
-{
- if (current_function_decl != NULL_TREE
- && DECL_SECTION_NAME (current_function_decl) != NULL)
- ; /* Don't change section amid function. */
- else
- switch_to_section (current_function_section ());
-
- switch (TREE_CODE (type))
- {
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- case ENUMERAL_TYPE:
- type = TYPE_MAIN_VARIANT (type);
- /* Don't output a type twice. */
- if (TREE_ASM_WRITTEN (type))
- /* James said test TREE_ASM_BEING_WRITTEN here. */
- return;
-
- /* Output nothing if type is not yet defined. */
- if (!COMPLETE_TYPE_P (type))
- return;
-
- TREE_ASM_WRITTEN (type) = 1;
-
- /* This is reputed to cause trouble with the following case,
- but perhaps checking TYPE_SIZE above will fix it. */
-
- /* Here is a testcase:
-
- struct foo {
- struct badstr *bbb;
- } forwardref;
-
- typedef struct intermediate {
- int aaaa;
- } intermediate_ref;
-
- typedef struct badstr {
- int ccccc;
- } badtype; */
-
- /* This change, which ought to make better output,
- used to make the COFF assembler unhappy.
- Changes involving KNOWN_TYPE_TAG may fix the problem. */
- /* Before really doing anything, output types we want to refer to. */
- /* Note that in version 1 the following two lines
- are not used if forward references are in use. */
- if (TREE_CODE (type) != ENUMERAL_TYPE)
- sdbout_field_types (type);
-
- /* Output a structure type. */
- {
- int size = int_size_in_bytes (type);
- int member_scl = 0;
- tree tem;
-
- /* Record the type tag, but not in its permanent place just yet. */
- sdbout_record_type_name (type);
-
- PUT_SDB_DEF (KNOWN_TYPE_TAG (type));
-
- switch (TREE_CODE (type))
- {
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- PUT_SDB_SCL (C_UNTAG);
- PUT_SDB_TYPE (T_UNION);
- member_scl = C_MOU;
- break;
-
- case RECORD_TYPE:
- PUT_SDB_SCL (C_STRTAG);
- PUT_SDB_TYPE (T_STRUCT);
- member_scl = C_MOS;
- break;
-
- case ENUMERAL_TYPE:
- PUT_SDB_SCL (C_ENTAG);
- PUT_SDB_TYPE (T_ENUM);
- member_scl = C_MOE;
- break;
-
- default:
- break;
- }
-
- PUT_SDB_SIZE (size);
- PUT_SDB_ENDEF;
-
- /* Print out the base class information with fields
- named after the types they hold. */
- /* This is only relevant to aggregate types. TYPE_BINFO is used
- for other purposes in an ENUMERAL_TYPE, so we must exclude that
- case. */
- if (TREE_CODE (type) != ENUMERAL_TYPE && TYPE_BINFO (type))
- {
- int i;
- tree binfo, child;
-
- for (binfo = TYPE_BINFO (type), i = 0;
- BINFO_BASE_ITERATE (binfo, i, child); i++)
- {
- tree child_type = BINFO_TYPE (child);
- tree child_type_name;
-
- if (TYPE_NAME (child_type) == 0)
- continue;
- if (TREE_CODE (TYPE_NAME (child_type)) == IDENTIFIER_NODE)
- child_type_name = TYPE_NAME (child_type);
- else if (TREE_CODE (TYPE_NAME (child_type)) == TYPE_DECL)
- {
- child_type_name = DECL_NAME (TYPE_NAME (child_type));
- if (child_type_name && template_name_p (child_type_name))
- child_type_name
- = DECL_ASSEMBLER_NAME (TYPE_NAME (child_type));
- }
- else
- continue;
-
- PUT_SDB_DEF (IDENTIFIER_POINTER (child_type_name));
- PUT_SDB_INT_VAL (tree_to_shwi (BINFO_OFFSET (child)));
- PUT_SDB_SCL (member_scl);
- sdbout_type (BINFO_TYPE (child));
- PUT_SDB_ENDEF;
- }
- }
-
- /* Output the individual fields. */
-
- if (TREE_CODE (type) == ENUMERAL_TYPE)
- {
- for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
- {
- tree value = TREE_VALUE (tem);
-
- if (TREE_CODE (value) == CONST_DECL)
- value = DECL_INITIAL (value);
-
- if (tree_fits_shwi_p (value))
- {
- PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
- PUT_SDB_INT_VAL (tree_to_shwi (value));
- PUT_SDB_SCL (C_MOE);
- PUT_SDB_TYPE (T_MOE);
- PUT_SDB_ENDEF;
- }
- }
- }
- else /* record or union type */
- for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
- /* Output the name, type, position (in bits), size (in bits)
- of each field. */
-
- /* Omit here the nameless fields that are used to skip bits.
- Also omit fields with variable size or position.
- Also omit non FIELD_DECL nodes that GNU C++ may put here. */
- if (TREE_CODE (tem) == FIELD_DECL
- && DECL_NAME (tem)
- && DECL_SIZE (tem)
- && tree_fits_uhwi_p (DECL_SIZE (tem))
- && tree_fits_shwi_p (bit_position (tem)))
- {
- const char *name;
-
- name = IDENTIFIER_POINTER (DECL_NAME (tem));
- PUT_SDB_DEF (name);
- if (DECL_BIT_FIELD_TYPE (tem))
- {
- PUT_SDB_INT_VAL (int_bit_position (tem));
- PUT_SDB_SCL (C_FIELD);
- sdbout_type (DECL_BIT_FIELD_TYPE (tem));
- PUT_SDB_SIZE (tree_to_uhwi (DECL_SIZE (tem)));
- }
- else
- {
- PUT_SDB_INT_VAL (int_bit_position (tem) / BITS_PER_UNIT);
- PUT_SDB_SCL (member_scl);
- sdbout_type (TREE_TYPE (tem));
- }
- PUT_SDB_ENDEF;
- }
- /* Output end of a structure,union, or enumeral definition. */
-
- PUT_SDB_PLAIN_DEF ("eos");
- PUT_SDB_INT_VAL (size);
- PUT_SDB_SCL (C_EOS);
- PUT_SDB_TAG (KNOWN_TYPE_TAG (type));
- PUT_SDB_SIZE (size);
- PUT_SDB_ENDEF;
- break;
- }
-
- default:
- break;
- }
-}
-
-/* The following two functions output definitions of function parameters.
- Each parameter gets a definition locating it in the parameter list.
- Each parameter that is a register variable gets a second definition
- locating it in the register.
-
- Printing or argument lists in gdb uses the definitions that
- locate in the parameter list. But reference to the variable in
- expressions uses preferentially the definition as a register. */
-
-/* Output definitions, referring to storage in the parmlist,
- of all the parms in PARMS, which is a chain of PARM_DECL nodes. */
-
-static void
-sdbout_parms (tree parms)
-{
- for (; parms; parms = TREE_CHAIN (parms))
- if (DECL_NAME (parms)
- && TREE_TYPE (parms) != error_mark_node
- && DECL_RTL_SET_P (parms)
- && DECL_INCOMING_RTL (parms))
- {
- int current_sym_value = 0;
- const char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
-
- if (name == 0 || *name == 0)
- name = gen_fake_label ();
-
- /* Perform any necessary register eliminations on the parameter's rtl,
- so that the debugging output will be accurate. */
- DECL_INCOMING_RTL (parms)
- = eliminate_regs (DECL_INCOMING_RTL (parms), VOIDmode, NULL_RTX);
- SET_DECL_RTL (parms,
- eliminate_regs (DECL_RTL (parms), VOIDmode, NULL_RTX));
-
- if (PARM_PASSED_IN_MEMORY (parms))
- {
- rtx addr = XEXP (DECL_INCOMING_RTL (parms), 0);
- tree type;
-
- /* ??? Here we assume that the parm address is indexed
- off the frame pointer or arg pointer.
- If that is not true, we produce meaningless results,
- but do not crash. */
- if (GET_CODE (addr) == PLUS
- && CONST_INT_P (XEXP (addr, 1)))
- current_sym_value = INTVAL (XEXP (addr, 1));
- else
- current_sym_value = 0;
-
- if (REG_P (DECL_RTL (parms))
- && REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
- type = DECL_ARG_TYPE (parms);
- else
- {
- int original_sym_value = current_sym_value;
-
- /* This is the case where the parm is passed as an int or
- double and it is converted to a char, short or float
- and stored back in the parmlist. In this case, describe
- the parm with the variable's declared type, and adjust
- the address if the least significant bytes (which we are
- using) are not the first ones. */
- scalar_mode from_mode, to_mode;
- if (BYTES_BIG_ENDIAN
- && TREE_TYPE (parms) != DECL_ARG_TYPE (parms)
- && is_a <scalar_mode> (TYPE_MODE (DECL_ARG_TYPE (parms)),
- &from_mode)
- && is_a <scalar_mode> (GET_MODE (DECL_RTL (parms)),
- &to_mode))
- current_sym_value += (GET_MODE_SIZE (from_mode)
- - GET_MODE_SIZE (to_mode));
-
- if (MEM_P (DECL_RTL (parms))
- && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
- && (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1))
- == CONST_INT)
- && (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1))
- == current_sym_value))
- type = TREE_TYPE (parms);
- else
- {
- current_sym_value = original_sym_value;
- type = DECL_ARG_TYPE (parms);
- }
- }
-
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DEBUGGER_ARG_OFFSET (current_sym_value, addr));
- PUT_SDB_SCL (C_ARG);
- PUT_SDB_TYPE (plain_type (type));
- PUT_SDB_ENDEF;
- }
- else if (REG_P (DECL_RTL (parms)))
- {
- rtx best_rtl;
- /* Parm passed in registers and lives in registers or nowhere. */
-
- /* If parm lives in a register, use that register;
- pretend the parm was passed there. It would be more consistent
- to describe the register where the parm was passed,
- but in practice that register usually holds something else. */
- if (REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
- best_rtl = DECL_RTL (parms);
- /* If the parm lives nowhere,
- use the register where it was passed. */
- else
- best_rtl = DECL_INCOMING_RTL (parms);
-
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (best_rtl)));
- PUT_SDB_SCL (C_REGPARM);
- PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
- PUT_SDB_ENDEF;
- }
- else if (MEM_P (DECL_RTL (parms))
- && XEXP (DECL_RTL (parms), 0) != const0_rtx)
- {
- /* Parm was passed in registers but lives on the stack. */
-
- /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
- in which case we want the value of that CONST_INT,
- or (MEM (REG ...)) or (MEM (MEM ...)),
- in which case we use a value of zero. */
- if (REG_P (XEXP (DECL_RTL (parms), 0))
- || MEM_P (XEXP (DECL_RTL (parms), 0)))
- current_sym_value = 0;
- else
- current_sym_value = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
-
- /* Again, this assumes the offset is based on the arg pointer. */
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DEBUGGER_ARG_OFFSET (current_sym_value,
- XEXP (DECL_RTL (parms), 0)));
- PUT_SDB_SCL (C_ARG);
- PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
- PUT_SDB_ENDEF;
- }
- }
-}
-
-/* Output definitions for the places where parms live during the function,
- when different from where they were passed, when the parms were passed
- in memory.
-
- It is not useful to do this for parms passed in registers
- that live during the function in different registers, because it is
- impossible to look in the passed register for the passed value,
- so we use the within-the-function register to begin with.
-
- PARMS is a chain of PARM_DECL nodes. */
-
-static void
-sdbout_reg_parms (tree parms)
-{
- for (; parms; parms = TREE_CHAIN (parms))
- if (DECL_NAME (parms)
- && TREE_TYPE (parms) != error_mark_node
- && DECL_RTL_SET_P (parms)
- && DECL_INCOMING_RTL (parms))
- {
- const char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
-
- /* Report parms that live in registers during the function
- but were passed in memory. */
- if (REG_P (DECL_RTL (parms))
- && REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER
- && PARM_PASSED_IN_MEMORY (parms))
- {
- if (name == 0 || *name == 0)
- name = gen_fake_label ();
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (DECL_RTL (parms))));
- PUT_SDB_SCL (C_REG);
- PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
- PUT_SDB_ENDEF;
- }
- /* Report parms that live in memory but not where they were passed. */
- else if (MEM_P (DECL_RTL (parms))
- && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
- && CONST_INT_P (XEXP (XEXP (DECL_RTL (parms), 0), 1))
- && PARM_PASSED_IN_MEMORY (parms)
- && ! rtx_equal_p (DECL_RTL (parms), DECL_INCOMING_RTL (parms)))
- {
-#if 0 /* ??? It is not clear yet what should replace this. */
- int offset = DECL_OFFSET (parms) / BITS_PER_UNIT;
- /* A parm declared char is really passed as an int,
- so it occupies the least significant bytes.
- On a big-endian machine those are not the low-numbered ones. */
- if (BYTES_BIG_ENDIAN
- && offset != -1
- && TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
- offset += (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
- - GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
- if (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1)) != offset) {...}
-#endif
- {
- if (name == 0 || *name == 0)
- name = gen_fake_label ();
- PUT_SDB_DEF (name);
- PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET
- (XEXP (DECL_RTL (parms), 0)));
- PUT_SDB_SCL (C_AUTO);
- PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
- PUT_SDB_ENDEF;
- }
- }
- }
-}
-
-/* Output early debug information for a global DECL. Called from
- rest_of_decl_compilation during parsing. */
-
-static void
-sdbout_early_global_decl (tree decl ATTRIBUTE_UNUSED)
-{
- /* NYI for non-dwarf. */
-}
-
-/* Output late debug information for a global DECL after location
- information is available. */
-
-static void
-sdbout_late_global_decl (tree decl)
-{
- if (VAR_P (decl) && !DECL_EXTERNAL (decl) && DECL_RTL_SET_P (decl))
- {
- /* The COFF linker can move initialized global vars to the end.
- And that can screw up the symbol ordering. Defer those for
- sdbout_finish (). */
- if (!DECL_INITIAL (decl) || !TREE_PUBLIC (decl))
- sdbout_symbol (decl, 0);
- else
- vec_safe_push (deferred_global_decls, decl);
-
- /* Output COFF information for non-global file-scope initialized
- variables. */
- if (DECL_INITIAL (decl) && MEM_P (DECL_RTL (decl)))
- sdbout_toplevel_data (decl);
- }
-}
-
-/* Output initialized global vars at the end, in the order of
- definition. See comment in sdbout_global_decl. */
-
-static void
-sdbout_finish (const char *main_filename ATTRIBUTE_UNUSED)
-{
- size_t i;
- tree decl;
-
- FOR_EACH_VEC_SAFE_ELT (deferred_global_decls, i, decl)
- sdbout_symbol (decl, 0);
-}
-
-/* Describe the beginning of an internal block within a function.
- Also output descriptions of variables defined in this block.
-
- N is the number of the block, by order of beginning, counting from 1,
- and not counting the outermost (function top-level) block.
- The blocks match the BLOCKs in DECL_INITIAL (current_function_decl),
- if the count starts at 0 for the outermost one. */
-
-static void
-sdbout_begin_block (unsigned int line, unsigned int n)
-{
- tree decl = current_function_decl;
- MAKE_LINE_SAFE (line);
-
- /* The SCO compiler does not emit a separate block for the function level
- scope, so we avoid it here also. */
- PUT_SDB_BLOCK_START (line - sdb_begin_function_line);
-
- if (n == 1)
- {
- /* Include the outermost BLOCK's variables in block 1. */
- do_block = BLOCK_NUMBER (DECL_INITIAL (decl));
- sdbout_block (DECL_INITIAL (decl));
- }
- /* If -g1, suppress all the internal symbols of functions
- except for arguments. */
- if (debug_info_level != DINFO_LEVEL_TERSE)
- {
- do_block = n;
- sdbout_block (DECL_INITIAL (decl));
- }
-
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- sdbout_dequeue_anonymous_types ();
-#endif
-}
-
-/* Describe the end line-number of an internal block within a function. */
-
-static void
-sdbout_end_block (unsigned int line, unsigned int n ATTRIBUTE_UNUSED)
-{
- MAKE_LINE_SAFE (line);
-
- /* The SCO compiler does not emit a separate block for the function level
- scope, so we avoid it here also. */
- if (n != 1)
- PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
-}
-
-/* Output a line number symbol entry for source file FILENAME and line
- number LINE. */
-
-static void
-sdbout_source_line (unsigned int line, unsigned int column ATTRIBUTE_UNUSED,
- const char *filename ATTRIBUTE_UNUSED,
- int discriminator ATTRIBUTE_UNUSED,
- bool is_stmt ATTRIBUTE_UNUSED)
-{
- /* COFF relative line numbers must be positive. */
- if ((int) line > sdb_begin_function_line)
- {
-#ifdef SDB_OUTPUT_SOURCE_LINE
- SDB_OUTPUT_SOURCE_LINE (asm_out_file, line);
-#else
- fprintf (asm_out_file, "\t.ln\t%d\n",
- ((sdb_begin_function_line > -1)
- ? line - sdb_begin_function_line : 1));
-#endif
- }
-}
-
-/* Output sdb info for the current function name.
- Called from assemble_start_function. */
-
-static void
-sdbout_begin_function (tree decl ATTRIBUTE_UNUSED)
-{
- sdbout_symbol (current_function_decl, 0);
-}
-
-/* Called at beginning of function body after prologue. Record the
- function's starting line number, so we can output relative line numbers
- for the other lines. Describe beginning of outermost block. Also
- describe the parameter list. */
-
-static void
-sdbout_begin_prologue (unsigned int line, unsigned int column ATTRIBUTE_UNUSED,
- const char *file ATTRIBUTE_UNUSED)
-{
- sdbout_end_prologue (line, file);
-}
-
-static void
-sdbout_end_prologue (unsigned int line, const char *file ATTRIBUTE_UNUSED)
-{
- sdb_begin_function_line = line - 1;
- PUT_SDB_FUNCTION_START (line);
- sdbout_parms (DECL_ARGUMENTS (current_function_decl));
- sdbout_reg_parms (DECL_ARGUMENTS (current_function_decl));
-}
-
-/* Called at end of function (before epilogue).
- Describe end of outermost block. */
-
-static void
-sdbout_end_function (unsigned int line)
-{
-#ifdef SDB_ALLOW_FORWARD_REFERENCES
- sdbout_dequeue_anonymous_types ();
-#endif
-
- MAKE_LINE_SAFE (line);
- PUT_SDB_FUNCTION_END (line - sdb_begin_function_line);
-
- /* Indicate we are between functions, for line-number output. */
- sdb_begin_function_line = -1;
-}
-
-/* Output sdb info for the absolute end of a function.
- Called after the epilogue is output. */
-
-static void
-sdbout_end_epilogue (unsigned int line ATTRIBUTE_UNUSED,
- const char *file ATTRIBUTE_UNUSED)
-{
- const char *const name ATTRIBUTE_UNUSED
- = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
-
-#ifdef PUT_SDB_EPILOGUE_END
- PUT_SDB_EPILOGUE_END (name);
-#else
- fprintf (asm_out_file, "\t.def\t");
- assemble_name (asm_out_file, name);
- fprintf (asm_out_file, "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n",
- SDB_DELIM, SDB_DELIM, SDB_DELIM);
-#endif
-}
-
-/* Output sdb info for the given label. Called only if LABEL_NAME (insn)
- is present. */
-
-static void
-sdbout_label (rtx_code_label *insn)
-{
- PUT_SDB_DEF (LABEL_NAME (insn));
- PUT_SDB_VAL (insn);
- PUT_SDB_SCL (C_LABEL);
- PUT_SDB_TYPE (T_NULL);
- PUT_SDB_ENDEF;
-}
-
-/* Change to reading from a new source file. */
-
-static void
-sdbout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
- const char *filename ATTRIBUTE_UNUSED)
-{
-}
-
-/* Revert to reading a previous source file. */
-
-static void
-sdbout_end_source_file (unsigned int line ATTRIBUTE_UNUSED)
-{
-}
-
-/* Set up for SDB output at the start of compilation. */
-
-static void
-sdbout_init (const char *input_file_name ATTRIBUTE_UNUSED)
-{
- tree t;
-
- vec_alloc (deferred_global_decls, 12);
-
- /* Emit debug information which was queued by sdbout_symbol before
- we got here. */
- sdbout_initialized = true;
-
- for (t = nreverse (preinit_symbols); t; t = TREE_CHAIN (t))
- sdbout_symbol (TREE_VALUE (t), 0);
- preinit_symbols = 0;
-}
-
-#include "gt-sdbout.h"
diff --git a/gcc/sdbout.h b/gcc/sdbout.h
deleted file mode 100644
index 204b687..0000000
--- a/gcc/sdbout.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* sdbout.h - Various declarations for functions found in sdbout.c
- Copyright (C) 1998-2017 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifndef GCC_SDBOUT_H
-#define GCC_SDBOUT_H
-
-extern void sdbout_symbol (tree, int);
-extern void sdbout_types (tree);
-
-#endif /* GCC_SDBOUT_H */
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 03/13] drop TYPE_SYMTAB_POINTER
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (2 preceding siblings ...)
2017-10-25 21:36 ` [PATCH 04/13] Delete the sdbout files Jim Wilson
@ 2017-10-25 21:36 ` Jim Wilson
2017-10-25 21:45 ` [PATCH 05/13] remove sdb/coff info from docs Jim Wilson
` (10 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:36 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
TYPE_SYMTAB_POINTER was only used by sdbout.c, so can now be removed.
Jim
[-- Attachment #2: 0003-Drop-TYPE_SYMTAB_POINTER.txt --]
[-- Type: text/plain, Size: 2368 bytes --]
gcc/
* tree-core.h (tree_type_common): Delete pointer field of
tree_type_symtab.
* tree.c (copy_node): Clear TYPE_SYMTAB_DIE instead of
TYPE_SYMTAB_POINTER.
* tree.h (TYPE_SYMTAB_POINTER): Delete.
(TYPE_SYMTAB_IS_POINTER): Delete.
(TYPE_SYMTAB_IS_DIE): Renumber.
---
gcc/tree-core.h | 1 -
gcc/tree.c | 2 +-
gcc/tree.h | 8 +-------
3 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index ed35847..f74f145 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -1538,7 +1538,6 @@ struct GTY(()) tree_type_common {
tree reference_to;
union tree_type_symtab {
int GTY ((tag ("TYPE_SYMTAB_IS_ADDRESS"))) address;
- const char * GTY ((tag ("TYPE_SYMTAB_IS_POINTER"))) pointer;
struct die_struct * GTY ((tag ("TYPE_SYMTAB_IS_DIE"))) die;
} GTY ((desc ("debug_hooks->tree_type_symtab_field"))) symtab;
tree canonical;
diff --git a/gcc/tree.c b/gcc/tree.c
index fa6fcb1..28e157f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1206,8 +1206,8 @@ copy_node (tree node MEM_STAT_DECL)
The two statements usually duplicate each other
(because they clear fields of the same union),
but the optimizer should catch that. */
- TYPE_SYMTAB_POINTER (t) = 0;
TYPE_SYMTAB_ADDRESS (t) = 0;
+ TYPE_SYMTAB_DIE (t) = 0;
/* Do not copy the values cache. */
if (TYPE_CACHED_VALUES_P (t))
diff --git a/gcc/tree.h b/gcc/tree.h
index 7214ae2..277aa91 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2072,11 +2072,6 @@ extern machine_mode vector_type_mode (const_tree);
#define TYPE_SYMTAB_ADDRESS(NODE) \
(TYPE_CHECK (NODE)->type_common.symtab.address)
-/* Symtab field as a string. Used by COFF generator in sdbout.c to
- hold struct/union type tag names. */
-#define TYPE_SYMTAB_POINTER(NODE) \
- (TYPE_CHECK (NODE)->type_common.symtab.pointer)
-
/* Symtab field as a pointer to a DWARF DIE. Used by DWARF generator
in dwarf2out.c to point to the DIE generated for the type. */
#define TYPE_SYMTAB_DIE(NODE) \
@@ -2087,8 +2082,7 @@ extern machine_mode vector_type_mode (const_tree);
union. */
#define TYPE_SYMTAB_IS_ADDRESS (0)
-#define TYPE_SYMTAB_IS_POINTER (1)
-#define TYPE_SYMTAB_IS_DIE (2)
+#define TYPE_SYMTAB_IS_DIE (1)
#define TYPE_LANG_SPECIFIC(NODE) \
(TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 05/13] remove sdb/coff info from docs
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (3 preceding siblings ...)
2017-10-25 21:36 ` [PATCH 03/13] drop TYPE_SYMTAB_POINTER Jim Wilson
@ 2017-10-25 21:45 ` Jim Wilson
2017-10-25 21:48 ` [PATCH 06/13] remove sdb and -gcoff from non-target files Jim Wilson
` (9 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:45 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
This removes the now obsolete SDB/coff info from the docs. I also
removed adb and sdb references, as sdb is obsolete, and most people
probably know adb as the android debug bridge, not the assembly
debugger. There are also some obsolete MIPS/Alpha ECOFF docs removed.
Jim
[-- Attachment #2: Type: text/plain, Size: 17907 bytes --]
gcc/
* doc/install.texi (--with-stabs): Delete COFF and ECOFF info.
* doc/invoke.texi (SEEALSO): Delete adb and sdb references.
(Debugging Options): Delete -gcoff.
(-gstabs): Delete SDB reference.
(-gcoff): Delete.
(-gcoff@var{level}): Delete.
* doc/passes.texi (Debugging information output): Delete SDB and
sdbout.c references.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (DWARF_CIE_DATA_ALIGNMENT): Delete SDB from xref.
(SDB and DWARF): Change node name to DWARF and delete SDB and COFF
references.
(DEBUGGER_AUTO_OFFSET): Delete COFF and SDB references.
(PREFERRED_DEBUGGING_TYPE): Delete SDB_DEBUG and -gcoff references.
(SDB_DEBUGGING_INFO): Delete.
(PUT_SDB_@dots{}, SDB_DELIM, SDB_ALLOW_UNKNOWN_REFERENCES)
SDB_ALLOW_FORWARD_REFERENCES, SDB_OUTPUT_SOURCE_LINE): Delete.
* target.def (output_source_filename): Delete COFF reference.
* fortran/invoke.texi: Delete adb and sdb references.
---
gcc/doc/install.texi | 25 ---------------------
gcc/doc/invoke.texi | 13 +++--------
gcc/doc/passes.texi | 9 ++++----
gcc/doc/tm.texi | 60 +++++++++----------------------------------------
gcc/doc/tm.texi.in | 58 ++++++++---------------------------------------
gcc/fortran/invoke.texi | 2 +-
gcc/target.def | 5 ++---
7 files changed, 29 insertions(+), 143 deletions(-)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index da360da..9974775 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1007,31 +1007,6 @@ Specify that stabs debugging
information should be used instead of whatever format the host normally
uses. Normally GCC uses the same debug format as the host system.
-On MIPS based systems and on Alphas, you must specify whether you want
-GCC to create the normal ECOFF debugging format, or to use BSD-style
-stabs passed through the ECOFF symbol table. The normal ECOFF debug
-format cannot fully handle languages other than C@. BSD stabs format can
-handle other languages, but it only works with the GNU debugger GDB@.
-
-Normally, GCC uses the ECOFF debugging format by default; if you
-prefer BSD stabs, specify @option{--with-stabs} when you configure GCC@.
-
-No matter which default you choose when you configure GCC, the user
-can use the @option{-gcoff} and @option{-gstabs+} options to specify explicitly
-the debug format for a particular compilation.
-
-@option{--with-stabs} is meaningful on the ISC system on the 386, also, if
-@option{--with-gas} is used. It selects use of stabs debugging
-information embedded in COFF output. This kind of debugging information
-supports C++ well; ordinary COFF debugging information does not.
-
-@option{--with-stabs} is also meaningful on 386 systems running SVR4. It
-selects use of stabs debugging information embedded in ELF output. The
-C++ compiler currently (2.6.0) does not support the DWARF debugging
-information normally used on 386 SVR4 platforms; stabs provide a
-workable alternative. This requires gas and gdb, as the normal SVR4
-tools can not generate or interpret stabs.
-
@item --with-tls=@var{dialect}
Specify the default TLS dialect, for systems were there is a choice.
For ARM targets, possible values for @var{dialect} are @code{gnu} or
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3a87956..41040c1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -45,7 +45,7 @@ remainder. @command{g++} accepts mostly the same options as @command{gcc}.
@c man end
@c man begin SEEALSO
gpl(7), gfdl(7), fsf-funding(7),
-cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
+cpp(1), gcov(1), as(1), ld(1), gdb(1), dbx(1)
and the Info entries for @file{gcc}, @file{cpp}, @file{as},
@file{ld}, @file{binutils} and @file{gdb}.
@c man end
@@ -342,7 +342,7 @@ Objective-C and Objective-C++ Dialects}.
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program}.
-@gccoptlist{-g -g@var{level} -gcoff -gdwarf -gdwarf-@var{version} @gol
+@gccoptlist{-g -g@var{level} -gdwarf -gdwarf-@var{version} @gol
-ggdb -grecord-gcc-switches -gno-record-gcc-switches @gol
-gstabs -gstabs+ -gstrict-dwarf -gno-strict-dwarf @gol
-gcolumn-info -gno-column-info @gol
@@ -6895,7 +6895,7 @@ in their names, but apply to all currently-supported versions of DWARF.
Produce debugging information in stabs format (if that is supported),
without GDB extensions. This is the format used by DBX on most BSD
systems. On MIPS, Alpha and System V Release 4 systems this option
-produces stabs debugging output that is not understood by DBX or SDB@.
+produces stabs debugging output that is not understood by DBX@.
On System V Release 4 systems this option requires the GNU assembler.
@item -gstabs+
@@ -6905,12 +6905,6 @@ using GNU extensions understood only by the GNU debugger (GDB)@. The
use of these extensions is likely to make other debuggers crash or
refuse to read the program.
-@item -gcoff
-@opindex gcoff
-Produce debugging information in COFF format (if that is supported).
-This is the format used by SDB on most System V systems prior to
-System V Release 4.
-
@item -gxcoff
@opindex gxcoff
Produce debugging information in XCOFF format (if that is supported).
@@ -6932,7 +6926,6 @@ supported). This is the format used by DEBUG on Alpha/VMS systems.
@item -g@var{level}
@itemx -ggdb@var{level}
@itemx -gstabs@var{level}
-@itemx -gcoff@var{level}
@itemx -gxcoff@var{level}
@itemx -gvms@var{level}
Request debugging information and also use @var{level} to specify how
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index 93e70ee..2bf786c 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -981,11 +981,10 @@ these files.
This is run after final because it must output the stack slot offsets
for pseudo registers that did not get hard registers. Source files
-are @file{dbxout.c} for DBX symbol table format, @file{sdbout.c} for
-SDB symbol table format, @file{dwarfout.c} for DWARF symbol table
-format, files @file{dwarf2out.c} and @file{dwarf2asm.c} for DWARF2
-symbol table format, and @file{vmsdbgout.c} for VMS debug symbol table
-format.
+are @file{dbxout.c} for DBX symbol table format, @file{dwarfout.c} for
+DWARF symbol table format, files @file{dwarf2out.c} and @file{dwarf2asm.c}
+for DWARF2 symbol table format, and @file{vmsdbgout.c} for VMS debug
+symbol table format.
@end itemize
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 8484c1d..4f2ecff 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -7692,7 +7692,7 @@ for the file format in use is appropriate.
@end defmac
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_SOURCE_FILENAME (FILE *@var{file}, const char *@var{name})
-Output COFF information or DWARF debugging information which indicates that filename @var{name} is the current source file to the stdio stream @var{file}.
+Output DWARF debugging information which indicates that filename @var{name} is the current source file to the stdio stream @var{file}.
This target hook need not be defined if the standard form of output for the file format in use is appropriate.
@end deftypefn
@@ -9340,7 +9340,7 @@ This macro need only be defined if the target might save registers in the
function prologue at an offset to the stack pointer that is not aligned to
@code{UNITS_PER_WORD}. The definition should be the negative minimum
alignment if @code{STACK_GROWS_DOWNWARD} is true, and the positive
-minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if
+minimum alignment otherwise. @xref{DWARF}. Only applicable if
the target supports DWARF 2 frame unwind information.
@end defmac
@@ -9514,7 +9514,7 @@ This describes how to specify debugging information.
* DBX Options:: Macros enabling specific options in DBX format.
* DBX Hooks:: Hook macros for varying DBX format.
* File Names and DBX:: Macros controlling output of file names in DBX format.
-* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
+* DWARF:: Macros for DWARF format.
* VMS Debug:: Macros for VMS debug format.
@end menu
@@ -9548,9 +9548,8 @@ A C expression that returns the integer offset value for an automatic
variable having address @var{x} (an RTL expression). The default
computation assumes that @var{x} is based on the frame-pointer and
gives the offset from the frame-pointer. This is required for targets
-that produce debugging output for DBX or COFF-style debugging output
-for SDB and allow the frame-pointer to be eliminated when the
-@option{-g} options is used.
+that produce debugging output for DBX and allow the frame-pointer to be
+eliminated when the @option{-g} option is used.
@end defmac
@defmac DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
@@ -9564,7 +9563,7 @@ A C expression that returns the type of debugging output GCC should
produce when the user specifies just @option{-g}. Define
this if you have arranged for GCC to support more than one format of
debugging output. Currently, the allowable values are @code{DBX_DEBUG},
-@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG},
+@code{DWARF_DEBUG}, @code{DWARF2_DEBUG},
@code{XCOFF_DEBUG}, @code{VMS_DEBUG}, and @code{VMS_AND_DWARF2_DEBUG}.
When the user specifies @option{-ggdb}, GCC normally also uses the
@@ -9575,7 +9574,7 @@ defined, GCC uses @code{DBX_DEBUG}.
The value of this macro only affects the default debugging output; the
user can always get a specific type of output by using @option{-gstabs},
-@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
+@option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
@end defmac
@node DBX Options
@@ -9793,16 +9792,11 @@ whose value is the highest absolute text address in the file.
@end defmac
@need 2000
-@node SDB and DWARF
-@subsection Macros for SDB and DWARF Output
+@node DWARF
+@subsection Macros for DWARF Output
@c prevent bad page break with this line
-Here are macros for SDB and DWARF output.
-
-@defmac SDB_DEBUGGING_INFO
-Define this macro to 1 if GCC should produce COFF-style debugging output
-for SDB in response to the @option{-g} option.
-@end defmac
+Here are macros for DWARF output.
@defmac DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
@@ -9908,40 +9902,6 @@ If defined, this target hook is a function which outputs a DTP-relative
reference to the given TLS symbol of the specified size.
@end deftypefn
-@defmac PUT_SDB_@dots{}
-Define these macros to override the assembler syntax for the special
-SDB assembler directives. See @file{sdbout.c} for a list of these
-macros and their arguments. If the standard syntax is used, you need
-not define them yourself.
-@end defmac
-
-@defmac SDB_DELIM
-Some assemblers do not support a semicolon as a delimiter, even between
-SDB assembler directives. In that case, define this macro to be the
-delimiter to use (usually @samp{\n}). It is not necessary to define
-a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
-required.
-@end defmac
-
-@defmac SDB_ALLOW_UNKNOWN_REFERENCES
-Define this macro to allow references to unknown structure,
-union, or enumeration tags to be emitted. Standard COFF does not
-allow handling of unknown references, MIPS ECOFF has support for
-it.
-@end defmac
-
-@defmac SDB_ALLOW_FORWARD_REFERENCES
-Define this macro to allow references to structure, union, or
-enumeration tags that have not yet been seen to be handled. Some
-assemblers choke if forward tags are used, while some require it.
-@end defmac
-
-@defmac SDB_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
-A C statement to output SDB debugging information before code for line
-number @var{line} of the current source file to the stdio stream
-@var{stream}. The default is to emit an @code{.ln} directive.
-@end defmac
-
@need 2000
@node VMS Debug
@subsection Macros for VMS Debug Format
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 015f59e..a00c2c8f 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -6448,7 +6448,7 @@ This macro need only be defined if the target might save registers in the
function prologue at an offset to the stack pointer that is not aligned to
@code{UNITS_PER_WORD}. The definition should be the negative minimum
alignment if @code{STACK_GROWS_DOWNWARD} is true, and the positive
-minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if
+minimum alignment otherwise. @xref{DWARF}. Only applicable if
the target supports DWARF 2 frame unwind information.
@end defmac
@@ -6572,7 +6572,7 @@ This describes how to specify debugging information.
* DBX Options:: Macros enabling specific options in DBX format.
* DBX Hooks:: Hook macros for varying DBX format.
* File Names and DBX:: Macros controlling output of file names in DBX format.
-* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
+* DWARF:: Macros for DWARF format.
* VMS Debug:: Macros for VMS debug format.
@end menu
@@ -6606,9 +6606,8 @@ A C expression that returns the integer offset value for an automatic
variable having address @var{x} (an RTL expression). The default
computation assumes that @var{x} is based on the frame-pointer and
gives the offset from the frame-pointer. This is required for targets
-that produce debugging output for DBX or COFF-style debugging output
-for SDB and allow the frame-pointer to be eliminated when the
-@option{-g} options is used.
+that produce debugging output for DBX and allow the frame-pointer to be
+eliminated when the @option{-g} option is used.
@end defmac
@defmac DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
@@ -6622,7 +6621,7 @@ A C expression that returns the type of debugging output GCC should
produce when the user specifies just @option{-g}. Define
this if you have arranged for GCC to support more than one format of
debugging output. Currently, the allowable values are @code{DBX_DEBUG},
-@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG},
+@code{DWARF_DEBUG}, @code{DWARF2_DEBUG},
@code{XCOFF_DEBUG}, @code{VMS_DEBUG}, and @code{VMS_AND_DWARF2_DEBUG}.
When the user specifies @option{-ggdb}, GCC normally also uses the
@@ -6633,7 +6632,7 @@ defined, GCC uses @code{DBX_DEBUG}.
The value of this macro only affects the default debugging output; the
user can always get a specific type of output by using @option{-gstabs},
-@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
+@option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
@end defmac
@node DBX Options
@@ -6851,16 +6850,11 @@ whose value is the highest absolute text address in the file.
@end defmac
@need 2000
-@node SDB and DWARF
-@subsection Macros for SDB and DWARF Output
+@node DWARF
+@subsection Macros for DWARF Output
@c prevent bad page break with this line
-Here are macros for SDB and DWARF output.
-
-@defmac SDB_DEBUGGING_INFO
-Define this macro to 1 if GCC should produce COFF-style debugging output
-for SDB in response to the @option{-g} option.
-@end defmac
+Here are macros for DWARF output.
@defmac DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
@@ -6936,40 +6930,6 @@ is referenced by a function.
@hook TARGET_ASM_OUTPUT_DWARF_DTPREL
-@defmac PUT_SDB_@dots{}
-Define these macros to override the assembler syntax for the special
-SDB assembler directives. See @file{sdbout.c} for a list of these
-macros and their arguments. If the standard syntax is used, you need
-not define them yourself.
-@end defmac
-
-@defmac SDB_DELIM
-Some assemblers do not support a semicolon as a delimiter, even between
-SDB assembler directives. In that case, define this macro to be the
-delimiter to use (usually @samp{\n}). It is not necessary to define
-a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
-required.
-@end defmac
-
-@defmac SDB_ALLOW_UNKNOWN_REFERENCES
-Define this macro to allow references to unknown structure,
-union, or enumeration tags to be emitted. Standard COFF does not
-allow handling of unknown references, MIPS ECOFF has support for
-it.
-@end defmac
-
-@defmac SDB_ALLOW_FORWARD_REFERENCES
-Define this macro to allow references to structure, union, or
-enumeration tags that have not yet been seen to be handled. Some
-assemblers choke if forward tags are used, while some require it.
-@end defmac
-
-@defmac SDB_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
-A C statement to output SDB debugging information before code for line
-number @var{line} of the current source file to the stdio stream
-@var{stream}. The default is to emit an @code{.ln} directive.
-@end defmac
-
@need 2000
@node VMS Debug
@subsection Macros for VMS Debug Format
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 8892d50..261f253 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -41,7 +41,7 @@ remainder.
@c man end
@c man begin SEEALSO
gpl(7), gfdl(7), fsf-funding(7),
-cpp(1), gcov(1), gcc(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
+cpp(1), gcov(1), gcc(1), as(1), ld(1), gdb(1), dbx(1)
and the Info entries for @file{gcc}, @file{cpp}, @file{gfortran}, @file{as},
@file{ld}, @file{binutils} and @file{gdb}.
@c man end
diff --git a/gcc/target.def b/gcc/target.def
index b7dda5b..805353e 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -876,9 +876,8 @@ to generate it on the spot.",
DEFHOOK
(output_source_filename,
- "Output COFF information or DWARF debugging information which indicates\
- that filename @var{name} is the current source file to the stdio\
- stream @var{file}.\n\
+ "Output DWARF debugging information which indicates that filename\
+ @var{name} is the current source file to the stdio stream @var{file}.\n\
\n\
This target hook need not be defined if the standard form of output\
for the file format in use is appropriate.",
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 06/13] remove sdb and -gcoff from non-target files
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (4 preceding siblings ...)
2017-10-25 21:45 ` [PATCH 05/13] remove sdb/coff info from docs Jim Wilson
@ 2017-10-25 21:48 ` Jim Wilson
2017-10-26 9:57 ` Richard Biener
2017-10-25 21:51 ` [PATCH 07/13] fix testsuite debug torture lists Jim Wilson
` (8 subsequent siblings)
14 siblings, 1 reply; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:48 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 764 bytes --]
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
[-- Attachment #2: 0006-Delete-SDB-and-gcoff-from-non-target-files.txt --]
[-- Type: text/plain, Size: 7865 bytes --]
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..591b744 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -24,7 +24,6 @@ enum debug_info_type
{
NO_DEBUG, /* Write no debug info. */
DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */
- SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */
DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */
XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */
VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */
diff --git a/gcc/function.c b/gcc/function.c
index 339419e..fe3d9c1 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4709,11 +4709,11 @@ number_blocks (tree fn)
int n_blocks;
tree *block_vector;
- /* For SDB and XCOFF debugging output, we start numbering the blocks
+ /* For XCOFF debugging output, we start numbering the blocks
from 1 within each function, rather than keeping a running
count. */
-#if SDB_DEBUGGING_INFO || defined (XCOFF_DEBUGGING_INFO)
- if (write_symbols == SDB_DEBUG || write_symbols == XCOFF_DEBUG)
+#if defined (XCOFF_DEBUGGING_INFO)
+ if (write_symbols == XCOFF_DEBUG)
next_block_index = 1;
#endif
@@ -5248,7 +5248,7 @@ expand_function_start (tree subr)
}
/* The following was moved from init_function_start.
- The move is supposed to make sdb output more accurate. */
+ The move was supposed to make sdb output more accurate. */
/* Indicate the beginning of the function body,
as opposed to parm setup. */
emit_note (NOTE_INSN_FUNCTION_BEG);
@@ -5439,7 +5439,7 @@ expand_function_end (void)
do_pending_stack_adjust ();
/* Output a linenumber for the end of the function.
- SDB depends on this. */
+ SDB depended on this. */
set_curr_insn_location (input_location);
/* Before the return label (if any), clobber the return
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cec3ed5..184f2b3 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1117,7 +1117,7 @@ static const char *cpp_unique_options =
%{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
%{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
%{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
- %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
+ %{remap} %{g3|ggdb3|gstabs3|gxcoff3|gvms3:-dD}\
%{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
%{H} %C %{D*&U*&A*} %{i*} %Z %i\
%{E|M|MM:%W{o*}}";
diff --git a/gcc/opts.c b/gcc/opts.c
index ee95c84..ac383d4 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -37,7 +37,7 @@ static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
/* Indexed by enum debug_info_type. */
const char *const debug_type_names[] =
{
- "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
+ "none", "stabs", "dwarf-2", "xcoff", "vms"
};
/* Parse the -femit-struct-debug-detailed option value
@@ -2351,10 +2351,6 @@ common_handle_option (struct gcc_options *opts,
loc);
break;
- case OPT_gcoff:
- set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
- break;
-
case OPT_gdwarf:
if (arg && strlen (arg) != 0)
{
diff --git a/gcc/system.h b/gcc/system.h
index 01bc134..5fab605 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1008,7 +1008,8 @@ extern void fancy_abort (const char *, int, const char *)
ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE \
EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT \
- JCR_SECTION_NAME TARGET_USE_JCR_SECTION
+ JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO \
+ SDB_DEBUG
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 07/13] fix testsuite debug torture lists
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (5 preceding siblings ...)
2017-10-25 21:48 ` [PATCH 06/13] remove sdb and -gcoff from non-target files Jim Wilson
@ 2017-10-25 21:51 ` Jim Wilson
2017-10-25 21:52 ` [PATCH 08/13] fix dbxcoff.h Jim Wilson
` (7 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:51 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
As a side effect, this reduces cygwin C testsuite passes by a bit over
700, because we are no longer torture testing the -gcoff. This is not
a regression.
An interesting thing to notice here is that we are torture testing
dwarf-2, but are not torture testing any of the later dwarf
versions. We don't need to torture test all of them, but we probably
should torture test the latest usable one, which is dwarf-4 at the
moment. This is a separate issue though that I have not tried to fix
here.
Jim
[-- Attachment #2: 0007-Fix-testsuite-debug-torture-support.txt --]
[-- Type: text/plain, Size: 1618 bytes --]
gcc/
* testsuite/lib/gcc-dg.exp (gcc-dg-debug-runtest): Delete -gcoff.
* testsuite/lib/gfortran-dg.exp (gfortran-dg-debug-runtest): Delete
-gcoff.
---
gcc/testsuite/lib/gcc-dg.exp | 2 +-
gcc/testsuite/lib/gfortran-dg.exp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index cb5d184..d8f9b7b 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -560,7 +560,7 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
if ![info exists DEBUG_TORTURE_OPTIONS] {
set DEBUG_TORTURE_OPTIONS ""
- foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} {
+ foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+} {
set comp_output [$target_compile \
"$srcdir/$subdir/$trivial" "trivial.S" assembly \
"additional_flags=$type"]
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index 27b2a69..6f19009 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -162,7 +162,7 @@ proc gfortran-dg-debug-runtest { target_compile trivial opt_opts testcases } {
if ![info exists DEBUG_TORTURE_OPTIONS] {
set DEBUG_TORTURE_OPTIONS ""
- set type_list [list "-gstabs" "-gstabs+" "-gxcoff" "-gxcoff+" "-gcoff" "-gdwarf-2" ]
+ set type_list [list "-gstabs" "-gstabs+" "-gxcoff" "-gxcoff+" "-gdwarf-2" ]
foreach type $type_list {
set comp_output [$target_compile \
"$srcdir/$subdir/$trivial" "trivial.S" assembly \
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 08/13] fix dbxcoff.h
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (6 preceding siblings ...)
2017-10-25 21:51 ` [PATCH 07/13] fix testsuite debug torture lists Jim Wilson
@ 2017-10-25 21:52 ` Jim Wilson
2017-10-25 21:53 ` [PATCH 09/13] fix vxworks file Jim Wilson
` (6 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:52 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
This file is only used by cygwin, mingw and msdosdjgpp targets, which
explicitly set PREFERRED_DEBUGGING_TYPE after including this file, so
this change has no effect, except to eliminate an obsolete sdb
reference here.
Jim
[-- Attachment #2: 0008-Default-to-dbx-instead-of-sdb.txt --]
[-- Type: text/plain, Size: 730 bytes --]
gcc/
* config/dbxcoff.h (PREFERRED_DEBUGGING_TYPE): Set to DBX_DEBUG.
---
gcc/config/dbxcoff.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index e5eef64..c20b4fe 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -25,10 +25,10 @@ along with GCC; see the file COPYING3. If not see
#define DBX_DEBUGGING_INFO 1
-/* Generate SDB debugging information by default. */
+/* Generate DBX debugging information by default. */
#ifndef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#endif
/* Be function-relative for block and source line stab directives. */
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 09/13] fix vxworks file
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (7 preceding siblings ...)
2017-10-25 21:52 ` [PATCH 08/13] fix dbxcoff.h Jim Wilson
@ 2017-10-25 21:53 ` Jim Wilson
2017-10-25 22:00 ` [PATCH 10/13] fix i386 files Jim Wilson
` (5 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 21:53 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 38 bytes --]
A trivial vxworks related patch.
Jim
[-- Attachment #2: Type: text/plain, Size: 550 bytes --]
gcc/
* config/vx-common.h (SDB_DEBUGGING_INFO): Delete undef.
---
gcc/config/vx-common.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h
index 5cc965c..d8f04ec 100644
--- a/gcc/config/vx-common.h
+++ b/gcc/config/vx-common.h
@@ -72,7 +72,6 @@ along with GCC; see the file COPYING3. If not see
/* None of these other formats is supported. */
#undef DWARF_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
-#undef SDB_DEBUGGING_INFO
#undef XCOFF_DEBUGGING_INFO
#undef VMS_DEBUGGING_INFO
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 11/13] drop sdb references in target comments copied from docs
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (9 preceding siblings ...)
2017-10-25 22:00 ` [PATCH 10/13] fix i386 files Jim Wilson
@ 2017-10-25 22:00 ` Jim Wilson
2017-10-25 22:03 ` [PATCH 12/13] fix m68k files Jim Wilson
` (3 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 22:00 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 169 bytes --]
This is modifying comments that include text copied from the docs,
to match the changes made to the docs in a previous patch. These are
all trivial changes.
Jim
[-- Attachment #2: Type: text/plain, Size: 3294 bytes --]
gcc/
* config/cris/cris.h: Delete SDB reference in comment.
* config/ia64/ia64.h: Likewise.
* config/mmix/mmix.h: Likewise.
* config/nds32/nds32.c: Likewise.
* config/stormy/storym16.h: Likewise.
* config/visium/visium.h: Likewise.
---
gcc/config/cris/cris.h | 2 +-
gcc/config/ia64/ia64.h | 2 +-
gcc/config/mmix/mmix.h | 2 +-
gcc/config/nds32/nds32.c | 2 +-
gcc/config/stormy16/stormy16.h | 2 +-
gcc/config/visium/visium.h | 5 ++---
6 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index f9149c7..892a372 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -998,7 +998,7 @@ enum cris_symbol_type
/* (no definitions) */
-/* Node: SDB and DWARF */
+/* Node: DWARF */
/* (no definitions) */
/* Node: Misc */
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index e7073d1..eceab5f 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1470,7 +1470,7 @@ do { \
/* Likewise. */
\f
-/* Macros for SDB and Dwarf Output. */
+/* Macros for Dwarf Output. */
/* Define this macro if GCC should produce dwarf version 2 format debugging
output in response to the `-g' option. */
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 5dafe2d..2ee3592 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -761,7 +761,7 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
/* (empty) */
-/* Node: SDB and DWARF */
+/* Node: DWARF */
#define DWARF2_DEBUGGING_INFO 1
#define DWARF2_ASM_LINE_DEBUG_INFO 1
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index c1eb66a..b0d5e48 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -3763,7 +3763,7 @@ nds32_target_alignment (rtx_insn *label)
/* -- File Names in DBX Format. */
-/* -- Macros for SDB and DWARF Output. */
+/* -- Macros for DWARF Output. */
/* -- Macros for VMS Debug Format. */
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 3f8a535..1d70457 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -446,7 +446,7 @@ enum reg_class
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
\f
-/* Macros for SDB and Dwarf Output. */
+/* Macros for Dwarf Output. */
/* Define this macro if addresses in Dwarf 2 debugging info should not
be the same size as pointers on the target architecture. The
diff --git a/gcc/config/visium/visium.h b/gcc/config/visium/visium.h
index 3b229f1..8573595 100644
--- a/gcc/config/visium/visium.h
+++ b/gcc/config/visium/visium.h
@@ -1527,9 +1527,8 @@ do \
automatic variable having address X (an RTL expression). The
default computation assumes that X is based on the frame-pointer
and gives the offset from the frame-pointer. This is required for
- targets that produce debugging output for DBX or COFF-style
- debugging output for SDB and allow the frame-pointer to be
- eliminated when the `-g' options is used. */
+ targets that produce debugging output for DBX and allow the frame-pointer
+ to be eliminated when the `-g' options is used. */
#define DEBUGGER_AUTO_OFFSET(X) \
(GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 10/13] fix i386 files
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (8 preceding siblings ...)
2017-10-25 21:53 ` [PATCH 09/13] fix vxworks file Jim Wilson
@ 2017-10-25 22:00 ` Jim Wilson
2017-10-25 22:00 ` [PATCH 11/13] drop sdb references in target comments copied from docs Jim Wilson
` (4 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 22:00 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
I changed some sdb references to past tense where they seemed to still
have some use. Otherwise, sdb references were removed.
Another interesting point here is that the x86 PE-COFF support is using
the gsym.h file to manually emit some sdb symbol info for the linker in
i386_pe_declare_function_type. I left this alone as it appears to be
needed. This is the only sdb support remaining after this patch set.
This is more symbol table info than debug info though, so should not
be a problem.
Jim
[-- Attachment #2: 0010-Update-i386-files.txt --]
[-- Type: text/plain, Size: 5257 bytes --]
gcc/
* config/i386/cygming.h: Don't define SDB_DEBUGGING_INFO.
(ASM_DECLARE_FUNCTION_NAME): Delete SDB reference from comment.
* config/i386/gas.h: Don't define SDB_DEBUGGING_INFO.
* config/i386/i386.c (svr4_dbx_register_map): Change SDB references
to past tense.
(ix86_expand_prologue): Likewise.
* config/i386/winnt.c (i386_pe_start_function): Don't check SDB_DEBUG.
---
gcc/config/i386/cygming.h | 4 +---
gcc/config/i386/gas.h | 4 ----
gcc/config/i386/i386.c | 16 ++++++++--------
gcc/config/i386/winnt.c | 3 +--
4 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index a731e2f..1ed9b17 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -19,7 +19,6 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#define DBX_DEBUGGING_INFO 1
-#define SDB_DEBUGGING_INFO 1
#if TARGET_64BIT_DEFAULT || defined (HAVE_GAS_PE_SECREL32_RELOC)
#define DWARF2_DEBUGGING_INFO 1
#endif
@@ -308,8 +307,7 @@ do { \
#define TARGET_SECTION_TYPE_FLAGS i386_pe_section_type_flags
/* Write the extra assembler code needed to declare a function
- properly. If we are generating SDB debugging information, this
- will happen automatically, so we only need to handle other cases. */
+ properly. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
i386_pe_start_function (FILE, NAME, DECL)
diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h
index 9b42787..862c1c2 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -40,10 +40,6 @@ along with GCC; see the file COPYING3. If not see
#undef DBX_NO_XREFS
#undef DBX_CONTIN_LENGTH
-/* Ask for COFF symbols. */
-
-#define SDB_DEBUGGING_INFO 1
-
/* Output #ident as a .ident. */
#undef TARGET_ASM_OUTPUT_IDENT
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3fafcfe..0847951 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -301,7 +301,7 @@ int const dbx64_register_map[FIRST_PSEUDO_REGISTER] =
7 for %edi (gcc regno = 5)
The following three DWARF register numbers are never generated by
the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
- believes these numbers have these meanings.
+ believed these numbers have these meanings.
8 for %eip (no gcc equivalent)
9 for %eflags (gcc regno = 17)
10 for %trapno (no gcc equivalent)
@@ -309,20 +309,20 @@ int const dbx64_register_map[FIRST_PSEUDO_REGISTER] =
for the x86 architecture. If the version of SDB on x86/svr4 were
a bit less brain dead with respect to floating-point then we would
have a precedent to follow with respect to DWARF register numbers
- for x86 FP registers, but the SDB on x86/svr4 is so completely
+ for x86 FP registers, but the SDB on x86/svr4 was so completely
broken with respect to FP registers that it is hardly worth thinking
of it as something to strive for compatibility with.
- The version of x86/svr4 SDB I have at the moment does (partially)
+ The version of x86/svr4 SDB I had does (partially)
seem to believe that DWARF register number 11 is associated with
the x86 register %st(0), but that's about all. Higher DWARF
register numbers don't seem to be associated with anything in
- particular, and even for DWARF regno 11, SDB only seems to under-
+ particular, and even for DWARF regno 11, SDB only seemed to under-
stand that it should say that a variable lives in %st(0) (when
asked via an `=' command) if we said it was in DWARF regno 11,
- but SDB still prints garbage when asked for the value of the
+ but SDB still printed garbage when asked for the value of the
variable in question (via a `/' command).
- (Also note that the labels SDB prints for various FP stack regs
- when doing an `x' command are all wrong.)
+ (Also note that the labels SDB printed for various FP stack regs
+ when doing an `x' command were all wrong.)
Note that these problems generally don't affect the native SVR4
C compiler because it doesn't allow the use of -O with -g and
because when it is *not* optimizing, it allocates a memory
@@ -13019,7 +13019,7 @@ ix86_expand_prologue (void)
if (frame_pointer_needed && !m->fs.fp_valid)
{
/* Note: AT&T enter does NOT have reversed args. Enter is probably
- slower on all targets. Also sdb doesn't like it. */
+ slower on all targets. Also sdb didn't like it. */
insn = emit_insn (gen_push (hard_frame_pointer_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 405f74a..61d94d2 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -1215,8 +1215,7 @@ void
i386_pe_start_function (FILE *f, const char *name, tree decl)
{
i386_pe_maybe_record_exported_symbol (decl, name, 0);
- if (write_symbols != SDB_DEBUG)
- i386_pe_declare_function_type (f, name, TREE_PUBLIC (decl));
+ i386_pe_declare_function_type (f, name, TREE_PUBLIC (decl));
/* In case section was altered by debugging output. */
if (decl != NULL_TREE)
switch_to_section (function_section (decl));
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 12/13] fix m68k files
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (10 preceding siblings ...)
2017-10-25 22:00 ` [PATCH 11/13] drop sdb references in target comments copied from docs Jim Wilson
@ 2017-10-25 22:03 ` Jim Wilson
2017-10-25 22:07 ` [PATCH 13/13] fix MIPS files Jim Wilson
` (2 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 22:03 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 68 bytes --]
Another trivial patch to drop a reference to the sdb debugger.
Jim
[-- Attachment #2: Type: text/plain, Size: 724 bytes --]
gcc/
* config/m68k/m68kelf.h (DBX_REGISTER_NUMBER): Delete SDB reference.
---
gcc/config/m68k/m68kelf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index fb1a0a4..159223f 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -97,7 +97,7 @@ do { \
/* Define how the m68k registers should be numbered for Dwarf output.
The numbering provided here should be compatible with the native
- SVR4 SDB debugger in the m68k/SVR4 reference port, where d0-d7
+ SVR4 debugger in the m68k/SVR4 reference port, where d0-d7
are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23. */
#undef DBX_REGISTER_NUMBER
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 13/13] fix MIPS files
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (11 preceding siblings ...)
2017-10-25 22:03 ` [PATCH 12/13] fix m68k files Jim Wilson
@ 2017-10-25 22:07 ` Jim Wilson
2017-10-29 10:46 ` Matthew Fortune
2017-10-26 9:39 ` [PATCH 00/13] Removal of SDB debug info support Richard Biener
2017-10-30 1:41 ` Jim Wilson
14 siblings, 1 reply; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 22:07 UTC (permalink / raw)
To: gcc-patches; +Cc: Jim Wilson
[-- Attachment #1: Type: text/plain, Size: 89 bytes --]
Hand tested to verify that I didn't accidentally break passing -g to
the assembler.
Jim
[-- Attachment #2: Type: text/plain, Size: 907 bytes --]
gcc/
* config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Delete gcoff*
support.
---
gcc/config/mips/mips.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 550d283..f5c28bf 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1314,9 +1314,7 @@ struct mips_cpu_info {
%{g} %{g0} %{g1} %{g2} %{g3} \
%{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \
%{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
-%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
-%{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \
-%{gcoff*:-mdebug} %{!gcoff*:-no-mdebug}"
+%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3}"
#endif
/* FP_ASM_SPEC represents the floating-point options that must be passed
--
2.7.4
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 01/13] remove sdbout.h and associated code
2017-10-25 21:30 ` [PATCH 01/13] remove sdbout.h and associated code Jim Wilson
@ 2017-10-25 22:46 ` Jim Wilson
0 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-25 22:46 UTC (permalink / raw)
To: gcc-patches
On 10/25/2017 02:28 PM, Jim Wilson wrote:
> This just removes the header file and references to symbols defined in
> that file.
Sorry, that should be removing sdbout.h header file includes. The
actual file removal occurs later in the patch series.
Jim
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 00/13] Removal of SDB debug info support
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (12 preceding siblings ...)
2017-10-25 22:07 ` [PATCH 13/13] fix MIPS files Jim Wilson
@ 2017-10-26 9:39 ` Richard Biener
2017-10-26 14:07 ` Jeff Law
2017-10-30 1:41 ` Jim Wilson
14 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2017-10-26 9:39 UTC (permalink / raw)
To: Jim Wilson; +Cc: gcc-patches
On Wed, Oct 25, 2017 at 11:24 PM, Jim Wilson <wilson@tuliptree.org> wrote:
> We have no targets that emit SDB debug info by default. We dropped all
> of the SVR3 Unix and embedded COFF targets a while ago. The only
> targets that are still able to emit SDB debug info are cygwin, mingw,
> and msdosdjgpp.
>
> I tried a cygwin build with sources modified to emit SDB by default, to
> see if the support was still usable. I ran into multiple problems.
> There is no SDB support for IMPORTED_DECL which was added in 2008. -
> freorder-functions and -freorder-blocks-and-partition did not work and
> had to be disabled. I hit a cgraph assert because sdbout.c uses
> assemble_name on types, which fails if there is a function and type
> with the same name. This also causes types to be added to the debug
> info with prepended underscores which is wrong. I then ran into a
> problem with the i386_pe_declare_function_type call from
> i386_pe_file_end and gave up because I didn't see an easy workaround.
>
> It seems clear that the SDB support is no longer usable, and probably
> hasn't been for a while. This support should just be removed.
>
> SDB is both a debug info format and an old Unix debugger. There were
> some references to the debugger that I left in, changing to past tense,
> as the comments are useful history to explain why the code was written
> the was it was. Otherwise, I tried to eliminate all references to sdb
> as a debug info format.
>
> This patch series was tested with a C only cross compiler build for all
> modified embedded targets, a default languages build for power aix,
> i686 cygwin, and x86_64 linux. I also did gdb testsuite runs for
> cygwin and linux. There were no regressions.
>
> As a debug info maintainer, I can self approve some of this stuff,
> would be would be good to get a review from one of the other global
> reviewers, and/or target maintainers.
You have my approval for this. Can you add a blurb to gcc-8/changes.html,
like "support for emitting SDB debug info has been removed" in the caveats
section?
Thanks,
Richard.
> Jim
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
2017-10-25 21:48 ` [PATCH 06/13] remove sdb and -gcoff from non-target files Jim Wilson
@ 2017-10-26 9:57 ` Richard Biener
2017-10-26 22:13 ` Jim Wilson
0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2017-10-26 9:57 UTC (permalink / raw)
To: Jim Wilson; +Cc: gcc-patches
On Wed, Oct 25, 2017 at 11:45 PM, Jim Wilson <wilson@tuliptree.org> 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_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..591b744 100644
> --- a/gcc/flag-types.h
> +++ b/gcc/flag-types.h
> @@ -24,7 +24,6 @@ enum debug_info_type
> {
> NO_DEBUG, /* Write no debug info. */
> DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */
> - SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */
> DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */
> XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */
> VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */
> diff --git a/gcc/function.c b/gcc/function.c
> index 339419e..fe3d9c1 100644
> --- a/gcc/function.c
> +++ b/gcc/function.c
> @@ -4709,11 +4709,11 @@ number_blocks (tree fn)
> int n_blocks;
> tree *block_vector;
>
> - /* For SDB and XCOFF debugging output, we start numbering the blocks
> + /* For XCOFF debugging output, we start numbering the blocks
> from 1 within each function, rather than keeping a running
> count. */
> -#if SDB_DEBUGGING_INFO || defined (XCOFF_DEBUGGING_INFO)
> - if (write_symbols == SDB_DEBUG || write_symbols == XCOFF_DEBUG)
> +#if defined (XCOFF_DEBUGGING_INFO)
> + if (write_symbols == XCOFF_DEBUG)
> next_block_index = 1;
> #endif
>
> @@ -5248,7 +5248,7 @@ expand_function_start (tree subr)
> }
>
> /* The following was moved from init_function_start.
> - The move is supposed to make sdb output more accurate. */
> + The move was supposed to make sdb output more accurate. */
> /* Indicate the beginning of the function body,
> as opposed to parm setup. */
> emit_note (NOTE_INSN_FUNCTION_BEG);
> @@ -5439,7 +5439,7 @@ expand_function_end (void)
> do_pending_stack_adjust ();
>
> /* Output a linenumber for the end of the function.
> - SDB depends on this. */
> + SDB depended on this. */
> set_curr_insn_location (input_location);
>
> /* Before the return label (if any), clobber the return
> diff --git a/gcc/gcc.c b/gcc/gcc.c
> index cec3ed5..184f2b3 100644
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -1117,7 +1117,7 @@ static const char *cpp_unique_options =
> %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
> %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
> %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
> - %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
> + %{remap} %{g3|ggdb3|gstabs3|gxcoff3|gvms3:-dD}\
> %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
> %{H} %C %{D*&U*&A*} %{i*} %Z %i\
> %{E|M|MM:%W{o*}}";
> diff --git a/gcc/opts.c b/gcc/opts.c
> index ee95c84..ac383d4 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -37,7 +37,7 @@ static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
> /* Indexed by enum debug_info_type. */
> const char *const debug_type_names[] =
> {
> - "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
> + "none", "stabs", "dwarf-2", "xcoff", "vms"
> };
>
> /* Parse the -femit-struct-debug-detailed option value
> @@ -2351,10 +2351,6 @@ common_handle_option (struct gcc_options *opts,
> loc);
> break;
>
> - case OPT_gcoff:
> - set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
> - break;
> -
> case OPT_gdwarf:
> if (arg && strlen (arg) != 0)
> {
> diff --git a/gcc/system.h b/gcc/system.h
> index 01bc134..5fab605 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -1008,7 +1008,8 @@ extern void fancy_abort (const char *, int, const char *)
> ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
> LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE \
> EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT \
> - JCR_SECTION_NAME TARGET_USE_JCR_SECTION
> + JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO \
> + SDB_DEBUG
>
> /* Hooks that are no longer used. */
> #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 00/13] Removal of SDB debug info support
2017-10-26 9:39 ` [PATCH 00/13] Removal of SDB debug info support Richard Biener
@ 2017-10-26 14:07 ` Jeff Law
0 siblings, 0 replies; 23+ messages in thread
From: Jeff Law @ 2017-10-26 14:07 UTC (permalink / raw)
To: Richard Biener, Jim Wilson; +Cc: gcc-patches
On 10/26/2017 03:33 AM, Richard Biener wrote:
> On Wed, Oct 25, 2017 at 11:24 PM, Jim Wilson <wilson@tuliptree.org> wrote:
>> We have no targets that emit SDB debug info by default. We dropped all
>> of the SVR3 Unix and embedded COFF targets a while ago. The only
>> targets that are still able to emit SDB debug info are cygwin, mingw,
>> and msdosdjgpp.
>>
>> I tried a cygwin build with sources modified to emit SDB by default, to
>> see if the support was still usable. I ran into multiple problems.
>> There is no SDB support for IMPORTED_DECL which was added in 2008. -
>> freorder-functions and -freorder-blocks-and-partition did not work and
>> had to be disabled. I hit a cgraph assert because sdbout.c uses
>> assemble_name on types, which fails if there is a function and type
>> with the same name. This also causes types to be added to the debug
>> info with prepended underscores which is wrong. I then ran into a
>> problem with the i386_pe_declare_function_type call from
>> i386_pe_file_end and gave up because I didn't see an easy workaround.
>>
>> It seems clear that the SDB support is no longer usable, and probably
>> hasn't been for a while. This support should just be removed.
>>
>> SDB is both a debug info format and an old Unix debugger. There were
>> some references to the debugger that I left in, changing to past tense,
>> as the comments are useful history to explain why the code was written
>> the was it was. Otherwise, I tried to eliminate all references to sdb
>> as a debug info format.
>>
>> This patch series was tested with a C only cross compiler build for all
>> modified embedded targets, a default languages build for power aix,
>> i686 cygwin, and x86_64 linux. I also did gdb testsuite runs for
>> cygwin and linux. There were no regressions.
>>
>> As a debug info maintainer, I can self approve some of this stuff,
>> would be would be good to get a review from one of the other global
>> reviewers, and/or target maintainers.
>
> You have my approval for this. Can you add a blurb to gcc-8/changes.html,
> like "support for emitting SDB debug info has been removed" in the caveats
> section?
I didn't see anything I would consider controversial in the series. I'd
echo Richi's comment about potentially keeping the flag as ignored.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
2017-10-26 9:57 ` Richard Biener
@ 2017-10-26 22:13 ` Jim Wilson
2017-10-27 8:46 ` Richard Biener
0 siblings, 1 reply; 23+ messages in thread
From: Jim Wilson @ 2017-10-26 22:13 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]
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
[-- Attachment #2: 0014-ignore-gcoff.txt --]
[-- Type: text/plain, Size: 599 bytes --]
2017-10-26 Jim Wilson <wilson@tuliptree.org>
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.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
2017-10-26 22:13 ` Jim Wilson
@ 2017-10-27 8:46 ` Richard Biener
2017-10-29 23:12 ` Jim Wilson
0 siblings, 1 reply; 23+ messages in thread
From: Richard Biener @ 2017-10-27 8:46 UTC (permalink / raw)
To: Jim Wilson; +Cc: gcc-patches, Jeff Law
On Fri, Oct 27, 2017 at 12:12 AM, Jim Wilson <wilson@tuliptree.org> 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 <wilson@tuliptree.org>
>
> 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.
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 13/13] fix MIPS files
2017-10-25 22:07 ` [PATCH 13/13] fix MIPS files Jim Wilson
@ 2017-10-29 10:46 ` Matthew Fortune
0 siblings, 0 replies; 23+ messages in thread
From: Matthew Fortune @ 2017-10-29 10:46 UTC (permalink / raw)
To: Jim Wilson, gcc-patches
Jim Wilson <wilson@tuliptree.org> writes:
> Hand tested to verify that I didn't accidentally break passing -g to
> the assembler.
In case you are waiting on an OK for the MIPS part... this is fine.
Thanks,
Matthew
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 06/13] remove sdb and -gcoff from non-target files
2017-10-27 8:46 ` Richard Biener
@ 2017-10-29 23:12 ` Jim Wilson
0 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-29 23:12 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]
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
[-- Attachment #2: Type: text/plain, Size: 989 bytes --]
2017-10-29 Jim Wilson <wilson@tuliptree.org>
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.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 00/13] Removal of SDB debug info support
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
` (13 preceding siblings ...)
2017-10-26 9:39 ` [PATCH 00/13] Removal of SDB debug info support Richard Biener
@ 2017-10-30 1:41 ` Jim Wilson
14 siblings, 0 replies; 23+ messages in thread
From: Jim Wilson @ 2017-10-30 1:41 UTC (permalink / raw)
To: gcc-patches
I checked in my patch series today. I did some quick builds before
check in to look for mistakes, and am now doing full builds after check
in to reverify that I did it right.
Jim
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2017-10-29 23:12 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-25 21:28 [PATCH 00/13] Removal of SDB debug info support Jim Wilson
2017-10-25 21:30 ` [PATCH 01/13] remove sdbout.h and associated code Jim Wilson
2017-10-25 22:46 ` Jim Wilson
2017-10-25 21:31 ` [PATCH 02/13] fix sdbout.c references in xcoffout.c Jim Wilson
2017-10-25 21:36 ` [PATCH 04/13] Delete the sdbout files Jim Wilson
2017-10-25 21:36 ` [PATCH 03/13] drop TYPE_SYMTAB_POINTER Jim Wilson
2017-10-25 21:45 ` [PATCH 05/13] remove sdb/coff info from docs Jim Wilson
2017-10-25 21:48 ` [PATCH 06/13] remove sdb and -gcoff from non-target files Jim Wilson
2017-10-26 9:57 ` Richard Biener
2017-10-26 22:13 ` Jim Wilson
2017-10-27 8:46 ` Richard Biener
2017-10-29 23:12 ` Jim Wilson
2017-10-25 21:51 ` [PATCH 07/13] fix testsuite debug torture lists Jim Wilson
2017-10-25 21:52 ` [PATCH 08/13] fix dbxcoff.h Jim Wilson
2017-10-25 21:53 ` [PATCH 09/13] fix vxworks file Jim Wilson
2017-10-25 22:00 ` [PATCH 10/13] fix i386 files Jim Wilson
2017-10-25 22:00 ` [PATCH 11/13] drop sdb references in target comments copied from docs Jim Wilson
2017-10-25 22:03 ` [PATCH 12/13] fix m68k files Jim Wilson
2017-10-25 22:07 ` [PATCH 13/13] fix MIPS files Jim Wilson
2017-10-29 10:46 ` Matthew Fortune
2017-10-26 9:39 ` [PATCH 00/13] Removal of SDB debug info support Richard Biener
2017-10-26 14:07 ` Jeff Law
2017-10-30 1:41 ` Jim Wilson
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).