From: David Carlton Date: Wed, 28 Jan 2004 18:43:06 +0000 (+0000) Subject: 2004-01-28 David Carlton X-Git-Tag: gprof-pre-ansify-2004-05-26~1470 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d51ca5457166b578e78a2cdad1d5812bbf315dd;p=platform%2Fupstream%2Fbinutils.git 2004-01-28 David Carlton * dwarf2read.c (add_partial_structure): Use demangled name if namespace equals "". --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0fd1ca1..22ccff3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-01-28 David Carlton + + * dwarf2read.c (add_partial_structure): Use demangled name if + namespace equals "". + 2004-01-27 Jim Blandy Clean up misapplied patch: diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index c5fbd5d..9fe77d3 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1661,12 +1661,12 @@ add_partial_structure (struct partial_die_info *struct_pdi, char *info_ptr, char *actual_class_name = NULL; if (cu->language == language_cplus - && namespace == NULL + && (namespace == NULL || namespace[0] == '\0') && struct_pdi->name != NULL && struct_pdi->has_children) { - /* We don't have namespace debugging information, so see if we - can figure out if this structure lives in a namespace. Look + /* See if we can figure out if the class lives in a namespace + (or is nested within another class.) We do this by looking for a member function; its demangled name will contain namespace info, if there is any. */ @@ -1676,6 +1676,21 @@ add_partial_structure (struct partial_die_info *struct_pdi, char *info_ptr, could fix this by only using the demangled name to get the prefix (but see comment in read_structure_scope). */ + /* FIXME: carlton/2004-01-23: If NAMESPACE equals "", we have + the appropriate debug information, so it would be nice to be + able to avoid this hack. But NAMESPACE may not be the + namespace where this class was defined: NAMESPACE reflects + where STRUCT_PDI occurs in the tree of dies, but because of + DW_AT_specification, that may not actually tell us where the + class is defined. (See the comment in read_func_scope for an + example of how this could occur.) + + Unfortunately, our current partial symtab data structures are + completely unable to deal with DW_AT_specification. So, for + now, the best thing to do is to get nesting information from + places other than the tree structure of dies if there's any + chance that a DW_AT_specification is involved. :-( */ + char *next_child = info_ptr; while (1)