re PR debug/49047 (DW_AT_linkage_name missing for constructors and destructors)

Fix PR debug/49047

gcc/

	* dwarf2out.c (gen_subprogram_die): Emit linkage name attribute
	for concrete functions containing the code of cloned functions.

gcc/testsuite/

	* g++.dg/debug/dwarf2/cdtor-1.C: New test.

From-SVN: r174474
This commit is contained in:
Dodji Seketeli 2011-05-31 12:17:21 +00:00 committed by Dodji Seketeli
parent 6e8c8b2300
commit 8d8a3bda40
4 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-05-31 Dodji Seketeli <dodji@redhat.com>
PR debug/49047
* dwarf2out.c (gen_subprogram_die): Emit linkage name attribute
for concrete functions containing the code of cloned functions.
2011-05-31 Richard Guenther <rguenther@suse.de> 2011-05-31 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (forward_propagate_into_comparison): Rename * tree-ssa-forwprop.c (forward_propagate_into_comparison): Rename

View File

@ -19636,6 +19636,12 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
subr_die = new_die (DW_TAG_subprogram, context_die, decl); subr_die = new_die (DW_TAG_subprogram, context_die, decl);
add_abstract_origin_attribute (subr_die, origin); add_abstract_origin_attribute (subr_die, origin);
/* This is where the actual code for a cloned function is.
Let's emit linkage name attribute for it. This helps
debuggers to e.g, set breakpoints into
constructors/destructors when the user asks "break
K::K". */
add_linkage_name (subr_die, decl);
} }
else if (old_die) else if (old_die)
{ {

View File

@ -1,3 +1,8 @@
2011-05-31 Dodji Seketeli <dodji@redhat.com>
PR debug/49047
* g++.dg/debug/dwarf2/cdtor-1.C: New test.
2011-05-31 Ira Rosen <ira.rosen@linaro.org> 2011-05-31 Ira Rosen <ira.rosen@linaro.org>
PR testsuite/49239 PR testsuite/49239

View File

@ -0,0 +1,17 @@
// origin PR debug/49047
// { dg-options "-g -dA" }
// { dg-do compile }
struct K
{
K () { }
~K () { }
};
int
main()
{
K k;
}
// { dg-final {scan-assembler-times "\[^\n\r\]*DW_AT_MIPS_linkage_name:" 2 } }