summaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
Commit message (Collapse)AuthorAgeFilesLines
* 2004-01-14 David Carlton <carlton@kealia.com>David Carlton2004-01-141-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-09 David Carlton <carlton@kealia.com>Elena Zannoni2004-01-091-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-13 David Carlton <carlton@kealia.com>David Carlton2003-11-131-1/+1
| | | | * cp-namespace.c (lookup_namespace_scope): Fix typo in comment.
* * cp-namespace.c: Doc fix.Jim Blandy2003-11-131-1/+1
|
* 2003-09-25 David Carlton <carlton@kealia.com>David Carlton2003-09-251-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-11 David Carlton <carlton@kealia.com>David Carlton2003-09-111-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-12 David Carlton <carlton@kealia.com>David Carlton2003-06-131-0/+10
| | | | | * cp-namespace.c (cp_set_block_scope): Comment out processing_has_namespace_info branch.
* 2003-05-19 David Carlton <carlton@bactrian.org>David Carlton2003-05-201-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-15 David Carlton <carlton@math.stanford.edu>David Carlton2003-04-151-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.