1992-03-12 06:24:26 +08:00
|
|
|
|
/* Output xcoff-format symbol table information from GNU compiler.
|
2000-08-29 23:54:29 +08:00
|
|
|
|
Copyright (C) 1992, 1994, 1995, 1997, 1998, 1999, 2000
|
|
|
|
|
Free Software Foundation, Inc.
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
GNU CC 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.
|
|
|
|
|
|
|
|
|
|
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
1995-06-15 20:29:51 +08:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 22:58:42 +08:00
|
|
|
|
#include "system.h"
|
1992-03-12 06:24:26 +08:00
|
|
|
|
#include "tree.h"
|
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "flags.h"
|
Warning fixes:
* Makefile.in (xcoffout.o): Depend on toplev.h, output.h and dbxout.h.
* config/fp-bit.c (_fpmul_parts): Move variables `x', `ylow',
`yhigh' and `bit' into the scope in which they are used.
(_fpdiv_parts): Remove unused variables `low', `high', `r0', `r1',
`y0', `y1', `q', `remainder', `carry', `d0' and `d1'.
* rs6000.c: Move include of output.h below tree.h. Include toplev.h.
(any_operand): Mark unused parameters `op' and `mode' with
ATTRIBUTE_UNUSED.
(count_register_operand): Likewise for parameter `mode'.
(fpmem_operand): Likewise.
(short_cint_operand): Likewise.
(u_short_cint_operand): Likewise.
(non_short_cint_operand): Likewise.
(got_operand): Likewise.
(got_no_const_operand): Likewise.
(non_add_cint_operand): Likewise.
(non_logical_cint_operand): Likewise.
(mask_operand): Likewise.
(current_file_function_operand): Likewise.
(small_data_operand): Likewise for parameters `op' and `mode' but
only when !TARGET_ELF.
(init_cumulative_args): Mark parameters `libname' with
ATTRIBUTE_UNUSED.
(function_arg_pass_by_reference): Likewise for parameters `cum',
`mode' and `named'.
(expand_builtin_saveregs): Likewise for parameter `args'.
(load_multiple_operation): Likewise for parameter `mode'.
(store_multiple_operation): Likewise.
(branch_comparison_operator): Likewise.
(secondary_reload_class): Likewise.
(print_operand): Add parentheses around & operation.
(output_prolog): Mark parameter `size' with ATTRIBUTE_UNUSED.
(output_epilog): Likewise. Cast argument to fprintf to int.
(rs6000_adjust_cost): Mark parameter `dep_insn' with ATTRIBUTE_UNUSED.
(rs6000_valid_decl_attribute_p): Likewise for parameters `decl',
`attributes', `identifier' and `args'.
(rs6000_valid_type_attribute_p): Likewise for parameter `attributes'.
(rs6000_comp_type_attributes): Likewise for parameters `type1' and
`type2'.
(rs6000_set_default_type_attributes): Likewise for parameter `type'.
* rs6000.h (RTX_COSTS): Add parentheses around & operation.
(toc_section, private_data_section, trap_comparison_operator): Add
prototypes.
* dbxout.h (dbxout_parms, dbxout_reg_parms, dbxout_syms): Add
prototypes.
* xcoffout.c: Include toplev.h, outout.h and dbxout.h.
* xcoffout.h (stab_to_sclass, xcoffout_begin_function,
xcoffout_begin_block, xcoffout_end_epilogue,
xcoffout_end_function, xcoffout_end_block,
xcoff_output_standard_types, xcoffout_declare_function,
xcoffout_source_line): Add prototypes.
From-SVN: r20717
1998-06-25 21:05:20 +08:00
|
|
|
|
#include "toplev.h"
|
|
|
|
|
#include "output.h"
|
1999-11-07 02:00:18 +08:00
|
|
|
|
#include "ggc.h"
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
#ifdef XCOFF_DEBUGGING_INFO
|
|
|
|
|
|
|
|
|
|
/* This defines the C_* storage classes. */
|
|
|
|
|
#include <dbxstclass.h>
|
|
|
|
|
|
1992-03-24 03:29:32 +08:00
|
|
|
|
#include "xcoffout.h"
|
Warning fixes:
* Makefile.in (xcoffout.o): Depend on toplev.h, output.h and dbxout.h.
* config/fp-bit.c (_fpmul_parts): Move variables `x', `ylow',
`yhigh' and `bit' into the scope in which they are used.
(_fpdiv_parts): Remove unused variables `low', `high', `r0', `r1',
`y0', `y1', `q', `remainder', `carry', `d0' and `d1'.
* rs6000.c: Move include of output.h below tree.h. Include toplev.h.
(any_operand): Mark unused parameters `op' and `mode' with
ATTRIBUTE_UNUSED.
(count_register_operand): Likewise for parameter `mode'.
(fpmem_operand): Likewise.
(short_cint_operand): Likewise.
(u_short_cint_operand): Likewise.
(non_short_cint_operand): Likewise.
(got_operand): Likewise.
(got_no_const_operand): Likewise.
(non_add_cint_operand): Likewise.
(non_logical_cint_operand): Likewise.
(mask_operand): Likewise.
(current_file_function_operand): Likewise.
(small_data_operand): Likewise for parameters `op' and `mode' but
only when !TARGET_ELF.
(init_cumulative_args): Mark parameters `libname' with
ATTRIBUTE_UNUSED.
(function_arg_pass_by_reference): Likewise for parameters `cum',
`mode' and `named'.
(expand_builtin_saveregs): Likewise for parameter `args'.
(load_multiple_operation): Likewise for parameter `mode'.
(store_multiple_operation): Likewise.
(branch_comparison_operator): Likewise.
(secondary_reload_class): Likewise.
(print_operand): Add parentheses around & operation.
(output_prolog): Mark parameter `size' with ATTRIBUTE_UNUSED.
(output_epilog): Likewise. Cast argument to fprintf to int.
(rs6000_adjust_cost): Mark parameter `dep_insn' with ATTRIBUTE_UNUSED.
(rs6000_valid_decl_attribute_p): Likewise for parameters `decl',
`attributes', `identifier' and `args'.
(rs6000_valid_type_attribute_p): Likewise for parameter `attributes'.
(rs6000_comp_type_attributes): Likewise for parameters `type1' and
`type2'.
(rs6000_set_default_type_attributes): Likewise for parameter `type'.
* rs6000.h (RTX_COSTS): Add parentheses around & operation.
(toc_section, private_data_section, trap_comparison_operator): Add
prototypes.
* dbxout.h (dbxout_parms, dbxout_reg_parms, dbxout_syms): Add
prototypes.
* xcoffout.c: Include toplev.h, outout.h and dbxout.h.
* xcoffout.h (stab_to_sclass, xcoffout_begin_function,
xcoffout_begin_block, xcoffout_end_epilogue,
xcoffout_end_function, xcoffout_end_block,
xcoff_output_standard_types, xcoffout_declare_function,
xcoffout_source_line): Add prototypes.
From-SVN: r20717
1998-06-25 21:05:20 +08:00
|
|
|
|
#include "dbxout.h"
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
1998-05-20 02:24:07 +08:00
|
|
|
|
#if defined (USG) || !defined (HAVE_STAB_H)
|
1992-03-12 06:24:26 +08:00
|
|
|
|
#include "gstab.h"
|
|
|
|
|
#else
|
|
|
|
|
#include <stab.h>
|
|
|
|
|
|
|
|
|
|
/* This is a GNU extension we need to reference in this file. */
|
|
|
|
|
#ifndef N_CATCH
|
|
|
|
|
#define N_CATCH 0x54
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Line number of beginning of current function, minus one.
|
|
|
|
|
Negative means not in a function or not using xcoff. */
|
|
|
|
|
|
1995-12-15 19:34:57 +08:00
|
|
|
|
static int xcoff_begin_function_line = -1;
|
|
|
|
|
static int xcoff_inlining = 0;
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* Name of the current include file. */
|
|
|
|
|
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *xcoff_current_include_file;
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* Name of the current function file. This is the file the `.bf' is
|
|
|
|
|
emitted from. In case a line is emitted from a different file,
|
|
|
|
|
(by including that file of course), then the line number will be
|
|
|
|
|
absolute. */
|
|
|
|
|
|
2000-05-06 12:31:16 +08:00
|
|
|
|
static const char *xcoff_current_function_file;
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* Names of bss and data sections. These should be unique names for each
|
|
|
|
|
compilation unit. */
|
|
|
|
|
|
|
|
|
|
char *xcoff_bss_section_name;
|
|
|
|
|
char *xcoff_private_data_section_name;
|
|
|
|
|
char *xcoff_read_only_section_name;
|
1994-06-01 08:22:08 +08:00
|
|
|
|
|
|
|
|
|
/* Last source file name mentioned in a NOTE insn. */
|
|
|
|
|
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *xcoff_lastfile;
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* Macro definitions used below. */
|
|
|
|
|
|
1994-06-01 08:22:08 +08:00
|
|
|
|
#define ABS_OR_RELATIVE_LINENO(LINENO) \
|
1995-09-12 05:39:30 +08:00
|
|
|
|
((xcoff_inlining) ? (LINENO) : (LINENO) - xcoff_begin_function_line)
|
1994-06-01 08:22:08 +08:00
|
|
|
|
|
|
|
|
|
/* Output source line numbers via ".line" rather than ".stabd". */
|
|
|
|
|
#define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM) \
|
|
|
|
|
do { \
|
|
|
|
|
if (xcoff_begin_function_line >= 0) \
|
|
|
|
|
fprintf (FILE, "\t.line\t%d\n", ABS_OR_RELATIVE_LINENO (LINENUM)); \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
1992-03-12 06:24:26 +08:00
|
|
|
|
#define ASM_OUTPUT_LFB(FILE,LINENUM) \
|
|
|
|
|
{ \
|
|
|
|
|
if (xcoff_begin_function_line == -1) \
|
|
|
|
|
{ \
|
|
|
|
|
xcoff_begin_function_line = (LINENUM) - 1;\
|
|
|
|
|
fprintf (FILE, "\t.bf\t%d\n", (LINENUM)); \
|
|
|
|
|
} \
|
|
|
|
|
xcoff_current_function_file \
|
|
|
|
|
= (xcoff_current_include_file \
|
|
|
|
|
? xcoff_current_include_file : main_input_filename); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define ASM_OUTPUT_LFE(FILE,LINENUM) \
|
|
|
|
|
do { \
|
1994-02-01 04:19:28 +08:00
|
|
|
|
fprintf (FILE, "\t.ef\t%d\n", (LINENUM)); \
|
1992-03-12 06:24:26 +08:00
|
|
|
|
xcoff_begin_function_line = -1; \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
#define ASM_OUTPUT_LBB(FILE,LINENUM,BLOCKNUM) \
|
1994-05-21 00:48:11 +08:00
|
|
|
|
fprintf (FILE, "\t.bb\t%d\n", ABS_OR_RELATIVE_LINENO (LINENUM))
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
#define ASM_OUTPUT_LBE(FILE,LINENUM,BLOCKNUM) \
|
1994-05-21 00:48:11 +08:00
|
|
|
|
fprintf (FILE, "\t.eb\t%d\n", ABS_OR_RELATIVE_LINENO (LINENUM))
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 22:58:42 +08:00
|
|
|
|
|
2000-07-04 19:14:13 +08:00
|
|
|
|
static void assign_type_number PARAMS ((tree, const char *, int));
|
2000-01-18 00:01:04 +08:00
|
|
|
|
static void xcoffout_block PARAMS ((tree, int, tree));
|
2000-07-04 19:14:13 +08:00
|
|
|
|
static void xcoffout_source_file PARAMS ((FILE *, const char *, int));
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* Support routines for XCOFF debugging info. */
|
|
|
|
|
|
|
|
|
|
/* Assign NUMBER as the stabx type number for the type described by NAME.
|
|
|
|
|
Search all decls in the list SYMS to find the type NAME. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
assign_type_number (syms, name, number)
|
|
|
|
|
tree syms;
|
2000-07-04 19:14:13 +08:00
|
|
|
|
const char *name;
|
1992-03-12 06:24:26 +08:00
|
|
|
|
int number;
|
|
|
|
|
{
|
|
|
|
|
tree decl;
|
|
|
|
|
|
|
|
|
|
for (decl = syms; decl; decl = TREE_CHAIN (decl))
|
1992-08-19 09:37:50 +08:00
|
|
|
|
if (DECL_NAME (decl)
|
|
|
|
|
&& strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), name) == 0)
|
1992-03-12 06:24:26 +08:00
|
|
|
|
{
|
|
|
|
|
TREE_ASM_WRITTEN (decl) = 1;
|
|
|
|
|
TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = number;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Setup gcc primitive types to use the XCOFF built-in type numbers where
|
|
|
|
|
possible. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoff_output_standard_types (syms)
|
|
|
|
|
tree syms;
|
|
|
|
|
{
|
|
|
|
|
/* Handle built-in C types here. */
|
|
|
|
|
|
1995-12-15 19:34:57 +08:00
|
|
|
|
assign_type_number (syms, "int", -1);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
assign_type_number (syms, "char", -2);
|
|
|
|
|
assign_type_number (syms, "short int", -3);
|
1994-12-03 07:14:05 +08:00
|
|
|
|
assign_type_number (syms, "long int", (TARGET_64BIT ? -31 : -4));
|
1992-03-12 06:24:26 +08:00
|
|
|
|
assign_type_number (syms, "unsigned char", -5);
|
|
|
|
|
assign_type_number (syms, "signed char", -6);
|
|
|
|
|
assign_type_number (syms, "short unsigned int", -7);
|
1995-12-15 19:34:57 +08:00
|
|
|
|
assign_type_number (syms, "unsigned int", -8);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
/* No such type "unsigned". */
|
1994-12-03 07:14:05 +08:00
|
|
|
|
assign_type_number (syms, "long unsigned int", (TARGET_64BIT ? -32 : -10));
|
1992-03-12 06:24:26 +08:00
|
|
|
|
assign_type_number (syms, "void", -11);
|
|
|
|
|
assign_type_number (syms, "float", -12);
|
|
|
|
|
assign_type_number (syms, "double", -13);
|
|
|
|
|
assign_type_number (syms, "long double", -14);
|
|
|
|
|
/* Pascal and Fortran types run from -15 to -29. */
|
1994-12-03 07:14:05 +08:00
|
|
|
|
assign_type_number (syms, "wchar", -30);
|
|
|
|
|
assign_type_number (syms, "long long int", -31);
|
|
|
|
|
assign_type_number (syms, "long long unsigned int", -32);
|
|
|
|
|
/* Additional Fortran types run from -33 to -37. */
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
/* ??? Should also handle built-in C++ and Obj-C types. There perhaps
|
|
|
|
|
aren't any that C doesn't already have. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print an error message for unrecognized stab codes. */
|
|
|
|
|
|
|
|
|
|
#define UNKNOWN_STAB(STR) \
|
|
|
|
|
do { \
|
1999-01-27 09:43:17 +08:00
|
|
|
|
error ("Unknown stab %s: : 0x%x\n", STR, stab); \
|
1992-03-12 06:24:26 +08:00
|
|
|
|
fflush (stderr); \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/* Conversion routine from BSD stabs to AIX storage classes. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
stab_to_sclass (stab)
|
|
|
|
|
int stab;
|
|
|
|
|
{
|
|
|
|
|
switch (stab)
|
|
|
|
|
{
|
|
|
|
|
case N_GSYM:
|
|
|
|
|
return C_GSYM;
|
|
|
|
|
|
|
|
|
|
case N_FNAME:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_FNAME");
|
|
|
|
|
abort ();
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
case N_FUN:
|
|
|
|
|
return C_FUN;
|
|
|
|
|
|
|
|
|
|
case N_STSYM:
|
|
|
|
|
case N_LCSYM:
|
|
|
|
|
return C_STSYM;
|
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_MAIN
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_MAIN:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_MAIN");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
case N_RSYM:
|
|
|
|
|
return C_RSYM;
|
|
|
|
|
|
|
|
|
|
case N_SSYM:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_SSYM");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_RPSYM:
|
|
|
|
|
return C_RPSYM;
|
|
|
|
|
|
|
|
|
|
case N_PSYM:
|
|
|
|
|
return C_PSYM;
|
|
|
|
|
case N_LSYM:
|
|
|
|
|
return C_LSYM;
|
|
|
|
|
case N_DECL:
|
|
|
|
|
return C_DECL;
|
|
|
|
|
case N_ENTRY:
|
|
|
|
|
return C_ENTRY;
|
|
|
|
|
|
|
|
|
|
case N_SO:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_SO");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_SOL:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_SOL");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_SLINE:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_SLINE");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_DSLINE
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_DSLINE:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_DSLINE");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_BSLINE
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_BSLINE:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_BSLINE");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
#if 0
|
|
|
|
|
/* This has the same value as N_BSLINE. */
|
|
|
|
|
case N_BROWS:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_BROWS");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
#endif
|
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_BINCL
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_BINCL:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_BINCL");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_EINCL
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_EINCL:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_EINCL");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_EXCL
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_EXCL:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_EXCL");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
case N_LBRAC:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_LBRAC");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_RBRAC:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_RBRAC");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_BCOMM:
|
|
|
|
|
return C_BCOMM;
|
|
|
|
|
case N_ECOMM:
|
|
|
|
|
return C_ECOMM;
|
|
|
|
|
case N_ECOML:
|
|
|
|
|
return C_ECOML;
|
|
|
|
|
|
|
|
|
|
case N_LENG:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_LENG");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
case N_PC:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_PC");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_M2C
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_M2C:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_M2C");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#ifdef N_SCOPE
|
1992-03-12 06:24:26 +08:00
|
|
|
|
case N_SCOPE:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_SCOPE");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
1993-05-15 05:39:14 +08:00
|
|
|
|
#endif
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
case N_CATCH:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("N_CATCH");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
default:
|
2000-08-29 23:54:29 +08:00
|
|
|
|
UNKNOWN_STAB ("default");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
abort ();
|
2000-08-29 23:54:29 +08:00
|
|
|
|
}
|
1992-03-12 06:24:26 +08:00
|
|
|
|
}
|
1994-06-01 08:22:08 +08:00
|
|
|
|
|
|
|
|
|
/* Output debugging info to FILE to switch to sourcefile FILENAME.
|
|
|
|
|
INLINE_P is true if this is from an inlined function. */
|
|
|
|
|
|
2000-07-04 19:14:13 +08:00
|
|
|
|
static void
|
1994-06-01 08:22:08 +08:00
|
|
|
|
xcoffout_source_file (file, filename, inline_p)
|
|
|
|
|
FILE *file;
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *filename;
|
1994-06-01 08:22:08 +08:00
|
|
|
|
int inline_p;
|
|
|
|
|
{
|
|
|
|
|
if (filename
|
|
|
|
|
&& (xcoff_lastfile == 0 || strcmp (filename, xcoff_lastfile)
|
1995-09-12 05:39:30 +08:00
|
|
|
|
|| (inline_p && ! xcoff_inlining)
|
|
|
|
|
|| (! inline_p && xcoff_inlining)))
|
1994-06-01 08:22:08 +08:00
|
|
|
|
{
|
|
|
|
|
if (xcoff_current_include_file)
|
|
|
|
|
{
|
|
|
|
|
fprintf (file, "\t.ei\t");
|
|
|
|
|
output_quoted_string (file, xcoff_current_include_file);
|
|
|
|
|
fprintf (file, "\n");
|
|
|
|
|
xcoff_current_include_file = NULL;
|
|
|
|
|
}
|
2000-08-29 23:54:29 +08:00
|
|
|
|
xcoff_inlining = inline_p;
|
1994-06-01 08:22:08 +08:00
|
|
|
|
if (strcmp (main_input_filename, filename) || inline_p)
|
|
|
|
|
{
|
|
|
|
|
fprintf (file, "\t.bi\t");
|
|
|
|
|
output_quoted_string (file, filename);
|
|
|
|
|
fprintf (file, "\n");
|
|
|
|
|
xcoff_current_include_file = filename;
|
|
|
|
|
}
|
|
|
|
|
xcoff_lastfile = filename;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Output a line number symbol entry into output stream FILE,
|
|
|
|
|
for source file FILENAME and line number NOTE. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_source_line (file, filename, note)
|
|
|
|
|
FILE *file;
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *filename;
|
1994-06-01 08:22:08 +08:00
|
|
|
|
rtx note;
|
|
|
|
|
{
|
|
|
|
|
xcoffout_source_file (file, filename, RTX_INTEGRATED_P (note));
|
|
|
|
|
|
|
|
|
|
ASM_OUTPUT_SOURCE_LINE (file, NOTE_LINE_NUMBER (note));
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-12 06:24:26 +08:00
|
|
|
|
/* 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
|
|
|
|
|
xcoffout_block (block, depth, args)
|
|
|
|
|
register tree block;
|
|
|
|
|
int depth;
|
|
|
|
|
tree args;
|
|
|
|
|
{
|
|
|
|
|
while (block)
|
|
|
|
|
{
|
|
|
|
|
/* Ignore blocks never expanded or otherwise marked as real. */
|
|
|
|
|
if (TREE_USED (block))
|
|
|
|
|
{
|
|
|
|
|
/* When we reach the specified block, output its symbols. */
|
2000-02-28 17:51:42 +08:00
|
|
|
|
if (BLOCK_NUMBER (block) == do_block)
|
1992-03-12 06:24:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* Output the syms of the block. */
|
|
|
|
|
if (debug_info_level != DINFO_LEVEL_TERSE || depth == 0)
|
|
|
|
|
dbxout_syms (BLOCK_VARS (block));
|
|
|
|
|
if (args)
|
|
|
|
|
dbxout_reg_parms (args);
|
|
|
|
|
|
|
|
|
|
/* We are now done with the block. Don't go to inner blocks. */
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/* If we are past the specified block, stop the scan. */
|
2000-02-28 17:51:42 +08:00
|
|
|
|
else if (BLOCK_NUMBER (block) >= do_block)
|
1992-03-12 06:24:26 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Output the subblocks. */
|
1992-07-07 04:15:06 +08:00
|
|
|
|
xcoffout_block (BLOCK_SUBBLOCKS (block), depth + 1, NULL_TREE);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
}
|
|
|
|
|
block = BLOCK_CHAIN (block);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_begin_block (file, line, n)
|
|
|
|
|
FILE *file;
|
|
|
|
|
int line;
|
|
|
|
|
int n;
|
|
|
|
|
{
|
|
|
|
|
tree decl = current_function_decl;
|
|
|
|
|
|
1994-01-18 05:37:52 +08:00
|
|
|
|
/* The IBM AIX compiler does not emit a .bb for the function level scope,
|
|
|
|
|
so we avoid it here also. */
|
|
|
|
|
if (n != 1)
|
|
|
|
|
ASM_OUTPUT_LBB (file, line, n);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
|
|
|
|
do_block = n;
|
|
|
|
|
xcoffout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Describe the end line-number of an internal block within a function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_end_block (file, line, n)
|
|
|
|
|
FILE *file;
|
|
|
|
|
int line;
|
|
|
|
|
int n;
|
|
|
|
|
{
|
1994-01-18 05:37:52 +08:00
|
|
|
|
if (n != 1)
|
|
|
|
|
ASM_OUTPUT_LBE (file, line, n);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
1992-05-22 18:33:37 +08:00
|
|
|
|
/* Called at beginning of function (before prologue).
|
|
|
|
|
Declare function as needed for debugging. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_declare_function (file, decl, name)
|
|
|
|
|
FILE *file;
|
|
|
|
|
tree decl;
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *name;
|
1992-05-22 18:33:37 +08:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2000-07-04 19:14:13 +08:00
|
|
|
|
if (*name == '*')
|
|
|
|
|
name++;
|
1995-10-29 20:47:58 +08:00
|
|
|
|
else
|
|
|
|
|
for (i = 0; name[i]; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (name[i] == '[')
|
|
|
|
|
{
|
2000-07-04 19:14:13 +08:00
|
|
|
|
char *n = (char *) alloca (i + 1);
|
1995-10-29 20:47:58 +08:00
|
|
|
|
strncpy (n, name, i);
|
|
|
|
|
n[i] = '\0';
|
2000-07-04 19:14:13 +08:00
|
|
|
|
name = n;
|
1995-10-29 20:47:58 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1992-05-22 18:33:37 +08:00
|
|
|
|
|
1995-05-16 20:39:54 +08:00
|
|
|
|
/* Any pending .bi or .ei must occur before the .function pseudo op.
|
1993-03-20 10:05:32 +08:00
|
|
|
|
Otherwise debuggers will think that the function is in the previous
|
|
|
|
|
file and/or at the wrong line number. */
|
1994-06-01 08:22:08 +08:00
|
|
|
|
xcoffout_source_file (file, DECL_SOURCE_FILE (decl), 0);
|
1992-05-22 18:33:37 +08:00
|
|
|
|
dbxout_symbol (decl, 0);
|
1999-09-29 02:13:58 +08:00
|
|
|
|
|
|
|
|
|
/* .function NAME, TOP, MAPPING, TYPE, SIZE
|
|
|
|
|
16 and 044 are placeholders for backwards compatibility */
|
2000-07-04 19:14:13 +08:00
|
|
|
|
fprintf (file, "\t.function .%s,.%s,16,044,FE..%s-.%s\n",
|
|
|
|
|
name, name, name, name);
|
1992-05-22 18:33:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
1992-03-12 06:24:26 +08:00
|
|
|
|
/* 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.
|
|
|
|
|
Record the file name that this function is contained in. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_begin_function (file, last_linenum)
|
|
|
|
|
FILE *file;
|
|
|
|
|
int last_linenum;
|
|
|
|
|
{
|
|
|
|
|
ASM_OUTPUT_LFB (file, last_linenum);
|
1995-07-28 21:03:35 +08:00
|
|
|
|
dbxout_parms (DECL_ARGUMENTS (current_function_decl));
|
1998-07-02 06:28:06 +08:00
|
|
|
|
|
|
|
|
|
/* Emit the symbols for the outermost BLOCK's variables. sdbout.c does 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. */
|
2000-02-29 05:46:44 +08:00
|
|
|
|
do_block = BLOCK_NUMBER (DECL_INITIAL (current_function_decl));
|
1998-07-02 06:28:06 +08:00
|
|
|
|
xcoffout_block (DECL_INITIAL (current_function_decl), 0,
|
|
|
|
|
DECL_ARGUMENTS (current_function_decl));
|
|
|
|
|
|
1995-07-28 21:03:35 +08:00
|
|
|
|
ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Called at end of function (before epilogue).
|
|
|
|
|
Describe end of outermost block. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_end_function (file, last_linenum)
|
|
|
|
|
FILE *file;
|
|
|
|
|
int last_linenum;
|
|
|
|
|
{
|
|
|
|
|
ASM_OUTPUT_LFE (file, last_linenum);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Output xcoff info for the absolute end of a function.
|
|
|
|
|
Called after the epilogue is output. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
xcoffout_end_epilogue (file)
|
|
|
|
|
FILE *file;
|
|
|
|
|
{
|
|
|
|
|
/* We need to pass the correct function size to .function, otherwise,
|
|
|
|
|
the xas assembler can't figure out the correct size for the function
|
|
|
|
|
aux entry. So, we emit a label after the last instruction which can
|
1992-05-07 14:41:23 +08:00
|
|
|
|
be used by the .function pseudo op to calculate the function size. */
|
1992-03-12 06:24:26 +08:00
|
|
|
|
|
2000-05-06 12:31:16 +08:00
|
|
|
|
const char *fname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
|
1992-03-12 06:24:26 +08:00
|
|
|
|
if (*fname == '*')
|
|
|
|
|
++fname;
|
1992-05-22 18:33:37 +08:00
|
|
|
|
fprintf (file, "FE..");
|
1992-03-12 06:24:26 +08:00
|
|
|
|
ASM_OUTPUT_LABEL (file, fname);
|
|
|
|
|
}
|
|
|
|
|
#endif /* XCOFF_DEBUGGING_INFO */
|