This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with breakpoints in constructors
On Tuesday 06 Jul 2004 7:00 pm, Daniel Jacobowitz wrote:
> On Tue, Jul 06, 2004 at 02:33:00AM -0400, 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 thought we used to do this.... but I can not find an example in my
> archives, so I'm probably wrong. I agree it should be fixed - for now,
> until GDB is finally fixed to stop relying on DW_AT_MIPS_linkage_name.
How will GDB search functions correctly without a mangled named? I don't think
we should stop gdb from using DW_AT_MIPS_linkage_name.
>
> In any case, that's not the problem. GDB manages to work OK with the
> debugging information it has now, with a little awkwardness. You can't
> say "break A::A", but "break 'A::A(int)'" works. The only real problem
> is the inability to handle cloned constructors, which is more of a user
> interface problem than a technical problem.
This problem occurs only with default constructors (break A::A) There are two
of them. GDB can find only one of them. GDB problem is two-fold: it detects
the presence of two constructors but a A::A search results in only one of
them both the times, so it places both breakpoints at the same place.
I believe that gdb problem may automatically get solved if gcc generates
multiple linkage names.
-Amit