/* Output sdb-format symbol table information from GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
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. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* mike@tredysvr.Tredydev.Unisys.COM says:
I modified the struct.c example and have a nm of a .o resulting from the
static GTY(()) tree anonymous_types;
-/* Counter for sdbout_source_line. */
-
-static GTY(()) int sdbout_source_line_counter;
-
/* Counter to generate unique "names" for nameless struct members. */
static GTY(()) int unnamed_struct_number;
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
-#ifndef SDB_GENERATE_FAKE
-#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
- sprintf ((BUFFER), ".%dfake", (NUMBER));
-#endif
-
/* Return the sdb tag identifier string for TYPE
if TYPE has already been defined; otherwise return a null pointer. */
#ifdef MIPS_DEBUGGING_INFO
-#ifndef PUT_SDB_SRC_FILE
-#define PUT_SDB_SRC_FILE(FILENAME) \
-output_file_directive (asm_out_file, (FILENAME))
-#endif
-
/* ECOFF linkers have an optimization that does the same kind of thing as
N_BINCL/E_INCL in stabs: eliminate duplicate debug information in the
executable. To achieve this, GCC must output a .file for each file
debug_nothing_tree, /* outlining_inline_function */
sdbout_label, /* label */
debug_nothing_int, /* handle_pch */
- debug_nothing_rtx /* var_location */
+ debug_nothing_rtx, /* var_location */
+ debug_nothing_void, /* switch_text_section */
+ 0 /* start_end_main_source_file */
};
/* Return a unique string to name an anonymous type. */
{
char label[10];
char *labelstr;
- SDB_GENERATE_FAKE (label, unnamed_struct_number);
+ sprintf (label, ".%dfake", unnamed_struct_number);
unnamed_struct_number++;
labelstr = xstrdup (label);
return labelstr;
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)))
case PARM_DECL:
/* Parm decls go in their own separate chains
and are output by sdbout_reg_parms and sdbout_parms. */
- abort ();
+ gcc_unreachable ();
case VAR_DECL:
/* Don't mention a variable that is external.
if (DECL_IGNORED_P (decl))
return;
- if (! (TREE_CODE (decl) == VAR_DECL
- && MEM_P (DECL_RTL (decl))
- && DECL_INITIAL (decl)))
- abort ();
+ gcc_assert (TREE_CODE (decl) == VAR_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));
&& DECL_SECTION_NAME (current_function_decl) != NULL_TREE)
; /* Don't change section amid function. */
else
- text_section ();
+ switch_to_section (text_section);
switch (TREE_CODE (type))
{
int size = int_size_in_bytes (type);
int member_scl = 0;
tree tem;
- int i, n_baseclasses = 0;
/* Record the type tag, but not in its permanent place just yet. */
sdbout_record_type_name (type);
/* 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)
+ if (TREE_CODE (type) != ENUMERAL_TYPE && TYPE_BINFO (type))
{
- if (TYPE_BINFO (type) && BINFO_BASE_BINFOS (TYPE_BINFO (type)))
- n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (type));
-
- for (i = 0; i < n_baseclasses; i++)
+ int i;
+ tree binfo, child;
+
+ for (binfo = TYPE_BINFO (type), i = 0;
+ BINFO_BASE_ITERATE (binfo, i, child); i++)
{
- tree child = BINFO_BASE_BINFO (TYPE_BINFO (type), 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)
/* COFF relative line numbers must be positive. */
if ((int) line > sdb_begin_function_line)
{
-#ifdef ASM_OUTPUT_SOURCE_LINE
- sdbout_source_line_counter += 1;
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, sdbout_source_line_counter);
+#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)
n->next = current_file;
n->name = filename;
current_file = n;
- PUT_SDB_SRC_FILE (filename);
+ output_file_directive (asm_out_file, filename);
#endif
}
next = current_file->next;
free (current_file);
current_file = next;
- PUT_SDB_SRC_FILE (current_file->name);
+ output_file_directive (asm_out_file, current_file->name);
#endif
}