/* Output Dwarf format symbol table information from the GNU C compiler.
- Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 2002,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
This file is part of GCC.
The generation of DWARF debugging information by the GNU version 2.x C
compiler has now been tested rather extensively for m88k, i386, i860, and
- Sparc targets. The DWARF output of the GNU C compiler appears to inter-
+ SPARC targets. The DWARF output of the GNU C compiler appears to inter-
operate well with the standard SVR4 SDB debugger on these kinds of target
systems (but of course, there are no guarantees).
is required by the current DWARF draft specification.
Specifically, the current DWARF draft specification seems to require that
- the type of an non-unsigned integral bit-field member of a struct or union
+ the type of a non-unsigned integral bit-field member of a struct or union
type be represented as either a "signed" type or as a "plain" type,
depending upon the exact set of keywords that were used in the
type specification for the given bit-field member. It was felt (by the
*/
#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#ifdef DWARF_DEBUGGING_INFO
-#include "system.h"
#include "dwarf.h"
#include "tree.h"
#include "flags.h"
#include "toplev.h"
#include "tm_p.h"
#include "debug.h"
+#include "target.h"
#include "langhooks.h"
/* NOTE: In the comments in this file, many references are made to
fprintf ((FILE), "%s", reg_names[REGNO (RTX)])
#endif
-/* Define a macro which returns non-zero for any tagged type which is
+/* Define a macro which returns nonzero for any tagged type which is
used (directly or indirectly) in the specification of either some
function's return type or some formal parameter of some function.
We use this macro when we are operating in "terse" mode to help us
for these nodes. For now, we have to just fake it. It it safe for
us to simply return zero for all complete tagged types (which will
get forced out anyway if they were used in the specification of some
- formal or return type) and non-zero for all incomplete tagged types.
+ formal or return type) and nonzero for all incomplete tagged types.
*/
#define TYPE_USED_FOR_FUNCTION(tagged_type) (TYPE_SIZE (tagged_type) == 0)
-/* Define a macro which returns non-zero for a TYPE_DECL which was
+/* Define a macro which returns nonzero for a TYPE_DECL which was
implicitly generated for a tagged type.
Note that unlike the gcc front end (which generates a NULL named
#define PENDING_SIBLINGS_INCREMENT 64
-/* Non-zero if we are performing our file-scope finalization pass and if
+/* Nonzero if we are performing our file-scope finalization pass and if
we should force out Dwarf descriptions of any and all file-scope
tagged types which are still incomplete types. */
static void dwarfout_end_source_file_check PARAMS ((unsigned));
static void dwarfout_begin_block PARAMS ((unsigned, unsigned));
static void dwarfout_end_block PARAMS ((unsigned, unsigned));
-static void dwarfout_end_epilogue PARAMS ((void));
+static void dwarfout_end_epilogue PARAMS ((unsigned int, const char *));
static void dwarfout_source_line PARAMS ((unsigned int, const char *));
-static void dwarfout_end_prologue PARAMS ((unsigned int));
+static void dwarfout_end_prologue PARAMS ((unsigned int, const char *));
static void dwarfout_end_function PARAMS ((unsigned int));
static void dwarfout_function_decl PARAMS ((tree));
static void dwarfout_global_decl PARAMS ((tree));
#ifndef FILE_ASM_OP
#define FILE_ASM_OP "\t.file\t"
#endif
-#ifndef VERSION_ASM_OP
-#define VERSION_ASM_OP "\t.version\t"
-#endif
#ifndef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
#endif
stock m88k/svr4 assembler, both of which need to see .L at the start of
a label in order to prevent that label from going into the linker symbol
table). When I get time, I'll have to fix this the right way so that we
- will use ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_INTERNAL_LABEL herein,
+ will use ASM_GENERATE_INTERNAL_LABEL and (*targetm.asm_out.internal_label) herein,
but that will require a rather massive set of changes. For the moment,
the following definitions out to produce the right results for all svr4
and svr3 assemblers. -- rfg
#ifndef BOUND_END_LABEL_FMT
#define BOUND_END_LABEL_FMT "*.L_b%u_%u_%c_e"
#endif
-#ifndef DERIV_BEGIN_LABEL_FMT
-#define DERIV_BEGIN_LABEL_FMT "*.L_d%u"
-#endif
-#ifndef DERIV_END_LABEL_FMT
-#define DERIV_END_LABEL_FMT "*.L_d%u_e"
-#endif
-#ifndef SL_BEGIN_LABEL_FMT
-#define SL_BEGIN_LABEL_FMT "*.L_sl%u"
-#endif
-#ifndef SL_END_LABEL_FMT
-#define SL_END_LABEL_FMT "*.L_sl%u_e"
-#endif
#ifndef BODY_BEGIN_LABEL_FMT
#define BODY_BEGIN_LABEL_FMT "*.L_b%u"
#endif
dwarfout_global_decl,
dwarfout_deferred_inline_function,
debug_nothing_tree, /* outlining_inline_function */
- debug_nothing_rtx /* label */
+ debug_nothing_rtx, /* label */
+ debug_nothing_int /* handle_pch */
};
\f
/************************ general utility functions **************************/
return type;
}
-/* Return non-zero if the given type node represents a tagged type. */
+/* Return nonzero if the given type node represents a tagged type. */
static inline int
is_tagged_type (type)
write_modifier_bytes_1 (type, decl_const, decl_volatile, 0);
}
\f
-/* Given a pointer to an arbitrary ..._TYPE tree node, return non-zero if the
+/* Given a pointer to an arbitrary ..._TYPE tree node, return nonzero if the
given input type is a Dwarf "fundamental" type. Otherwise return zero. */
static inline int
which is actually within the array. That's *not* necessarily the
same as the zeroth element of the array. */
-#ifdef ASM_SIMPLIFY_DWARF_ADDR
- rtl = ASM_SIMPLIFY_DWARF_ADDR (rtl);
-#endif
+ rtl = (*targetm.delegitimize_address) (rtl);
switch (GET_CODE (rtl))
{
}
#if 0
+#ifndef SL_BEGIN_LABEL_FMT
+#define SL_BEGIN_LABEL_FMT "*.L_sl%u"
+#endif
+#ifndef SL_END_LABEL_FMT
+#define SL_END_LABEL_FMT "*.L_sl%u_e"
+#endif
+
static inline void
string_length_attribute (upper_bound)
tree upper_bound;
output_inheritance_die (arg)
void *arg;
{
- tree binfo = arg;
+ tree binfo = ((tree *)arg)[0];
+ tree access = ((tree *)arg)[1];
ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inheritance);
sibling_attribute ();
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
- if (TREE_VIA_PUBLIC (binfo))
+ if (access == access_public_node)
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_public);
ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
}
- else if (TREE_VIA_PROTECTED (binfo))
+ else if (access == access_protected_node)
{
ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_protected);
ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
TREE_ASM_WRITTEN (type) = 1;
}
-/* Return non-zero if it is legitimate to output DIEs to represent a
+/* Return nonzero if it is legitimate to output DIEs to represent a
given type while we are generating the list of child DIEs for some
DIE (e.g. a function or lexical block DIE) associated with a given scope.
if (COMPLETE_TYPE_P (type))
{
+ tree binfo = TYPE_BINFO (type);
+
/* First output info about the base classes. */
- if (TYPE_BINFO (type) && TYPE_BINFO_BASETYPES (type))
+ if (binfo)
{
- register tree bases = TYPE_BINFO_BASETYPES (type);
- register int n_bases = TREE_VEC_LENGTH (bases);
+ tree bases = BINFO_BASETYPES (binfo);
+ tree accesses = BINFO_BASEACCESSES (binfo);
+ register int n_bases = BINFO_N_BASETYPES (binfo);
register int i;
for (i = 0; i < n_bases; i++)
{
- tree binfo = TREE_VEC_ELT (bases, i);
+ tree arg[2];
+
+ arg[0] = TREE_VEC_ELT (bases, i);
+ arg[1] = (accesses ? TREE_VEC_ELT (accesses, i)
+ : access_public_node);
output_type (BINFO_TYPE (binfo), containing_scope);
- output_die (output_inheritance_die, binfo);
+ output_die (output_inheritance_die, arg);
}
}
to their home locations). */
static void
-dwarfout_end_prologue (line)
+dwarfout_end_prologue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
+ const char *file ATTRIBUTE_UNUSED;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
has been generated. */
static void
-dwarfout_end_epilogue ()
+dwarfout_end_epilogue (line, file)
+ unsigned int line ATTRIBUTE_UNUSED;
+ const char *file ATTRIBUTE_UNUSED;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
dwarfout_init (main_input_filename)
const char *main_input_filename;
{
+ warning ("support for the DWARF1 debugging format is deprecated");
+
/* Remember the name of the primary input file. */
primary_filename = main_input_filename;
char *dirname;
if (!pwd)
- fatal_io_error ("can't get current directory");
+ fatal_error ("can't get current directory: %m");
dirname = concat (pwd, "/", NULL);
ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);