Commit 7842a9db by Dodji Seketeli Committed by Dodji Seketeli

re PR debug/41170 (namespace DIE not generated when it contains only a typedef)

Fix for PR debug/41170

gcc/ChangeLog:
	PR debug/41770
	* dwarf2out.c (get_context_die): Declare this static function.
	(gen_type_die_with_usage): Make sure a DIE is a generated for
	the context of a typedef.

gcc/testsuite/ChangeLog:
	PR debug/41770
	* debug/dwarf2/namespace-1.C: New test.

From-SVN: r151138
parent 3d1be5be
2009-08-27 Dodji Seketeli <dodji@redhat.com>
PR debug/41770
* dwarf2out.c (get_context_die): Declare this static function.
(gen_type_die_with_usage): Make sure a DIE is a generated for
the context of a typedef.
2009-08-26 Anatoly Sokolov <aesok@post.ru> 2009-08-26 Anatoly Sokolov <aesok@post.ru>
* doc/invoke.texi (AVR Options): Remove documentation of -minit-stack * doc/invoke.texi (AVR Options): Remove documentation of -minit-stack
......
...@@ -5887,6 +5887,7 @@ static void gen_type_die (tree, dw_die_ref); ...@@ -5887,6 +5887,7 @@ static void gen_type_die (tree, dw_die_ref);
static void gen_block_die (tree, dw_die_ref, int); static void gen_block_die (tree, dw_die_ref, int);
static void decls_for_scope (tree, dw_die_ref, int); static void decls_for_scope (tree, dw_die_ref, int);
static int is_redundant_typedef (const_tree); static int is_redundant_typedef (const_tree);
static inline dw_die_ref get_context_die (tree);
static void gen_namespace_die (tree, dw_die_ref); static void gen_namespace_die (tree, dw_die_ref);
static void gen_decl_die (tree, tree, dw_die_ref); static void gen_decl_die (tree, tree, dw_die_ref);
static dw_die_ref force_decl_die (tree); static dw_die_ref force_decl_die (tree);
...@@ -15436,7 +15437,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, ...@@ -15436,7 +15437,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
the type description DIE we want to generate. */ the type description DIE we want to generate. */
if (DECL_CONTEXT (TYPE_NAME (type)) if (DECL_CONTEXT (TYPE_NAME (type))
&& TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL) && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL)
context_die = lookup_decl_die (DECL_CONTEXT (TYPE_NAME (type))); context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
TREE_ASM_WRITTEN (type) = 1; TREE_ASM_WRITTEN (type) = 1;
gen_decl_die (TYPE_NAME (type), NULL, context_die); gen_decl_die (TYPE_NAME (type), NULL, context_die);
......
2009-08-27 Dodji Seketeli <dodji@redhat.com>
PR debug/41770
* debug/dwarf2/namespace-1.C: New test.
2009-08-26 H.J. Lu <hongjiu.lu@intel.com> 2009-08-26 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/41162 PR fortran/41162
......
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/41170
// { dg-options "-g -dA" }
//
// We want to test that there is a DW_TAG_namespace DIE DW_AT_name is set
// to "not_emitted". That namespace die has a child DW_TAG_typedef DIE
// which DW_AT_name is the null terminated string "T".
// { dg-final { scan-assembler-times "DIE +\\(.*?\\) DW_TAG_namespace" 1 } }
// { dg-final { scan-assembler-times "DW_AT_name: \"not_emitted\"" 1 } }
// { dg-final { scan-assembler-times "DIE +\\(.*?\\) DW_TAG_typedef" 1 } }
// { dg-final { scan-assembler-times "\.ascii \"T.0\"\[\t \]+# DW_AT_name" 1 } }
struct strukt
{
int m;
};
namespace not_emitted
{
typedef strukt T;
}
int
main()
{
not_emitted::T t;
t.m = 0;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment