diff options
author | David Carlton <carlton@bactrian.org> | 2004-01-28 18:43:06 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2004-01-28 18:43:06 +0000 |
commit | 5d51ca5457166b578e78a2cdad1d5812bbf315dd (patch) | |
tree | 74aaddc753e6935b49aa7718b364688ae44a7276 /gdb/dwarf2read.c | |
parent | 586196d51c6a6fe6861259d0d10fa85c78af5922 (diff) | |
download | gdb-5d51ca5457166b578e78a2cdad1d5812bbf315dd.zip gdb-5d51ca5457166b578e78a2cdad1d5812bbf315dd.tar.gz gdb-5d51ca5457166b578e78a2cdad1d5812bbf315dd.tar.bz2 |
2004-01-28 David Carlton <carlton@kealia.com>
* dwarf2read.c (add_partial_structure): Use demangled name if
namespace equals "".
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 21 |
1 files changed, 18 insertions, 3 deletions
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) |