This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with breakpoints in constructors
- From: "Amit S. Kale" <amitkale at linsyssoft dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc at gcc dot gnu dot org,drow at mvista dot com,Christopher Faylor <christopher dot faylor at timesys dot com>
- Date: Tue, 3 Aug 2004 19:58:30 +0530
- Subject: Re: Problems with breakpoints in constructors
- Organization: LinSysSoft Technologies Pvt Ltd
- References: <200407061124.38139.amitkale@linsyssoft.com> <xypy8lxbq77.fsf@miranda.boston.redhat.com>
On Tuesday 06 Jul 2004 12:03 pm, Jason Merrill wrote:
> On Tue, 6 Jul 2004 11:24:37 +0530, "Amit S. Kale" <amitkale@linsyssoft.com>
wrote:
> > Mangled names are emitted in debugging information generated in the
> > function add_name_and_src_coords_attributes. They are emitted as
> > attribute DW_AT_MIPS_linkage_name. This attribute is emitted for all
> > member functions except for constructors. It's not emitted when
> > DECL_ABSTRACT is true, which applies to constructors.
>
> ...which applies to the abstract instance of constructors. This should in
> turn be referenced by two concrete instances, which should have
> DW_AT_MIPS_linkage_name.
>
> > This hack generates DW_AT_MIPS_linkage_name for only one attribute.
> > add_name_and_src_coords_attributes is not called for second instance of
> > the constructor since both these constructors are instance of an abstract
> > declaration, for which add_name_and_src_coords_attributes has been called
> > at the time of first instance.
>
> That's a bug; since we (correctly) aren't attaching the linkage name to the
> abstract instance, we need to attach it to the concrete instances.
I found that the generation of a die for default constructors (any members
that have an abstract origin) is suppressed in gen_member_die. I did the
change given below and could get DW_TAG_subprogram for both default
constructors. The die included DW_AT_MIPS_linkage_name attrib also.
--- package/gcc/dwarf2out.c 2003-10-01 22:28:30.000000000 +0530
+++ dwarf2out.c 2004-08-03 19:54:20.000000000 +0530
@@ -11334,10 +11334,6 @@ gen_member_die (type, context_die)
/* Now output info about the function members (if any). */
for (member = TYPE_METHODS (type); member; member = TREE_CHAIN (member))
{
- /* Don't include clones in the member list. */
- if (DECL_ABSTRACT_ORIGIN (member))
- continue;
-
child = lookup_decl_die (member);
if (child)
splice_child_die (context_die, child);
Does this change appear ok?
-Amit