/* Output dbx-format symbol table information from GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
static void dbxout_source_line (unsigned int, const char *);
static void dbxout_begin_prologue (unsigned int, const char *);
static void dbxout_source_file (const char *);
-static void dbxout_function_end (void);
+static void dbxout_function_end (tree);
static void dbxout_begin_function (tree);
static void dbxout_begin_block (unsigned, unsigned);
static void dbxout_end_block (unsigned, unsigned);
gcc_assert (stabstr_last_contin_point == 0);
}
+/* As above, but do not force text or emit pending bincls. This is
+ used by dbxout_symbol_location, which needs to do something else. */
+static void
+dbxout_begin_complex_stabs_noforcetext (void)
+{
+ fputs (ASM_STABS_OP, asm_out_file);
+ putc ('"', asm_out_file);
+ gcc_assert (stabstr_last_contin_point == 0);
+}
+
/* Add CHR, a single character, to the string being built. */
#define stabstr_C(chr) obstack_1grow (&stabstr_ob, chr)
all of the arguments to the .stabs directive after the string.
Overridden by xcoffout.h. CODE is the stabs code for this symbol;
LINE is the source line to write into the desc field (in extended
- mode).
+ mode); SYM is the symbol itself.
ADDR, LABEL, and NUMBER are three different ways to represent the
stabs value field. At most one of these should be nonzero.
register variable). It represents the value as a decimal integer. */
#ifndef DBX_FINISH_STABS
-#define DBX_FINISH_STABS(CODE, LINE, ADDR, LABEL, NUMBER) do { \
+#define DBX_FINISH_STABS(SYM, CODE, LINE, ADDR, LABEL, NUMBER) \
+do { \
int line_ = use_gnu_debug_info_extensions ? LINE : 0; \
\
dbxout_int (CODE); \
dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
rtx addr, const char *label, int number)
{
- int line = sym ? DECL_SOURCE_LINE (sym) : 0;
+ int line ATTRIBUTE_UNUSED;
char *str;
size_t len;
+ line = sym ? DECL_SOURCE_LINE (sym) : 0;
if (DBX_CONTIN_LENGTH > 0)
{
char *chunk;
len -= chunklen + 1;
/* Only put a line number on the last stab in the sequence. */
- DBX_FINISH_STABS (code, len == 0 ? line : 0, addr, label, number);
+ DBX_FINISH_STABS (sym, code, len == 0 ? line : 0,
+ addr, label, number);
if (len == 0)
break;
str = obstack_finish (&stabstr_ob);
fwrite (str, 1, len, asm_out_file);
- DBX_FINISH_STABS (code, line, addr, label, number);
+ DBX_FINISH_STABS (sym, code, line, addr, label, number);
}
obstack_free (&stabstr_ob, str);
}
#if defined (DBX_DEBUGGING_INFO)
static void
-dbxout_function_end (void)
+dbxout_function_end (tree decl)
{
char lscope_label_name[100];
named sections. */
if (!use_gnu_debug_info_extensions
|| NO_DBX_FUNCTION_END
- || !targetm.have_named_sections)
+ || !targetm.have_named_sections
+ || DECL_IGNORED_P (decl))
return;
/* By convention, GCC will mark the end of a function with an N_FUN
static void
dbxout_source_line (unsigned int lineno, const char *filename)
{
- const char *begin_label = XSTR(XEXP(DECL_RTL(current_function_decl), 0), 0);
-
dbxout_source_file (filename);
#ifdef DBX_OUTPUT_SOURCE_LINE
#else
if (DBX_LINES_FUNCTION_RELATIVE)
{
+ rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0);
dbxout_begin_stabn_sline (lineno);
dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
- begin_label);
+ XSTR (begin_label, 0));
}
else
dbxout_begin_function (decl);
#endif
dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
- dbxout_function_end ();
+ dbxout_function_end (decl);
}
#endif /* DBX_DEBUGGING_INFO */
}
break;
- case SET_TYPE:
- if (use_gnu_debug_info_extensions)
- {
- have_used_extensions = 1;
- stabstr_S ("@s");
- stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
- stabstr_C (';');
-
- /* Check if a bitstring type, which in Chill is
- different from a [power]set. */
- if (TYPE_STRING_FLAG (type))
- stabstr_S ("@S;");
- }
- stabstr_C ('S');
- dbxout_type (TYPE_DOMAIN (type), 0);
- break;
-
case ARRAY_TYPE:
/* Make arrays of packed bits look like bitstrings for chill. */
if (TYPE_PACKED (type) && use_gnu_debug_info_extensions)
context = decl_function_context (decl);
if (context == current_function_decl)
break;
+ /* Don't mention an inline instance of a nested function. */
+ if (context && DECL_FROM_INLINE (decl))
+ break;
if (!MEM_P (DECL_RTL (decl))
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
break;
letter = decl_function_context (decl) ? 'V' : 'S';
+ /* Some ports can transform a symbol ref into a label ref,
+ because the symbol ref is too far away and has to be
+ dumped into a constant pool. Alternatively, the symbol
+ in the constant pool might be referenced by a different
+ symbol. */
+ if (GET_CODE (addr) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (addr))
+ {
+ bool marked;
+ rtx tmp = get_pool_constant_mark (addr, &marked);
+
+ if (GET_CODE (tmp) == SYMBOL_REF)
+ {
+ addr = tmp;
+ if (CONSTANT_POOL_ADDRESS_P (addr))
+ get_pool_constant_mark (addr, &marked);
+ else
+ marked = true;
+ }
+ else if (GET_CODE (tmp) == LABEL_REF)
+ {
+ addr = tmp;
+ marked = true;
+ }
+
+ /* If all references to the constant pool were optimized
+ out, we just ignore the symbol. */
+ if (!marked)
+ return 0;
+ }
+
/* This should be the same condition as in assemble_variable, but
we don't have access to dont_output_data here. So, instead,
we rely on the fact that error_mark_node initializers always
code = DBX_STATIC_CONST_VAR_CODE;
else
{
- /* Some ports can transform a symbol ref into a label ref,
- because the symbol ref is too far away and has to be
- dumped into a constant pool. Alternatively, the symbol
- in the constant pool might be referenced by a different
- symbol. */
- if (GET_CODE (addr) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (addr))
- {
- bool marked;
- rtx tmp = get_pool_constant_mark (addr, &marked);
-
- if (GET_CODE (tmp) == SYMBOL_REF)
- {
- addr = tmp;
- if (CONSTANT_POOL_ADDRESS_P (addr))
- get_pool_constant_mark (addr, &marked);
- else
- marked = true;
- }
- else if (GET_CODE (tmp) == LABEL_REF)
- {
- addr = tmp;
- marked = true;
- }
-
- /* If all references to the constant pool were optimized
- out, we just ignore the symbol. */
- if (!marked)
- return 0;
- }
-
/* Ultrix `as' seems to need this. */
#ifdef DBX_STATIC_STAB_DATA_SECTION
data_section ();
return 0;
/* Ok, start a symtab entry and output the variable name. */
+ emit_pending_bincls_if_required ();
+ FORCE_TEXT;
#ifdef DBX_STATIC_BLOCK_START
DBX_STATIC_BLOCK_START (asm_out_file, code);
#endif
- dbxout_begin_complex_stabs ();
+ dbxout_begin_complex_stabs_noforcetext ();
dbxout_symbol_name (decl, suffix, letter);
dbxout_type (type, 0);
dbxout_finish_complex_stabs (decl, code, addr, 0, number);
That is, its address was passed in a register.
Output it as if it lived in that register.
The debugger will know from the type
- that it was actually passed by invisible reference. */
+ that it was actually passed by invisible reference. */
code = DBX_REGPARM_STABS_CODE;
static void
dbxout_begin_function (tree decl)
{
- int saved_tree_used1 = TREE_USED (decl);
+ int saved_tree_used1;
+
+ if (DECL_IGNORED_P (decl))
+ return;
+
+ saved_tree_used1 = TREE_USED (decl);
TREE_USED (decl) = 1;
if (DECL_NAME (DECL_RESULT (decl)) != 0)
{