From 1e985b42ebd9e1f058f28bfe4fd2625824e31740 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 2 Jan 2007 02:17:37 -0200 Subject: [PATCH] [CLASSES]: Process DW_TAG_{union,structure}_type tags in cu__process_function There are cases where just a declaration is emitted, such as in blk_rq_map_user_iov's iov parameter: <2>: Abbrev Number: 29 (DW_TAG_structure_type) DW_AT_name : (indirect string, offset: 0x3be8): sg_iovec DW_AT_declaration : 1 <2>: Abbrev Number: 88 (DW_TAG_formal_parameter) DW_AT_name : iov DW_AT_decl_file : 1 DW_AT_decl_line : 2472 DW_AT_type : DW_AT_location : 0x4288 (location list) I.e. the DW_TAG_structure_type tag is emitted at the same level as the DW_TAG_formal_parameter tags, so handled inside the cu__process_function method. This and the next cset only shows that a normalization in the parsing routines is in real demand and will be done, normalization because what needs to be done is similar to what is already done in places like cu__create_new_array, i.e. process all the siblings in a level in tag specific cu methods. Signed-off-by: Arnaldo Carvalho de Melo --- classes.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes.c b/classes.c index 4dde8f8..d3f466f 100644 --- a/classes.c +++ b/classes.c @@ -2043,6 +2043,11 @@ static void cu__process_function(Dwarf *dwarf, Dwarf_Die *die, * will be used for stack size calculation */ break; + case DW_TAG_structure_type: + case DW_TAG_union_type: + cu__create_new_class(dwarf, die, cu, tag, cu_offset, + name, type, decl_file, decl_line); + goto next_sibling; } if (dwarf_haschildren(die) != 0 && dwarf_child(die, &child) == 0)