This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch][C++/debug] SDB_DEBUG (-gcoff) vs record_builtin_type vsGAS - refresh
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Oct 2004 12:36:44 +1300
- Subject: Re: [Patch][C++/debug] SDB_DEBUG (-gcoff) vs record_builtin_type vsGAS - refresh
- References: <20041030085524.43863.qmail@web50901.mail.yahoo.com><877jp76elt.fsf@codesourcery.com>
- Reply-to: Danny Smith <dannysmith at users dot sourceforge dot net>
Zack Weinberg wrote:
> Danny Smith writes:
>
>> This is a slightly revised version of patch submitted here:
>> http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01394.html
> ...
>
>> + /* Don't output intrinsic types. GAS chokes on SDB .def
>> + statements that contain identifiers with embedded spaces
>> + (eg "unsigned long"). */
>> + if (DECL_IS_BUILTIN (decl))
>> + return;
>
> I'm not totally sure that DECL_IS_BUILTIN is the right bit to be
> checking. Can you please check that there's no other kind of
> TYPE_DECL node that gets this bit set?
>
DECL_IS_BUILTIN (decl) expands to
#ifdef USE_MAPPED_LOCATION
#define DECL_IS_BUILTIN(DECL) \
(DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
#else
#define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0)
#endif
A grep for DECL_IS_BUILTIN finds the macro is always used as its name
indicates. The only things that I could find that might suggest
a problem with its usage in sdbout.c are these in
dwarf2out.c (dwarf2out_decl):
/* Don't bother trying to generate any DIEs to represent any of
the
normal built-in types for the language we are compiling. */
if (DECL_IS_BUILTIN (decl))
{
/* OK, we need to generate one for `bool' so GDB knows what type
comparisons have. */
if ((get_AT_unsigned (comp_unit_die, DW_AT_language)
== DW_LANG_C_plus_plus)
&& TREE_CODE (TREE_TYPE (decl)) == BOOLEAN_TYPE
&& ! DECL_IGNORED_P (decl))
modified_type_die (TREE_TYPE (decl), 0, 0, NULL);
return;
}
Should we make a special exception for 'bool' in sdbout.c too?
and this comment in function.c (init_function_start)
/* ... Also tell final how to output a linenum before the
function prologue. Note linenums could be missing, e.g. when
compiling a Java .class file. */
if (! DECL_IS_BUILTIN (subr))
emit_line_note (DECL_SOURCE_LOCATION (subr));
Danny
> zw