From 6627b7f96a3c0d429d2f55b1407ba4aa77658bc8 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 14 Jul 2003 20:09:20 +0000 Subject: [PATCH] config.gcc (mips-sgi-irix6*o32, [...]): Add mips/sdb.h to the list of include files when using gas. * 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. From-SVN: r69345 --- gcc/ChangeLog | 14 ++++++ gcc/config.gcc | 7 +-- gcc/config/mips/elf.h | 3 -- gcc/config/mips/elf64.h | 1 - gcc/config/mips/iris5.h | 1 - gcc/config/mips/iris5gas.h | 1 - gcc/config/mips/linux.h | 4 -- gcc/config/mips/mips.h | 67 ---------------------------- gcc/config/mips/sdb.h | 89 ++++++++++++++++++++++++++++++++++++++ 9 files changed, 107 insertions(+), 80 deletions(-) create mode 100644 gcc/config/mips/sdb.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa09fb323fb..11d26a841f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2003-07-14 Richard Sandiford + + * 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 * fixinc/server.c (server_setup): Don't use non-POSIX NULL first diff --git a/gcc/config.gcc b/gcc/config.gcc index fc761cef166..427298e7629 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 c325410d604..dc4590da168 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 4d672774c4f..40863aaf1a9 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 a0d1e936d7e..d8c31d46dfb 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 a38108d861c..f94d1ac7676 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 054f5f1a298..75e252051d8 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 2193f98e04b..eac1388ebae 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 00000000000..6ac4c214e45 --- /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)