aboutsummaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 4c4a61a6b6b..1b04d0eb163 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -124,6 +124,13 @@ Boston, MA 02111-1307, USA. */
#define FILE_NAME_JOINER "/"
#endif
+/* GDB needs to know that the stabs were generated by GCC. We emit an
+ N_OPT stab at the beginning of the source file to indicate this.
+ The string is historical, and different on a very few targets. */
+#ifndef STABS_GCC_MARKER
+#define STABS_GCC_MARKER "gcc2_compiled."
+#endif
+
/* Nonzero means if the type has methods, only output debugging
information if methods are actually written to the asm file. This
optimization only works if the debugger can detect the special C++
@@ -176,6 +183,11 @@ static int source_label_number = 1;
#ifndef N_CATCH
#define N_CATCH 0x54
#endif
+
+/* This is a Solaris extension we need to reference in this file. */
+#ifndef N_OPT
+#define N_OPT 0x3c
+#endif
#endif
#ifdef __GNU_STAB__
@@ -416,11 +428,12 @@ dbxout_init (asm_file, input_file_name, syms)
ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
#endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
- /* Possibly output something to inform GDB that this compilation was by
- GCC. It's easier for GDB to parse it when after the N_SO's. This
- is used in Solaris 2. */
-#ifdef ASM_IDENTIFY_GCC_AFTER_SOURCE
- ASM_IDENTIFY_GCC_AFTER_SOURCE (asmfile);
+#ifdef DBX_OUTPUT_GCC_MARKER
+ DBX_OUTPUT_GCC_MARKER (asmfile);
+#else
+ /* Emit an N_OPT stab to indicate that this file was compiled by GCC. */
+ fprintf (asmfile, "%s\"%s\",%d,0,0,0\n",
+ ASM_STABS_OP, STABS_GCC_MARKER, N_OPT);
#endif
lastfile = input_file_name;
@@ -833,15 +846,25 @@ dbxout_type_methods (type)
{
/* This is the "mangled" name of the method.
It encodes the argument types. */
- const char *debug_name =
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl));
+ const char *debug_name;
int show_arg_types = 0;
+ /* Skip methods that aren't FUNCTION_DECLs. (In C++, these
+ include TEMPLATE_DECLs.) The debugger doesn't know what
+ to do with such entities anyhow. */
+ if (TREE_CODE (fndecl) != FUNCTION_DECL)
+ continue;
+
+ debug_name =
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl));
+
CONTIN;
last = fndecl;
- if (DECL_IGNORED_P (fndecl))
+ /* Also ignore abstract methods; those are only interesting to
+ the DWARF backends. */
+ if (DECL_IGNORED_P (fndecl) || DECL_ABSTRACT (fndecl))
continue;
if (flag_minimal_debug)
@@ -1925,7 +1948,7 @@ dbxout_symbol (decl, local)
case RESULT_DECL:
/* Named return value, treat like a VAR_DECL. */
case VAR_DECL:
- if (DECL_RTL (decl) == 0)
+ if (! DECL_RTL_SET_P (decl))
return 0;
/* Don't mention a variable that is external.
Let the file that defines it describe it. */
@@ -1969,7 +1992,7 @@ dbxout_symbol (decl, local)
/* else it is something we handle like a normal variable. */
}
- DECL_RTL (decl) = eliminate_regs (DECL_RTL (decl), 0, NULL_RTX);
+ SET_DECL_RTL (decl, eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
leaf_renumber_regs_insn (DECL_RTL (decl));
@@ -2159,7 +2182,15 @@ dbxout_symbol_location (decl, type, suffix, home)
}
else if (GET_CODE (home) == CONCAT)
{
- tree subtype = TREE_TYPE (type);
+ tree subtype;
+
+ /* If TYPE is not a COMPLEX_TYPE (it might be a RECORD_TYPE,
+ for example), then there is no easy way to figure out
+ what SUBTYPE should be. So, we give up. */
+ if (TREE_CODE (type) != COMPLEX_TYPE)
+ return 0;
+
+ subtype = TREE_TYPE (type);
/* If the variable's storage is in two parts,
output each as a separate stab with a modified name. */
@@ -2305,7 +2336,7 @@ dbxout_parms (parms)
so that the debugging output will be accurate. */
DECL_INCOMING_RTL (parms)
= eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
- DECL_RTL (parms) = eliminate_regs (DECL_RTL (parms), 0, NULL_RTX);
+ SET_DECL_RTL (parms, eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
{