diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa09fb323fbfbf549bdfe0df70595f28984a4013..11d26a841f98490fc3f3e900548d2a85ae1d2906 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2003-07-14 Richard Sandiford <rsandifo@redhat.com> + + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Add mips/sdb.h + to the list of include files when using gas. + (mips*el-*-openbsd*, mips*-*-openbsd*): Add mips/sdb.h unconditionally. + * config/mips/elf.h: Remove #undef SDB_DEBUGGING_INFO. + * config/mips/elf64.h: Likewise. + * config/mips/iris5.h: Likewise. + * config/mips/linux.h: Likewise. + * config/mips/iris5gas.h (SDB_DEBUGGING_INFO): Remove definition. + * config/mips/mips.h (PREFERRED_DEBUGGING_TYPE): Likewise. + (SDB_DEBUGGING_INFO, sdb*, SDB_ALLOW_*, PUT_SDB*): Move to... + * config/mips/sdb.h: ...this new file. + 2003-07-14 Douglas Rupp <rupp@gnat.com> * fixinc/server.c (server_setup): Don't use non-POSIX NULL first diff --git a/gcc/config.gcc b/gcc/config.gcc index fc761cef166935066c32161ba319cdf9ed3857e3..427298e76296f57fc13c646292996cc394cda6a9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1397,7 +1397,7 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI tm_file="${tm_file} mips/iris5.h" if test x$gas = xyes then - tm_file="${tm_file} mips/iris5gas.h mips/iris6-o32-gas.h" + tm_file="${tm_file} mips/sdb.h mips/iris5gas.h mips/iris6-o32-gas.h" if test x$stabs = xyes then tm_file="${tm_file} dbx.h mips/dbxmdebug.h" @@ -1447,7 +1447,7 @@ mips-sgi-irix5*) # SGI System V.4., IRIX 5 tm_file="${tm_file} mips/iris5.h" if test x$gas = xyes then - tm_file="${tm_file} mips/iris5gas.h" + tm_file="${tm_file} mips/sdb.h mips/iris5gas.h" if test x$stabs = xyes then tm_file="${tm_file} dbx.h mips/dbxmdebug.h" @@ -1501,10 +1501,11 @@ mips*-*-linux*) # Linux MIPS, either endian. ;; mips*el-*-openbsd*) # mips little endian target_cpu_default="MASK_GAS|MASK_ABICALLS" + tm_file="${tm_file} mips/sdb.h" ;; mips*-*-openbsd*) # mips big endian target_cpu_default="MASK_GAS|MASK_ABICALLS" - tm_file="mips/openbsd-be.h ${tm_file}" + tm_file="mips/openbsd-be.h ${tm_file} mips/sdb.h" ;; mipsisa32-*-elf* | mipsisa32el-*-elf*) tm_file="${tm_file} mips/elf.h" diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h index c325410d6040c452515f872103afb7c84c5d3842..dc4590da168cc77a5e78aa883ed28441ac4fed19 100644 --- a/gcc/config/mips/elf.h +++ b/gcc/config/mips/elf.h @@ -24,9 +24,6 @@ Boston, MA 02111-1307, USA. */ #undef OBJECT_FORMAT_COFF #undef EXTENDED_COFF -/* ??? Move all SDB stuff into separate header file. */ -#undef SDB_DEBUGGING_INFO - #define DBX_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h index 4d672774c4f330c1dd6159841a806a730ca7f4e3..40863aaf1a987b50f6b7e78a4c0ced13464771df 100644 --- a/gcc/config/mips/elf64.h +++ b/gcc/config/mips/elf64.h @@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA. */ #undef OBJECT_FORMAT_COFF #undef EXTENDED_COFF -#undef SDB_DEBUGGING_INFO #define DBX_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h index a0d1e936d7e1f812bf171260c8dc38a7aa198a45..d8c31d46dfb5edf301adf111d08507bbfa5a0cf8 100644 --- a/gcc/config/mips/iris5.h +++ b/gcc/config/mips/iris5.h @@ -140,7 +140,6 @@ Boston, MA 02111-1307, USA. */ /* We don't support debugging info for now. */ #undef DBX_DEBUGGING_INFO -#undef SDB_DEBUGGING_INFO #undef MIPS_DEBUGGING_INFO #undef PREFERRED_DEBUGGING_TYPE diff --git a/gcc/config/mips/iris5gas.h b/gcc/config/mips/iris5gas.h index a38108d861cedf913e732e405279013fda3330f4..f94d1ac7676bdc514c474f4f9edf9767433da012 100644 --- a/gcc/config/mips/iris5gas.h +++ b/gcc/config/mips/iris5gas.h @@ -3,7 +3,6 @@ /* Enable debugging. */ #define DBX_DEBUGGING_INFO 1 #define DWARF2_DEBUGGING_INFO 1 -#define SDB_DEBUGGING_INFO 1 #define MIPS_DEBUGGING_INFO 1 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 054f5f1a298bde0372591e4a81e6c1569a58a0bc..75e252051d8e036e2d7b35b7d451dea75db014c4 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -226,10 +226,6 @@ do { \ #undef ASM_OUTPUT_REG_PUSH #undef ASM_OUTPUT_REG_POP -/* The current Linux binutils uses MIPS_STABS_ELF and doesn't support - COFF. */ -#undef SDB_DEBUGGING_INFO - #undef LIB_SPEC #define LIB_SPEC "\ %{shared: -lc} \ diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 2193f98e04b7c1c55f68f74493a1d75ab60d7018..eac1388ebaef1f78456aa77534d679450f9fb653 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -117,8 +117,6 @@ extern int num_source_filenames; /* current .file # */ extern int inside_function; /* != 0 if inside of a function */ extern int ignore_line_number; /* != 0 if we are to ignore next .loc */ extern int file_in_function_warning; /* warning given about .file in func */ -extern int sdb_label_count; /* block start/end next label # */ -extern int sdb_begin_function_line; /* Starting Line of current function */ extern int mips_section_threshold; /* # bytes of data/sdata cutoff */ extern int sym_lineno; /* sgi next label # for each stmt */ extern int set_noreorder; /* # of nested .set noreorder's */ @@ -1257,14 +1255,9 @@ extern int mips_abi; #endif -#define SDB_DEBUGGING_INFO 1 /* generate info for mips-tfile */ #define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */ #define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */ -#ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */ -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG -#endif - /* By default, turn on GDB extensions. */ #define DEFAULT_GDB_EXTENSIONS 1 @@ -1292,12 +1285,6 @@ extern int mips_abi; #define USER_LABEL_PREFIX "" #endif -/* Forward references to tags are allowed. */ -#define SDB_ALLOW_FORWARD_REFERENCES - -/* Unknown tags are also allowed. */ -#define SDB_ALLOW_UNKNOWN_REFERENCES - /* On Sun 4, this limit is 2048. We use 1500 to be safe, since the length can run past this up to a continuation point. */ #undef DBX_CONTIN_LENGTH @@ -1330,60 +1317,6 @@ extern int mips_abi; #define FIND_BASE_TERM(X) mips_delegitimize_address (X) -#define PUT_SDB_DEF(a) \ -do { \ - fprintf (asm_out_file, "\t%s.def\t", \ - (TARGET_GAS) ? "" : "#"); \ - ASM_OUTPUT_LABELREF (asm_out_file, a); \ - fputc (';', asm_out_file); \ -} while (0) - -#define PUT_SDB_PLAIN_DEF(a) \ -do { \ - fprintf (asm_out_file, "\t%s.def\t.%s;", \ - (TARGET_GAS) ? "" : "#", (a)); \ -} while (0) - -/* For block start and end, we create labels, so that - later we can figure out where the correct offset is. - The normal .ent/.end serve well enough for functions, - so those are just commented out. */ - -#define PUT_SDB_BLOCK_START(LINE) \ -do { \ - fprintf (asm_out_file, \ - "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \ - LOCAL_LABEL_PREFIX, \ - sdb_label_count, \ - (TARGET_GAS) ? "" : "#", \ - LOCAL_LABEL_PREFIX, \ - sdb_label_count, \ - (LINE)); \ - sdb_label_count++; \ -} while (0) - -#define PUT_SDB_BLOCK_END(LINE) \ -do { \ - fprintf (asm_out_file, \ - "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \ - LOCAL_LABEL_PREFIX, \ - sdb_label_count, \ - (TARGET_GAS) ? "" : "#", \ - LOCAL_LABEL_PREFIX, \ - sdb_label_count, \ - (LINE)); \ - sdb_label_count++; \ -} while (0) - -#define PUT_SDB_FUNCTION_START(LINE) - -#define PUT_SDB_FUNCTION_END(LINE) \ -do { \ - ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \ -} while (0) - -#define PUT_SDB_EPILOGUE_END(NAME) - /* Correct the offset of automatic variables and arguments. Note that the MIPS debug format wants all automatic variables and arguments to be in terms of the virtual frame pointer (stack pointer before diff --git a/gcc/config/mips/sdb.h b/gcc/config/mips/sdb.h new file mode 100644 index 0000000000000000000000000000000000000000..6ac4c214e454ea8a45fcf7435531fed9b5b2cb09 --- /dev/null +++ b/gcc/config/mips/sdb.h @@ -0,0 +1,89 @@ +/* Generate SDB debugging info. + Copyright (C) 2003 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 2, 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 COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +/* Note that no configuration uses sdb as its preferred format. */ + +#define SDB_DEBUGGING_INFO 1 + +/* Forward references to tags are allowed. */ +#define SDB_ALLOW_FORWARD_REFERENCES + +/* Unknown tags are also allowed. */ +#define SDB_ALLOW_UNKNOWN_REFERENCES + +/* Block start/end next label #. */ +extern int sdb_label_count; + +/* Starting line of current function. */ +extern int sdb_begin_function_line; + +#define PUT_SDB_DEF(a) \ +do { \ + fprintf (asm_out_file, "\t%s.def\t", \ + (TARGET_GAS) ? "" : "#"); \ + ASM_OUTPUT_LABELREF (asm_out_file, a); \ + fputc (';', asm_out_file); \ +} while (0) + +#define PUT_SDB_PLAIN_DEF(a) \ +do { \ + fprintf (asm_out_file, "\t%s.def\t.%s;", \ + (TARGET_GAS) ? "" : "#", (a)); \ +} while (0) + +/* For block start and end, we create labels, so that + later we can figure out where the correct offset is. + The normal .ent/.end serve well enough for functions, + so those are just commented out. */ + +#define PUT_SDB_BLOCK_START(LINE) \ +do { \ + fprintf (asm_out_file, \ + "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (TARGET_GAS) ? "" : "#", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (LINE)); \ + sdb_label_count++; \ +} while (0) + +#define PUT_SDB_BLOCK_END(LINE) \ +do { \ + fprintf (asm_out_file, \ + "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (TARGET_GAS) ? "" : "#", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (LINE)); \ + sdb_label_count++; \ +} while (0) + +#define PUT_SDB_FUNCTION_START(LINE) + +#define PUT_SDB_FUNCTION_END(LINE) \ +do { \ + ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \ +} while (0) + +#define PUT_SDB_EPILOGUE_END(NAME)