static void dbxout_end_block PARAMS ((unsigned, unsigned));
static void dbxout_function_decl PARAMS ((tree));
-struct gcc_debug_hooks dbx_debug_hooks =
+const struct gcc_debug_hooks dbx_debug_hooks =
{
dbxout_init,
dbxout_finish,
#endif /* DBX_DEBUGGING_INFO */
#if defined (XCOFF_DEBUGGING_INFO)
-struct gcc_debug_hooks xcoff_debug_hooks =
+const struct gcc_debug_hooks xcoff_debug_hooks =
{
dbxout_init,
dbxout_finish,
const char *input_file_name;
{
char ltext_label_name[100];
- tree syms = getdecls ();
+ tree syms = (*lang_hooks.decls.getdecls) ();
asmfile = asm_out_file;
#else /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
fprintf (asmfile, "%s", ASM_STABS_OP);
output_quoted_string (asmfile, cwd);
- fprintf (asmfile, ",%d,0,0,%s\n", N_SO, <ext_label_name[1]);
+ fprintf (asmfile, ",%d,0,0,", N_SO);
+ assemble_name (asmfile, ltext_label_name);
+ fputc ('\n', asmfile);
#endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
}
}
/* Used to put `Ltext:' before the reference, but that loses on sun 4. */
fprintf (asmfile, "%s", ASM_STABS_OP);
output_quoted_string (asmfile, input_file_name);
- fprintf (asmfile, ",%d,0,0,%s\n",
- N_SO, <ext_label_name[1]);
+ fprintf (asmfile, ",%d,0,0,", N_SO);
+ assemble_name (asmfile, ltext_label_name);
+ fputc ('\n', asmfile);
text_section ();
ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
#endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
source_label_number);
fprintf (file, "%s", ASM_STABS_OP);
output_quoted_string (file, filename);
- fprintf (file, ",%d,0,0,%s\n", N_SOL, <ext_label_name[1]);
+ fprintf (asmfile, ",%d,0,0,", N_SOL);
+ assemble_name (asmfile, ltext_label_name);
+ fputc ('\n', asmfile);
if (current_function_decl != NULL_TREE
&& DECL_SECTION_NAME (current_function_decl) != NULL_TREE)
; /* Don't change section amid function. */
&& ! DECL_EXTERNAL (decl)
&& DECL_RTL_SET_P (decl)) /* Not necessary? */
dbxout_symbol (decl, 0);
-}
+}
/* At the end of compilation, finish writing the symbol table.
Unless you define DBX_OUTPUT_MAIN_SOURCE_FILE_END, the default is
}
if (!need_prefix)
{
- putc (';', asmfile);
+ putc (';', asmfile);
CHARS (1);
}
}
int full;
{
tree tem;
+ tree main_variant;
static int anonymous_type_number = 0;
if (TREE_CODE (type) == VECTOR_TYPE)
type = integer_type_node;
else
{
- /* Try to find the "main variant" with the same name but not const
- or volatile. (Since stabs does not distinguish const and volatile,
- there is no need to make them separate types. But types with
- different names are usefully distinguished.) */
-
- for (tem = TYPE_MAIN_VARIANT (type); tem; tem = TYPE_NEXT_VARIANT (tem))
- if (!TYPE_READONLY (tem) && !TYPE_VOLATILE (tem)
- && TYPE_NAME (tem) == TYPE_NAME (type))
- {
- type = tem;
- break;
- }
if (TYPE_NAME (type)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type)))
full = 0;
}
+ /* Try to find the "main variant" with the same name. */
+ if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
+ main_variant = TREE_TYPE (TYPE_NAME (type));
+ else
+ main_variant = TYPE_MAIN_VARIANT (type);
+
+ /* If we are not using extensions, stabs does not distinguish const and
+ volatile, so there is no need to make them separate types. */
+ if (!use_gnu_debug_info_extensions)
+ type = main_variant;
+
if (TYPE_SYMTAB_ADDRESS (type) == 0)
{
/* Type has no dbx number assigned. Assign next available number. */
typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_DEFINED;
- if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
- {
+ /* If this type is a variant of some other, hand off. Types with
+ different names are usefully distinguished. We only distinguish
+ cv-qualified types if we're using extensions. */
+ if (TYPE_READONLY (type) > TYPE_READONLY (main_variant))
+ {
+ putc ('k', asmfile);
+ CHARS (1);
+ dbxout_type (build_type_variant (type, 0, TYPE_VOLATILE (type)), 0);
+ return;
+ }
+ else if (TYPE_VOLATILE (type) > TYPE_VOLATILE (main_variant))
+ {
+ putc ('B', asmfile);
+ CHARS (1);
+ dbxout_type (build_type_variant (type, TYPE_READONLY (type), 0), 0);
+ return;
+ }
+ else if (main_variant != TYPE_MAIN_VARIANT (type))
+ {
+ /* 'type' is a typedef; output the type it refers to. */
dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type)), 0);
return;
}
+ /* else continue. */
switch (TREE_CODE (type))
{
write it as a subtype. */
else if (TREE_TYPE (type) != 0
&& TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE)
- dbxout_range_type (type);
+ {
+ /* If the size is non-standard, say what it is if we can use
+ GDB extensions. */
+
+ if (use_gnu_debug_info_extensions
+ && TYPE_PRECISION (type) != TYPE_PRECISION (integer_type_node))
+ {
+ have_used_extensions = 1;
+ fprintf (asmfile, "@s%d;", TYPE_PRECISION (type));
+ CHARS (5);
+ }
+
+ dbxout_range_type (type);
+ }
else
- {
+ {
/* If the size is non-standard, say what it is if we can use
GDB extensions. */
larger. This is because we print the bounds as signed decimal,
and hence they can't span same size unsigned types. */
- if (use_gnu_debug_info_extensions
+ if (use_gnu_debug_info_extensions
&& TYPE_MIN_VALUE (type) != 0
&& TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
&& TYPE_MAX_VALUE (type) != 0
else
/* Output other integer types as subranges of `int'. */
dbxout_range_type (type);
- }
+ }
break;
CHARS (digs);
}
-
+
/* Output the name of type TYPE, with no punctuation.
Such names can be set up either by typedef declarations
or by struct, enum and union tags. */
&& !TREE_ASM_WRITTEN (TYPE_NAME (type))
/* Distinguish the implicit typedefs of C++
from explicit ones that might be found in C. */
- && DECL_ARTIFICIAL (decl)
+ && DECL_ARTIFICIAL (decl)
/* Do not generate a tag for records of variable size,
since this type can not be properly described in the
DBX format, and it confuses some tools such as objdump. */
&& TYPE_NAME (type) == decl
/* Distinguish the implicit typedefs of C++
from explicit ones that might be found in C. */
- && DECL_ARTIFICIAL (decl))
+ && DECL_ARTIFICIAL (decl))
{
if (use_gnu_debug_info_extensions && have_used_extensions)
{
result = dbxout_symbol_location (decl, type, 0, DECL_RTL (decl));
break;
-
+
default:
break;
}
/* Don't mention a variable at all
if it was completely optimized into nothingness.
-
+
If the decl was from an inline function, then its rtl
is not identically the rtl that was used in this
particular compilation. */
{
rtx tmp = get_pool_constant (current_sym_addr);
- if (GET_CODE (tmp) == SYMBOL_REF)
+ if (GET_CODE (tmp) == SYMBOL_REF
+ || GET_CODE (tmp) == LABEL_REF)
current_sym_addr = tmp;
}
-
+
/* Ultrix `as' seems to need this. */
#ifdef DBX_STATIC_STAB_DATA_SECTION
data_section ();
}
/* It is quite tempting to use:
-
+
dbxout_type (TREE_TYPE (parms), 0);
as the next statement, rather than using DECL_ARG_TYPE(), so
double on the stack, but if we emit a stab saying the type is a
float, then gdb will only read in a single value, and this will
produce an erroneous value. */
- dbxout_type (DECL_ARG_TYPE (parms), 0);
+ dbxout_type (DECL_ARG_TYPE (parms), 0);
current_sym_value = DEBUGGER_ARG_OFFSET (current_sym_value, addr);
dbxout_finish_symbol (parms);
}
const char *const decl_name = (DECL_NAME (parms)
? IDENTIFIER_POINTER (DECL_NAME (parms))
: "(anon)");
- if (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 0)) == REG)
- current_sym_value = 0;
+ if (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 0)) == REG)
+ current_sym_value = 0;
else
current_sym_value
= INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1));
current_sym_addr = 0;
-
+
FORCE_TEXT;
fprintf (asmfile, "%s\"%s:v", ASM_STABS_OP, decl_name);
+
+ current_sym_value
+ = DEBUGGER_ARG_OFFSET (current_sym_value,
+ XEXP (XEXP (DECL_RTL (parms), 0), 0));
dbxout_type (TREE_TYPE (parms), 0);
dbxout_finish_symbol (parms);
}
&& TYPE_MODE (TREE_TYPE (parms)) != GET_MODE (DECL_RTL (parms))
&& GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms))) < UNITS_PER_WORD)
{
- current_sym_value +=
+ current_sym_value +=
GET_MODE_SIZE (GET_MODE (DECL_RTL (parms)))
- GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms)));
}
int blocknum = -1;
#if DBX_BLOCKS_FUNCTION_RELATIVE
- const char *begin_label;
+ const char *begin_label;
if (current_function_func_begin_label != NULL_TREE)
begin_label = IDENTIFIER_POINTER (current_function_func_begin_label);
else