This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
multiple location in C++ constructors
- From: Denis PILAT <denis dot pilat at st dot com>
- To: gdb at sourceware dot org
- Date: Tue, 14 Oct 2008 17:12:55 +0200
- Subject: multiple location in C++ constructors
We (at ST) have a compiler that generates DW_AT_MIPS_linkage_name
attributes for constructors.
Unfortunately, that prevents breakpoint in constructor to have multiple
locations since the gdb heuristics eliminates one location in the
expand_line_sal_maybe() function of breakpoint.c: see bellow, we go thru
the remove_sal () line.
(from breakpoint.c)
struct symtabs_and_lines
expand_line_sal_maybe (struct symtab_and_line sal)
...
if (find_pc_partial_function (pc, &this_function,
&func_addr, &func_end))
{
if (this_function &&
strcmp (this_function, original_function) != 0)
{
remove_sal (&expanded, i);
--i;
}
else if (func_addr == pc)
...
If present into dwarf2 debug information, the find_pc_partial_function()
returns the DW_AT_MIPS_linkage_name in this_function, which is alway
different from the original_function. Therefore there is always only one
location for constructor breakpoints since the DW_AT_MIPS_linkage_name
is filled with the mangled function name.
My question is:
Is the GDB heuristic to find multiple location for breakpoint wrong ?
Or is the DW_AT_MIPS_linkage_name attribute for constructors useless in
debug informations ?
Thanks for your feedback
Denis