summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorAleksandar Ristovski <aristovski@qnx.com>2008-05-05 14:37:32 +0000
committerAleksandar Ristovski <aristovski@qnx.com>2008-05-05 14:37:32 +0000
commitd67b8a4bc0377328cf5478375a250bdfd2f23427 (patch)
tree6f7f7613805a74a5b97ce14d3b2c02049dea5a29 /gdb/dwarf2read.c
parentf17c372c0002aea6ed33212b5eb1192ab9388b41 (diff)
downloadgdb-d67b8a4bc0377328cf5478375a250bdfd2f23427.tar.gz
* ada-lang.c: Update throughout to use symbol_matches_domain
instead of matching the symbol domain explictly. * dwarf2read.c (add_partial_symbol): Do not add new psym for STRUCT_DOMAIN. Make sure you recognize c++ struct and java and ada class as typedefs. See lookup_partial_symbol function. (new_symbol): Similar to add_partial_symbol, do not create symbol for the typedef. See lookup_block_symbol. * symtab.c (symbol_matches_domain): New function, takes care of dual meaning of STRUCT_DOMAIN symbol for c++, ada and java. (lookup_partial_symbol): Use symbol_matches_domain to see if the found psym domain matches the given domain. (lookup_block_symbol): Likewise.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 13571789c1f..4f1cb1e3296 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2066,16 +2066,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
: &objfile->static_psymbols,
0, (CORE_ADDR) 0, cu->language, objfile);
- if (cu->language == language_cplus
- || cu->language == language_java
- || cu->language == language_ada)
- {
- /* For C++ and Java, these implicitly act as typedefs as well. */
- add_psymbol_to_list (actual_name, strlen (actual_name),
- VAR_DOMAIN, LOC_TYPEDEF,
- &objfile->global_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
- }
break;
case DW_TAG_enumerator:
add_psymbol_to_list (actual_name, strlen (actual_name),
@@ -7565,23 +7555,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
/* The semantics of C++ state that "struct foo { ... }" also
defines a typedef for "foo". A Java class declaration also
- defines a typedef for the class. Synthesize a typedef symbol
- so that "ptype foo" works as expected. */
+ defines a typedef for the class. */
if (cu->language == language_cplus
|| cu->language == language_java
|| cu->language == language_ada)
{
- struct symbol *typedef_sym = (struct symbol *)
- obstack_alloc (&objfile->objfile_obstack,
- sizeof (struct symbol));
- *typedef_sym = *sym;
- SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
/* The symbol's name is already allocated along with
this objfile, so we don't need to duplicate it for
the type. */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
- add_symbol_to_list (typedef_sym, list_to_add);
}
}
break;