aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
AgeCommit message (Collapse)AuthorFilesLines
2004-03-052004-03-05 David Carlton <carlton@kealia.com>David Carlton1-1/+1
* cp-namespace.c (cp_lookup_transparent_type_loop): Fix recursion bug. 2004-03-05 David Carlton <carlton@kealia.com> * gdb.cp/rtti.exp: Add 'print *obj3' test. * gdb.cp/rtti.h: Update copyright. (namespace n2::n3): New. * gdb.cp/rtti1.cc: (refer_to (n2::n3::C3 *)): New. (n2::n3::func3): New. (main): Call n2::n3::func3. * gdb.cp/rtti2.cc: Update copyright. (n2::create3): New.
2004-02-09 * cp-namespace.c (check_one_possible_namespace_symbol): Don't useDaniel Jacobowitz1-10/+12
obstack_free.
2004-02-072004-02-07 Elena Zannoni <ezannoni@redhat.com>Elena Zannoni1-9/+9
* buildsym.c (free_pending_blocks, finish_block) (record_pending_block, make_blockvector, end_symtab): Replace symbol_obstack with objfile_obstack. * coffread.c (process_coff_symbol, coff_read_struct_type) (coff_read_enum_type): Ditto. * cp-namespace.c (initialize_namespace_symtab) (check_one_possible_namespace_symbol): Ditto. * dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file) (dwarf2_symbol_mark_computed): Ditto. * dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto. * elfread.c (elf_symtab_read): Ditto. * hpread.c (hpread_symfile_init, hpread_symfile_init) (hpread_read_enum_type, hpread_read_function_type) (hpread_read_doc_function_type, hpread_process_one_debug_symbol): Ditto. * jv-lang.c (get_java_class_symtab, add_class_symbol) (java_link_class_type): Ditto. * mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab) (new_symbol): Ditto. * minsyms.c (install_minimal_symbols): Ditto. * objfiles.c (allocate_objfile): Remove init of symbol_obstack. (terminate_minimal_symbol_table): Replace symbol_obstack with objfile_obstack. (free_objfile): Remove freeing of symbol_obstack. * objfiles.h: Remove symbol_obstack field. * pa64solib.c (add_to_solist): Replace symbol_obstack with objfile_obstack. * solib-sunos.c (allocate_rt_common_objfile): Remove init of symbol_obstack. (solib_add_common_symbols): Replace symbol_obstack with objfile_obstack. * somsolib.c (som_solib_add): Ditto. * stabsread.c (patch_block_stabs, define_symbol, read_enum_type) (common_block_start, common_block_end): Ditto. * symfile.c (reread_symbols): Remove freeing and init of symbol_obstack. (allocate_symtab): Rename symbol_obstack to objfile_obstack. * symfile.h: Update comment. * symmisc.c (print_objfile_statistics): Remove symbol_obstack stats printing. * symtab.c (symbol_set_names): Replace symbol_obstack with objfile_obstack. * symtab.h (struct general_symbol_info, struct minimal_symbol): Update comments. * xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC) (init_stringtab, xcoff_initial_scan): Replace symbol_obstack with objfile_obstack.
2004-01-232004-01-23 David Carlton <carlton@kealia.com>David Carlton1-0/+73
Partial workaround for PR c++/1511: * cp-namespace.c: Include frame.h. (cp_lookup_transparent_type): New (cp_lookup_transparent_type_loop): New. * cp-support.h: Declare cp_lookup_transparent_type. * symtab.c (basic_lookup_transparent_type): Renamed from lookup_transparent_type. (lookup_transparent_type): Replace old body by a call to current_language->la_lookup_transparent_type. * symtab.h: Update copyright. Declare basic_lookup_transparent_type. * language.h: Update copyright. (struct language_defn): Add la_lookup_transparent_type. * language.c: Update copyright. (unknown_language_defn): Add basic_lookup_transparent_type. (auto_language_defn): Add basic_lookup_transparent_type. (local_language_defn): Add basic_lookup_transparent_type. * ada-lang.c: Update copyright. (ada_language_defn): Add basic_lookup_transparent_type. * c-lang.c: Update copyright. (c_language_defn): Add basic_lookup_transparent_type. (cplus_language_defn): Add basic_lookup_transparent_type. (asm_language_defn): Add basic_lookup_transparent_type. (minimal_language_defn): Add basic_lookup_transparent_type. * f-lang.c: Update copyright. (f_language_defn): Add basic_lookup_transparent_type. * jv-lang.c: Update copyright. (java_language_defn): Add basic_lookup_transparent_type. * m2-lang.c: Update copyright. (m2_language_defn): Add basic_lookup_transparent_type. * objc-lang.c: Update copyright. (objc_language_defn): Add basic_lookup_transparent_type. * p-lang.c: Update copyright. (p_language_defn): Add basic_lookup_transparent_type. * scm-lang.c: Update copyright. (scm_language_defn): Add basic_lookup_transparent_type. * Makefile.in (cp-namespace.o): Depend on frame.h. 2004-01-23 David Carlton <carlton@kealia.com> * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add test for cp_lookup_transparent_type. * gdb.cp/rtti1.cc: Update copyright. Add n2::func and refer_to; call them.
2004-01-142004-01-14 David Carlton <carlton@kealia.com>David Carlton1-15/+15
Change symbols for C++ nested types to contain the fully qualified name, if possible. (At least in the DWARF-2 case.) Partial fix for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832, c++/895. * c-exp.y: Update copyright: (qualified_type): Handle types nested within classes. * cp-namespace.c: Update comments. (cp_set_block_scope): Delete #if 0. (cp_lookup_nested_type): Handle types nested within classes. * dwarf2read.c: (scan_partial_symbols): Call add_partial_structure when appropriate. (add_partial_symbol): Add the name of the enclosing namespace to types. (pdi_needs_namespace): New. (add_partial_namespace): Tweak comment. (add_partial_structure): New. (psymtab_to_symtab_1): Initialize processing_current_prefix here... (process_die): instead of here. (read_structure_scope): Try to figure out the name of the class or namespace that the structure might be defined within. (read_enumeration): Generate fully-qualified names, if possible. (read_namespace): Don't set name to NULL. (die_specification): New. (new_symbol): Generate fully-qualified names for types. (read_type_die): Determine appropriate prefix. (determine_prefix): New. (typename_concat): New. (class_name): New. * valops.c: Update copyright. (value_aggregate_elt): Pass NOSIDE to value_struct_elt_for_reference. (value_struct_elt_for_reference): Make static, add NOSIDE parameter, call value_maybe_namespace_elt as a last resort. (value_namespace_elt): Break out code into value_maybe_namespace_elt. (value_maybe_namespace_elt): New. 2004-01-14 David Carlton <carlton@kealia.com> * gdb.cp/namespace.exp: Add tests involving classes defined within namespaces. * gdb.cp/namespace.cc (C::CClass): New. * gdb.cp/namespace1.cc: Update copyright. (C::OtherFileClass): New.
2004-01-092004-01-09 David Carlton <carlton@kealia.com>Elena Zannoni1-9/+17
Checked in by Elena Zannoni <ezannoni@redhat.com>. * dwarf2read.c (read_namespace): Pull out name-generating code into namespace_name. Rename previous_namespace to previous_prefix and processing_current_namespace to processing_current_prefix.. (namespace_name): New function. (add_partial_symbol): Substitute uses of pdi->name with actual_name. * cp-support.h: Rename processing_current_namespace to processing_current_prefix. Update copyright year. * cp-namespace.c: Rename processing_current_namespace to processing_current_prefix. Update copyright year.
2003-11-132003-11-13 David Carlton <carlton@kealia.com>David Carlton1-1/+1
* cp-namespace.c (lookup_namespace_scope): Fix typo in comment.
2003-11-13* cp-namespace.c: Doc fix.Jim Blandy1-1/+1
2003-09-252003-09-25 David Carlton <carlton@kealia.com>David Carlton1-0/+35
* c-exp.y: Include cp-support.h. Add qualified_type. (yylex): Delete nested type hack; add comments. * cp-namespace.c (cp_lookup_nested_type): New function. * cp-support.h: Declare cp_lookup_nested_type. * eval.c (evaluate_subexp_standard): Call value_aggregate_elt instead of value_struct_elt_for_reference. * valops.c: Include cp-support.h. (value_aggregate_elt): New function. (value_namespace_elt): Ditto. (value_struct_elt_for_reference): Make static. * value.h: Delete declaration of value_struct_elt_for_reference; add declaration for value_aggregate_elt. * Makefile.in (c-exp.tab.o): Depend on $(cp_support_h). (valops.o): Ditto. 2003-09-25 David Carlton <carlton@kealia.com> * gdb.cp/namespace.exp: Tweak comments. Add non-quoted versions of some print tests, where appropriate. Add tests for C::D::cd, E::ce, F::cXfX, G::XgX. * gdb.cp/namespace.cc: Add XgX, cXfX, ce.
2003-09-112003-09-11 David Carlton <carlton@kealia.com>David Carlton1-5/+293
* gdbtypes.h: Add TYPE_CODE_NAMESPACE. * gdbtypes.c (init_type): Handle TYPE_CODE_NAMESPACE. (recursive_dump_type): Ditto. * printcmd.c (print_formatted): Ditto. * typeprint.c (print_type_scalar): Ditto. * c-typeprint.c (c_type_print_varspec_prefix): Ditto. (c_type_print_varspec_suffix, c_type_print_base): Ditto. * cp-support.h: Declare cp_check_possible_namespace_symbols, maint_cplus_cmd_list. * cp-support.c: Make maint_cplus_cmd_list extern. * cp-namespace.c: Include objfiles.h, gdbtypes.h, dictionary.h, command.h. (lookup_symbol_file): Look in possible namespace blocks when appropriate. (initialize_namespace_symtab): New. (get_possible_namespace_block, free_namespace_block) (check_possible_namespace_symbols) (check_possible_namespace_symbols_loop) (check_one_possible_namespace_symbol) (lookup_possible_namespace_symbol, maintenance_cplus_namespace) (_initialize_cp_namespace): Ditto. * block.h: Declare allocate_block. * block.c (allocate_block): New. * jv-lang.c (get_java_class_symtab): Allocate blocks via allocate_block. * symfile.h: Update declaration of add_psymbol_to_list. * symfile.c (add_psymbol_to_list): Return the partial symbol in question. * dwarf2read.c (dwarf2_build_psymtabs_hard): Add argument to scan_partial_symbols_call. (scan_partial_symbols): Add NAMESPACE argument; update calls to helper functions. (add_partial_symbol): If necessary, scan mangled names for names of namespaces. (add_partial_namespace): Add NAMESPACE argument; generate partial symbols associated to namespaces. (add_partial_enumeration): Add NAMESPACE argument. (new_symbol): Allow namespace syms. (read_namespace): Generate namespace syms. * objfiles.h: Add opaque declaration of struct symtab. (struct objfile): Add cp_namespace_symtab member. * objfiles.c (allocate_objfile): Set objfile->cp_namespace_symtab. * Makefile.in (cp-namespace.o): Depend on objfiles_h, gdbtypes_h, dictionary_h, command_h. 2003-09-11 David Carlton <carlton@kealia.com> * gdb.c++/namespace.exp: Add tests for namespace types. * gdb.c++/maint.exp (test_help): Test 'help maint cp namespace'. (test_namespace): New.
2003-06-132003-06-12 David Carlton <carlton@kealia.com>David Carlton1-0/+10
* cp-namespace.c (cp_set_block_scope): Comment out processing_has_namespace_info branch.
2003-05-202003-05-19 David Carlton <carlton@bactrian.org>David Carlton1-1/+190
Partial fix for PR c++/827. * cp-support.h: Include symtab.h. Declare cp_lookup_symbol_nonlocal, cp_lookup_symbol_namespace. * cp-namespace.c: Update contributors. (cp_lookup_symbol_nonlocal): New. (lookup_namespace_scope, cp_lookup_symbol_namespace) (lookup_symbol_file): Ditto. * c-lang.c (cplus_language_defn): Use cp_lookup_symbol_nonlocal. * block.h: Declare block_scope, block_using, block_global_block. * block.c (block_scope): New. (block_using, block_global_block): Ditto. * Makefile.in (cp_support_h): Depend on symtab_h. * config/djgpp/fnchange.lst: Add testsuite/gdb.c++/namespace1.cc. 2003-05-19 David Carlton <carlton@bactrian.org> * gdb.c++/namespace.exp: Add namespace scope and anonymous namespace tests. Bump copyright date. * gdb.c++/namespace.cc: Add anonymous namespace and namespace C. (main): Call C::D::marker2. * gdb.c++/namespace1.cc: New file.
2003-04-152003-04-15 David Carlton <carlton@math.stanford.edu>David Carlton1-0/+266
* Makefile.in (SFILES): Add cp-namespace.c. (COMMON_OBS): Add cp-namespace.o. (block.o): Depend on gdb_obstack_h and cp_support_h. (buildsym.o): Depend on cp_support_h. (cp-namespace.o): New. (cp-support.o): Depend on gdb_string_h, demangle_h, gdb_assert_h, gdb_obstack_h, symtab_h, symfile_h, and gdbcmd_h. (dwarf2read.o): Depend on cp_support_h. * jv-lang.c (get_java_class_symtab): Set BLOCK_NAMESPACE. * dwarf2read.c (process_die): Set processing_has_namespace_info, processing_current_namespace. (read_namespace): Update processing_current_namespace; check for anonymous namespaces. (dwarf2_name): New function. (dwarf2_extension): Ditto. * cp-support.h: Update copyright, contributors. Add inclusion guards. Add opaque declaration for structs obstack, block, symbol. (struct using_direct): New struct. Add declarations for cp_find_first_component, cp_entire_prefix_len, processing_has_namespace_info, processing_current_namespace, cp_is_anonymous, cp_add_using_directive, cp_initialize_namespace, cp_finalize_namespace, cp_set_block_scope, cp_scan_for_anonymous_namespaces. * cp-namespace.c: New file. * cp-support.c: Update copyright. Include ctype.h, gdb_assert.h, gdbcmd.h. New variable maint_cplus_cmd_list. (cp_find_first_component): New function. (cp_entire_prefix_len, maint_cplus_command) (first_component_command, _initialize_cp_support): Ditto. * buildsym.c: Include cp-support.h. New variable using_list. (add_symbol_to_list): Check for anonymous namespaces. (finish_block): Set block's scope. (start_symtab): Initialize C++ namespace support. (end_symtab): Finalize C++ namespace support. * block.h: Add opaque declarations for structs block_namespace_info, using_direct, and obstack. Add declarations for block_set_scope and block_set_using. (struct block): Add 'language_specific' member. (BLOCK_NAMESPACE): New macro. * block.c: Include gdb_obstack.h and cp-support.h. (struct block_namespace_info): New struct. (block_set_scope): New function. (block_set_using, block_initialize_namespace): Ditto. 2003-04-15 David Carlton <carlton@math.stanford.edu> * gdb.c++/maint.exp: New file.