The file_number and type_number elements are used if DBX_USE_BINCL
is defined. */
-struct typeinfo GTY(())
-{
+struct GTY(()) typeinfo {
enum typestatus status;
int file_number;
int type_number;
struct dbx_file *prev; /* Chain to traverse all pending bincls. */
};
-/* This is the top of the stack.
-
+/* This is the top of the stack.
+
This is not saved for PCH, because restoring a PCH should not change it.
next_file_number does have to be saved, because the PCH may use some
file numbers; however, just before restoring a PCH, next_file_number
#include "gstab.h"
-#define STAB_CODE_TYPE enum __stab_debug_code
-
/* 1 if PARM is passed to this function in memory. */
#define PARM_PASSED_IN_MEMORY(PARM) \
static inline void emit_pending_bincls_if_required (void);
static void dbxout_init (const char *);
-
+
static void dbxout_finish (const char *);
static void dbxout_start_source_file (unsigned, const char *);
static void dbxout_end_source_file (unsigned);
static void dbxout_type_fields (tree);
static void dbxout_type_method_1 (tree);
static void dbxout_type_methods (tree);
-static void dbxout_range_type (tree);
+static void dbxout_range_type (tree, tree, tree);
static void dbxout_type (tree, int);
-static bool print_int_cst_bounds_in_octal_p (tree);
+static bool print_int_cst_bounds_in_octal_p (tree, tree, tree);
static bool is_fortran (void);
static void dbxout_type_name (tree);
static void dbxout_class_name_qualifiers (tree);
static int dbxout_symbol_location (tree, tree, const char *, rtx);
static void dbxout_symbol_name (tree, const char *, int);
-static void dbxout_common_name (tree, const char *, STAB_CODE_TYPE);
+static void dbxout_common_name (tree, const char *, stab_code_type);
static const char *dbxout_common_check (tree, int *);
static void dbxout_global_decl (tree);
static void dbxout_type_decl (tree, int);
/* The debug hooks structure. */
#if defined (DBX_DEBUGGING_INFO)
-static void dbxout_source_line (unsigned int, const char *);
+static void dbxout_source_line (unsigned int, const char *, int, bool);
static void dbxout_begin_prologue (unsigned int, const char *);
static void dbxout_source_file (const char *);
static void dbxout_function_end (tree);
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
dbxout_handle_pch, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
dbxout_handle_pch, /* handle_pch */
debug_nothing_rtx, /* var_location */
debug_nothing_void, /* switch_text_section */
+ debug_nothing_tree, /* direct_call */
+ debug_nothing_tree_int, /* virtual_call_token */
+ debug_nothing_rtx_rtx, /* copy_call_info */
+ debug_nothing_uid, /* virtual_call */
debug_nothing_tree_tree, /* set_name */
0 /* start_end_main_source_file */
};
SYM is the DECL of the symbol under consideration; it is used only
for its DECL_SOURCE_LINE. The other arguments are all passed directly
to DBX_FINISH_STABS; see above for details. */
-
+
static void
-dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
+dbxout_finish_complex_stabs (tree sym, stab_code_type code,
rtx addr, const char *label, int number)
{
int line ATTRIBUTE_UNUSED;
obstack_grow (&stabstr_ob, "\",", 2);
len = obstack_object_size (&stabstr_ob);
str = XOBFINISH (&stabstr_ob, char *);
-
+
fwrite (str, 1, len, asm_out_file);
DBX_FINISH_STABS (sym, code, line, addr, label, number);
}
#if defined (DBX_DEBUGGING_INFO)
static void
-dbxout_function_end (tree decl)
+dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
{
char lscope_label_name[100];
/* The Lscope label must be emitted even if we aren't doing anything
else; dbxout_block needs it. */
switch_to_section (function_section (current_function_decl));
-
+
/* Convert Lscope into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
labels. */
named sections. */
if (!use_gnu_debug_info_extensions
|| NO_DBX_FUNCTION_END
- || !targetm.have_named_sections
- || DECL_IGNORED_P (decl))
+ || !targetm.have_named_sections)
return;
/* By convention, GCC will mark the end of a function with an N_FUN
if (flag_reorder_blocks_and_partition)
{
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
+ dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
crtl->subsections.hot_section_label);
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (crtl->subsections.cold_section_end_label,
+ dbxout_stab_value_label_diff (crtl->subsections.cold_section_end_label,
crtl->subsections.cold_section_label);
}
else
n->next = current_file;
n->next_type_number = 1;
- /* Do not assign file number now.
+ /* Do not assign file number now.
Delay it until we actually emit BINCL. */
n->file_number = 0;
n->prev = NULL;
}
}
-/* Output N_BNSYM, line number symbol entry, and local symbol at
+/* Output N_BNSYM, line number symbol entry, and local symbol at
function scope */
static void
/* pre-increment the scope counter */
scope_labelno++;
- dbxout_source_line (lineno, filename);
- /* Output function begin block at function scope, referenced
+ dbxout_source_line (lineno, filename, 0, true);
+ /* Output function begin block at function scope, referenced
by dbxout_block, dbxout_source_line and dbxout_function_end. */
emit_pending_bincls_if_required ();
targetm.asm_out.internal_label (asm_out_file, "LFBB", scope_labelno);
number LINENO. */
static void
-dbxout_source_line (unsigned int lineno, const char *filename)
+dbxout_source_line (unsigned int lineno, const char *filename,
+ int discriminator ATTRIBUTE_UNUSED,
+ bool is_stmt ATTRIBUTE_UNUSED)
{
dbxout_source_file (filename);
char begin_label[20];
dbxout_begin_stabn_sline (lineno);
/* Reference current function start using LFBB. */
- ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
begin_label);
}
/* Emit a "range" type specification, which has the form:
"r<index type>;<lower bound>;<upper bound>;".
- TYPE is an INTEGER_TYPE. */
+ TYPE is an INTEGER_TYPE, LOW and HIGH are the bounds. */
static void
-dbxout_range_type (tree type)
+dbxout_range_type (tree type, tree low, tree high)
{
stabstr_C ('r');
if (TREE_TYPE (type))
}
stabstr_C (';');
- if (TYPE_MIN_VALUE (type) != 0
- && host_integerp (TYPE_MIN_VALUE (type), 0))
+ if (low && host_integerp (low, 0))
{
- if (print_int_cst_bounds_in_octal_p (type))
- stabstr_O (TYPE_MIN_VALUE (type));
+ if (print_int_cst_bounds_in_octal_p (type, low, high))
+ stabstr_O (low);
else
- stabstr_D (tree_low_cst (TYPE_MIN_VALUE (type), 0));
+ stabstr_D (tree_low_cst (low, 0));
}
else
stabstr_C ('0');
stabstr_C (';');
- if (TYPE_MAX_VALUE (type) != 0
- && host_integerp (TYPE_MAX_VALUE (type), 0))
+ if (high && host_integerp (high, 0))
{
- if (print_int_cst_bounds_in_octal_p (type))
- stabstr_O (TYPE_MAX_VALUE (type));
+ if (print_int_cst_bounds_in_octal_p (type, low, high))
+ stabstr_O (high);
else
- stabstr_D (tree_low_cst (TYPE_MAX_VALUE (type), 0));
+ stabstr_D (tree_low_cst (high, 0));
stabstr_C (';');
}
else
static void
dbxout_type (tree type, int full)
{
- tree tem;
- tree main_variant;
static int anonymous_type_number = 0;
bool vector_type = false;
+ tree tem, main_variant, low, high;
if (TREE_CODE (type) == VECTOR_TYPE)
{
vector_type = true;
}
+ if (TREE_CODE (type) == INTEGER_TYPE)
+ {
+ if (TREE_TYPE (type) == 0)
+ {
+ low = TYPE_MIN_VALUE (type);
+ high = TYPE_MAX_VALUE (type);
+ }
+
+ else if (subrange_type_for_debug_p (type, &low, &high))
+ ;
+
+ /* If this is a subtype that should not be emitted as a subrange type,
+ use the base type. */
+ else
+ {
+ type = TREE_TYPE (type);
+ low = TYPE_MIN_VALUE (type);
+ high = TYPE_MAX_VALUE (type);
+ }
+ }
+
/* If there was an input error and we don't really have a type,
avoid crashing and write something that is at least valid
by assuming `int'. */
stabstr_C (';');
}
- dbxout_range_type (type);
+ dbxout_range_type (type, low, high);
}
else
stabstr_C (';');
}
- if (print_int_cst_bounds_in_octal_p (type))
+ if (print_int_cst_bounds_in_octal_p (type, low, high))
{
stabstr_C ('r');
dbxout_type_index (type);
stabstr_C (';');
- stabstr_O (TYPE_MIN_VALUE (type));
+ stabstr_O (low);
stabstr_C (';');
- stabstr_O (TYPE_MAX_VALUE (type));
+ stabstr_O (high);
stabstr_C (';');
}
else
/* Output other integer types as subranges of `int'. */
- dbxout_range_type (type);
+ dbxout_range_type (type, low, high);
}
break;
else
{
stabstr_C ('a');
- dbxout_range_type (tem);
+ dbxout_range_type (tem, TYPE_MIN_VALUE (tem), TYPE_MAX_VALUE (tem));
}
dbxout_type (TREE_TYPE (type), 0);
int i;
tree child;
VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
-
+
if (use_gnu_debug_info_extensions)
{
if (BINFO_N_BASE_BINFOS (binfo))
should be printed in octal format. */
static bool
-print_int_cst_bounds_in_octal_p (tree type)
+print_int_cst_bounds_in_octal_p (tree type, tree low, tree high)
{
/* If we can use GDB extensions and the size is wider than a long
(the size used by GDB to read them) or we may have trouble writing
can't span same size unsigned types. */
if (use_gnu_debug_info_extensions
- && TYPE_MIN_VALUE (type) != 0
- && TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
- && TYPE_MAX_VALUE (type) != 0
- && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
+ && low && TREE_CODE (low) == INTEGER_CST
+ && high && TREE_CODE (high) == INTEGER_CST
&& (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
|| ((TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
&& TYPE_UNSIGNED (type))
dbxout_type_name (tree type)
{
tree t = TYPE_NAME (type);
-
+
gcc_assert (t);
switch (TREE_CODE (t))
{
}
case PARM_DECL:
- /* Parm decls go in their own separate chains
- and are output by dbxout_reg_parms and dbxout_parms. */
- gcc_unreachable ();
+ if (DECL_HAS_VALUE_EXPR_P (decl))
+ decl = DECL_VALUE_EXPR (decl);
+
+ /* PARM_DECLs go in their own separate chain and are output by
+ dbxout_reg_parms and dbxout_parms, except for those that are
+ disguised VAR_DECLs like Out parameters in Ada. */
+ gcc_assert (TREE_CODE (decl) == VAR_DECL);
+
+ /* ... fall through ... */
case RESULT_DECL:
case VAR_DECL:
dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
{
int letter = 0;
- STAB_CODE_TYPE code;
+ stab_code_type code;
rtx addr = 0;
int number = 0;
int regno = -1;
}
else if (MEM_P (home)
&& GET_CODE (XEXP (home, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (home, 0), 1)) == CONST_INT)
+ && CONST_INT_P (XEXP (XEXP (home, 0), 1)))
{
code = N_LSYM;
/* RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
{
tree name;
- if (DECL_CONTEXT (decl)
+ if (DECL_CONTEXT (decl)
&& (TYPE_P (DECL_CONTEXT (decl))
|| TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL))
/* One slight hitch: if this is a VAR_DECL which is a class member
emits the N_BCOMM and N_ECOMM stabs. */
static void
-dbxout_common_name (tree decl, const char *name, STAB_CODE_TYPE op)
+dbxout_common_name (tree decl, const char *name, stab_code_type op)
{
dbxout_begin_complex_stabs ();
stabstr_S (name);
rtx home;
rtx sym_addr;
const char *name = NULL;
-
- /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+
+ /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such.
-
+
??? DECL_THREAD_LOCAL_P check prevents problems with improper .stabs
for thread-local symbols. Can be handled via same mechanism as used
in dwarf2out.c. */
if (TREE_CODE (decl) != VAR_DECL
- || !TREE_PUBLIC(decl)
|| !TREE_STATIC(decl)
|| !DECL_HAS_VALUE_EXPR_P(decl)
|| DECL_THREAD_LOCAL_P (decl)
|| !is_fortran ())
return NULL;
- home = DECL_RTL (decl);
+ home = DECL_RTL (decl);
if (home == NULL_RTX || GET_CODE (home) != MEM)
return NULL;
switch (GET_CODE (sym_addr))
{
case PLUS:
- if (GET_CODE (XEXP (sym_addr, 0)) == CONST_INT)
+ if (CONST_INT_P (XEXP (sym_addr, 0)))
{
name =
targetm.strip_name_encoding(XSTR (XEXP (sym_addr, 1), 0));
{
tree eff_type;
char letter;
- STAB_CODE_TYPE code;
+ stab_code_type code;
int number;
/* Perform any necessary register eliminations on the parameter's rtl,
If that is not true, we produce meaningless results,
but do not crash. */
if (GET_CODE (inrtl) == PLUS
- && GET_CODE (XEXP (inrtl, 1)) == CONST_INT)
+ && CONST_INT_P (XEXP (inrtl, 1)))
number = INTVAL (XEXP (inrtl, 1));
else
number = 0;
that it was actually passed by invisible reference. */
code = DBX_REGPARM_STABS_CODE;
-
+
/* GDB likes this marked with a special letter. */
letter = (use_gnu_debug_info_extensions
? 'a' : DBX_REGPARM_STABS_LETTER);
continue;
dbxout_begin_complex_stabs ();
-
+
if (DECL_NAME (parms))
{
stabstr_I (DECL_NAME (parms));
{
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)