summaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
Commit message (Collapse)AuthorAgeFilesLines
* gdb/qiyao2012-11-271-16/+18
| | | | | | | | | | | | | | | 2012-11-27 Daniel Jacobowitz <dan@codesourcery.com> Kazu Hirata <kazu@codesourcery.com> Yao Qi <yao@codesourcery.com> * objfiles.c (init_entry_point_info): Call gdbarch_convert_from_func_ptr_addr and gdbarch_addr_bits_remove here ... (entry_point_address_query): ... instead of here. * solib-svr4.c (exec_entry_point): Call gdbarch_addr_bits_remove. * symfile.c (generic_load): Call gdbarch_addr_bits_remove on the entry address.
* gdb/qiyao2012-11-201-1/+1
| | | | | | 2012-11-20 Yao Qi <yao@codesourcery.com> * objfiles.c (init_entry_point_info): Remove trailing spaces.
* * jit.c (jit_object_close_impl): Don't malloc the objfileTom Tromey2012-08-221-3/+2
| | | | | | | | | | name. * objfiles.c (allocate_objfile): Don't malloc the objfile name. (free_objfile): Don't free the objfile name. * objfiles.h (struct objfile) <name>: Update comment. * symfile.c (reread_symbols): Fix reference counting. Don't malloc objfile name.
* * dwarf2read.c (macro_start_file): Update.Tom Tromey2012-08-221-2/+2
| | | | | | | | | | | | * objfiles.c (get_objfile_bfd_data): Initialize macro_cache. (free_objfile_per_bfd_storage): Destroy macro_cache. (allocate_objfile, free_objfile): Update. * objfiles.h (struct objfile_per_bfd_storage) <macro_cache>: New field. (struct objfile) <macro_cache>: Remove. * symfile.c (reread_symbols): Update. * symmisc.c (print_symbol_bcache_statistics): Update. (print_objfile_statistics): Update.
* * elfread.c (elf_symtab_read): Update.Tom Tromey2012-08-221-3/+76
| | | | | | | | | | | | | | | | | | | * objfiles.c (objfiles_bfd_data): New global. (get_objfile_bfd_data, free_objfile_per_bfd_storage) (objfile_bfd_data_free, set_objfile_per_bfd): New functions. (allocate_objfile, free_objfile): Update. (_initialize_objfiles): Initialize objfiles_bfd_data. * objfiles.h (struct objfile_per_bfd_storage): New. (struct objfile) <per_bfd>: New field. <filename_cache>: Remove. (set_objfile_per_bfd): Declare. * symfile.c (reread_symbols): Update. Call set_objfile_per_bfd. (allocate_symtab): Update. * symmisc.c (print_symbol_bcache_statistics): Update. (print_objfile_statistics): Print the size of the BFD obstack. gdb/testsuite * gdb.base/maint.exp: Update.
* * registry.h (struct registry_fields): New.Tom Tromey2012-08-221-1/+1
| | | | | | | (REGISTRY_FIELDS): Redefine. (REGISTRY_ACCESS_FIELD): New macro. (DEFINE_REGISTRY): Add ACCESS argument. Update defined functions.
* * auto-load.c (_initialize_auto_load): Update.Tom Tromey2012-08-221-113/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * solib-svr4.c (_initialize_svr4_solib): Update * solib-dsbt.c (_initialize_dsbt_solib): Update. * solib-darwin.c (_initialize_darwin_solib): Update. * registry.h: New file. * python/py-progspace.c (gdbpy_initialize_pspace): Update. * python/py-inferior.c (gdbpy_initialize_inferior): Update. * progspace.h: Include registry.h. Use DECLARE_REGISTRY. (register_program_space_data_with_cleanup) (register_program_space_data, program_space_alloc_data) (clear_program_space_data, set_program_space_data) (program_space_data): Don't declare. * progspace.c: Use DEFINE_REGISTRY. (struct program_space_data, struct program_space_data_registration, struct program_space_data_registry, program_space_data_registry) (register_program_space_data_with_cleanup) (register_program_space_data, program_space_alloc_data) (program_space_free_data, clear_program_space_data) (set_program_space_data, program_space_data): Remove. * objfiles.h: Include registry.h. Use DECLARE_REGISTRY. (struct objfile) <data, num_data>: Replace with REGISTRY_FIELDS. (register_objfile_data_with_cleanup, register_objfile_data) (clear_objfile_data, set_objfile_data, objfile_data): Don't declare. * objfiles.c: Use DEFINE_REGISTRY. (struct objfile_data, struct objfile_data_registration, struct objfile_data_registry, objfile_data_registry) (register_objfile_data_with_cleanup, register_objfile_data) (objfile_alloc_data, objfile_free_data, clear_objfile_data) (set_objfile_data, objfile_data): Remove. (_initialize_objfiles): Update. * jit.c (_initialize_jit): Update. * inflow.c (_initialize_inflow): Update. * inferior.h: Include registry.h. Use DECLARE_REGISTRY. (struct inferior) <data, num_data>: Replace with REGISTRY_FIELDS. (register_inferior_data_with_cleanup, register_inferior_data) (clear_inferior_data, set_inferior_data, inferior_data): Don't declare. * inferior.c: Use DEFINE_REGISTRY. (struct inferior_data, struct inferior_data_registration, struct inferior_data_registry, inferior_data_registry) (register_inferior_data_with_cleanup, register_inferior_data) (inferior_alloc_data, inferior_free_data clear_inferior_data) (set_inferior_data, inferior_data): Remove. * auxv.c (_initialize_auxv): Update. * ada-lang.c (_initialize_ada_language): Update. * breakpoint.c (_initialize_breakpoint): Update. * i386-nat.c (i386_use_watchpoints): Update.
* * coffread.c (coff_symfile_read): Make a cleanup for 'debugfile'Tom Tromey2012-07-231-1/+2
| | | | | | | | | | | | | | | | | | | | and 'abfd'. * elfread.c (elf_symfile_read): Make a cleanup for 'debugfile' and 'abfd'. * jit.c (jit_bfd_try_read_symtab): Make a cleanup for 'nbfd'. * machoread.c (macho_add_oso_symfile): Make a cleanup for 'abfd'. (macho_symfile_read): Make a cleanup for 'dsym_bfd'. * objfiles.c (allocate_objfile): Acquire a new reference. * rs6000-nat.c (add_vmap): Don't acquire a BFD reference. * solib.c (solib_read_symbols): Don't acquire a BFD reference. * spu-linux-nat.c (spu_symbol_file_add_from_memory): Make a cleanup for 'nbfd'. * symfile-mem.c (symbol_file_add_from_memory): Make a cleanup for 'nbfd'. * symfile.c (symbol_file_add_with_addrs_or_offsets): Don't make a cleanup for 'abfd'. (symbol_file_add): Make a BFD cleanup.
* * dwarf2read.c (try_open_dwo_file): Use gdb_bfd_ref andTom Tromey2012-07-181-71/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb_bfd_unref. (free_dwo_file): Use gdb_bfd_unref. * cli/cli-dump.c: Include gdb_bfd.h. (bfd_openw_with_cleanup): Use gdb_bfd_ref. (bfd_openr_with_cleanup): Likewise. * windows-nat.c (windows_make_so): Use gdb_bfd_ref, gdb_bfd_unref. * utils.c: Include gdb_bfd.h. (do_bfd_close_cleanup): Use gdb_bfd_unref. * symfile.c: Include gdb_bfd.h. (separate_debug_file_exists): Use gdb_bfd_unref. (bfd_open_maybe_remote): Use gdb_bfd_ref. (symfile_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref. (generic_load): Use gdb_bfd_ref. (reread_symbols): Use gdb_bfd_unref. * symfile-mem.c: Include gdb_bfd.h. (symbol_file_add_from_memory): Use make_cleanup_bfd_close. * spu-linux-nat.c (spu_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref. * solib.c: Include gdb_bfd.h. (solib_bfd_fopen): Use gdb_bfd_ref. (solib_bfd_open): Use gdb_bfd_unref. (free_so_symbols): Use gdb_bfd_unref. (reload_shared_libraries_1): Use gdb_bfd_unref. * solib-spu.c: Include gdb_bfd.h. (spu_bfd_fopen): Use gdb_bfd_ref, gdb_bfd_unref. * solib-pa64.c (pa64_solib_create_inferior_hook): Use gdb_bfd_ref, gdb_bfd_unref. * solib-frv.c: Include gdb_bfd.h. (enable_break2): Use gdb_bfd_unref. * solib-dsbt.c: Include gdb_bfd.h. (enable_break2): Use gdb_bfd_unref. * solib-darwin.c: Include gdb_bfd.h. (darwin_solib_get_all_image_info_addr_at_init): Use gdb_bfd_ref, gdb_bfd_unref. (darwin_bfd_open): Use gdb_bfd_unref. * rs6000-nat.c (add_vmap): Use gdb_bfd_ref, gdb_bfd_unref. * remote-mips.c: Include gdb_bfd.h. (mips_load_srec): Use gdb_bfd_ref. (pmon_load_fast): Use gdb_bfd_ref. * remote-m32r-sdi.c: Include gdb_bfd.h. (m32r_load): Use gdb_bfd_ref. * record.c: Include gdb_bfd.h. (record_save_cleanups): Use gdb_bfd_unref. (cmd_record_save): Use gdb_bfd_unref. * procfs.c (insert_dbx_link_bpt_in_file): Use gdb_bfd_ref, gdb_bfd_unref. * objfiles.h (gdb_bfd_close_or_warn): Remove. (gdb_bfd_ref, gdb_bfd_unref): Move to gdb_bfd.h. * objfiles.c: Include gdb_bfd.h. (free_objfile): Use gdb_bfd_unref. (gdb_bfd_close_or_warn, gdb_bfd_ref, gdb_bfd_unref): Move to gdb_bfd.c. * machoread.c (macho_add_oso_symfile): Use gdb_bfd_unref. (macho_symfile_read_all_oso): Use gdb_bfd_ref, gdb_bfd_unref. (macho_check_dsym): Likewise. * m32r-rom.c: Include gdb_bfd.h. (m32r_load): Use gdb_bfd_ref. (m32r_upload_command): Use gdb_bfd_ref. * jit.c: Include gdb_bfd.h. (jit_bfd_try_read_symtab): Use gdb_bfd_ref, gdb_bfd_unref. * gdb_bfd.h: New file. * gdb_bfd.c: New file. * gcore.c: Include gdb_bfd.h. (create_gcore_bfd): Use gdb_bfd_ref. (do_bfd_delete_cleanup): Use gdb_bfd_unref. (gcore_command): Use gdb_bfd_unref. * exec.c: Include gdb_bfd.h. (exec_close): Use gdb_bfd_unref. (exec_close_1): Use gdb_bfd_unref. (exec_file_attach): Use gdb_bfd_ref. * elfread.c: Include gdb_bfd.h. (build_id_verify): Use gdb_bfd_unref. * dsrec.c: Include gdb_bfd.h. (load_srec): Use gdb_bfd_ref. * corelow.c: Include gdb_bfd.h. (core_close): Use gdb_bfd_unref. (core_open): Use gdb_bfd_ref. * bfd-target.c: Include gdb_bfd.h. (target_bfd_xclose): Use gdb_bfd_unref. (target_bfd_reopen): Use gdb_bfd_ref. * Makefile.in (SFILES): Add gdb_bfd.c. (HFILES_NO_SRCDIR): Add gdb_bfd.h. (COMMON_OBS): Add gdb_bfd.o.
* New "iterate_over_objfiles_in_search_order" gdbarch method.Joel Brobecker2012-06-051-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the "iterate_over_objfiles_in_search_order" gdbarch method, as well as its default implementation, and converts the areas where it will matter to using this gdbarch method. The default method implementation is the only one installed, and the changes should have no functional impact in terms of behavior. This only paves the way for the architectures that will need their own version. gdb/ChangeLog: * gdbarch.sh: Add generation of "iterate_over_objfiles_in_search_order_cb_ftype" typedef in gdbarch.h. Add include of "objfiles.h" in gdbarch.c. (iterate_over_objfiles_in_search_order): New gdbarch method. * gdbarch.h, gdbarch.c: Regenerate. * objfiles.h (default_iterate_over_objfiles_in_search_order): Add declaration. * objfiles.c (default_iterate_over_objfiles_in_search_order): New function. * symtab.c (lookup_symbol_aux_objfile): New function, extracted out of lookup_symbol_aux_symtabs. (lookup_symbol_aux_symtabs): Replace extracted-out code by call to lookup_symbol_aux_objfile. (struct global_sym_lookup_data): New type. (lookup_symbol_global_iterator_cb): New function. (lookup_symbol_global): Search for symbol using gdbarch_iterate_over_objfiles_in_search_order and lookup_symbol_global_iterator_cb. * findvar.c (struct minsym_lookup_data): New type. (minsym_lookup_iterator_cb): New function. (default_read_var_value) [case LOC_UNRESOLVED]: Resolve the symbol's address via gdbarch_iterate_over_objfiles_in_search_order and minsym_lookup_iterator_cb.
* * tracepoint.c (scope_info): Update.Tom Tromey2012-05-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * symtab.c (lookup_block_symbol, iterate_over_symbols) (find_pc_sect_symtab, search_symbols) (default_make_symbol_completion_list_break_on) (make_file_symbol_completion_list): Update. * symmisc.c (dump_symtab_1): Update. * stack.c (print_frame_args, iterate_over_block_locals) (print_frame_labels, iterate_over_block_arg_vars): Update. * python/py-block.c (block_object) <dict>: Remove. <block>: New field. <iter>: Change type. (blpy_iter): Update. (blpy_block_syms_iternext): Update. * psymtab.c (map_block): Use block iterators. * objfiles.c (objfile_relocate1): Use ALL_DICT_SYMBOLS. * mi/mi-cmd-stack.c (list_args_or_locals): Update. * mdebugread.c (parse_symbol, mylookup_symbol): Update. * infrun.c (check_exception_resume): Update. * cp-support.c (make_symbol_overload_list_block): Update. * coffread.c (patch_opaque_types): Update. * buildsym.c (finish_block, end_symtab): Use ALL_DICT_SYMBOLS. * block.h (struct block_iterator): New. (block_iterator_first, block_iterator_next, block_iter_name_first) (block_iter_name_next, block_iter_match_first) (block_iter_match_next): Declare. (ALL_BLOCK_SYMBOLS): Redefine. * block.c (block_iterator_first, block_iterator_next) (block_iter_name_first, block_iter_name_next) (block_iter_match_first, block_iter_match_next): New functions. * ada-lang.c (ada_add_block_symbols) (ada_make_symbol_completion_list): Use block iterator.
* 2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com>sergiodj2012-04-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (SFILES): Add `probe' and `stap-probe'. (COMMON_OBS): Likewise. (HFILES_NO_SRCDIR): Add `probe'. * NEWS: Mention support for static and SystemTap probes. * amd64-tdep.c (amd64_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * arm-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (arm_stap_is_single_operand): New function. (arm_stap_parse_special_token): Likewise. (arm_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * ax-gdb.c (require_rvalue): Removing static declaration. (gen_expr): Likewise. * ax-gdb.h (gen_expr): Declaring function. (require_rvalue): Likewise. * breakpoint.c: Include `gdb_regex.h' and `probe.h'. (bkpt_probe_breakpoint_ops): New variable. (momentary_breakpoint_from_master): Set the `probe' value. (add_location_to_breakpoint): Likewise. (break_command_1): Using proper breakpoint_ops according to the argument passed by the user in the command line. (bkpt_probe_insert_location): New function. (bkpt_probe_remove_location): Likewise. (bkpt_probe_create_sals_from_address): Likewise. (bkpt_probe_decode_linespec): Likewise. (tracepoint_probe_create_sals_from_address): Likewise. (tracepoint_probe_decode_linespec): Likewise. (tracepoint_probe_breakpoint_ops): New variable. (trace_command): Using proper breakpoint_ops according to the argument passed by the user in the command line. (initialize_breakpoint_ops): Initializing breakpoint_ops for static probes on breakpoints and tracepoints. * breakpoint.h (struct bp_location) <probe>: New field. * cli-utils.c (skip_spaces_const): New function. (extract_arg): Likewise. * cli-utils.h (skip_spaces_const): Likewise. (extract_arg): Likewise. * coffread.c (coff_sym_fns): Add `sym_probe_fns' value. * configure.ac: Append `stap-probe.o' to be generated when ELF support is present. * configure: Regenerate. * dbxread.c (aout_sym_fns): Add `sym_probe_fns' value. * elfread.c: Include `probe.h' and `arch-utils.h'. (probe_key): New variable. (elf_get_probes): New function. (elf_get_probe_argument_count): Likewise. (elf_evaluate_probe_argument): Likewise. (elf_compile_to_ax): Likewise. (elf_symfile_relocate_probe): Likewise. (stap_probe_key_free): Likewise. (elf_probe_fns): New variable. (elf_sym_fns): Add `sym_probe_fns' value. (elf_sym_fns_lazy_psyms): Likewise. (elf_sym_fns_gdb_index): Likewise. (_initialize_elfread): Initialize objfile cache for static probes. * gdb_vecs.h (struct probe): New forward declaration. (probe_p): New VEC declaration. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix): New variable. (stap_integer_suffix): Likewise. (stap_register_prefix): Likewise. (stap_register_suffix): Likewise. (stap_register_indirection_prefix): Likewise. (stap_register_indirection_suffix): Likewise. (stap_gdb_register_prefix): Likewise. (stap_gdb_register_suffix): Likewise. (stap_is_single_operand): New function. (stap_parse_special_token): Likewise. (struct stap_parse_info): Forward declaration. * i386-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. (i386_elf_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * i386-tdep.h (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. * machoread.c (macho_sym_fns): Add `sym_probe_fns' value. * mipsread.c (ecoff_sym_fns): Likewise. * objfiles.c (objfile_relocate1): Support relocation for static probes. * parse.c (prefixify_expression): Remove static declaration. (initialize_expout): Likewise. (reallocate_expout): Likewise. * parser-defs.h (initialize_expout): Declare function. (reallocate_expout): Likewise. (prefixify_expression): Likewise. * ppc-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (ppc_stap_is_single_operand): New function. (ppc_stap_parse_special_token): Likewise. (ppc_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * probe.c: New file, for generic statically defined probe support. * probe.h: Likewise. * s390-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (s390_stap_is_single_operand): New function. (s390_gdbarch_init): Initializing proper fields used by SystemTap probes' arguments parser. * somread.c (som_sym_fns): Add `sym_probe_fns' value. * stap-probe.c: New file, for SystemTap probe support. * stap-probe.h: Likewise. * symfile.h: Include `gdb_vecs.h'. (struct sym_probe_fns): New struct. (struct sym_fns) <sym_probe_fns>: New field. * symtab.c (init_sal): Initialize `probe' field. * symtab.h (struct probe): Forward declaration. (struct symtab_and_line) <probe>: New field. * tracepoint.c (start_tracing): Adjust semaphore on breakpoints locations. (stop_tracing): Likewise. * xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
* * objfiles.c (add_to_objfile_sections): Remove outdated comments.Doug Evans2012-02-211-24/+8
| | | | | | | | Rename objfile_p_char parameter to objfilep. (build_objfile_section_table): Result is now void. All callers updated. * objfiles.h (struct objfile): Tweak comments, whitespace. (build_objfile_section_table): Update.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-3/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* * symtab.h: Include minsyms.h.Tom Tromey2011-12-211-23/+0
| | | | | | | | | | | | | | | | | | | (prim_record_minimal_symbol, prim_record_minimal_symbol_full) (prim_record_minimal_symbol_and_info, msymbol_hash_iw) (msymbol_hash, SYMBOL_HASH_NEXT, msymbol_objfile) (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline) (lookup_minimal_symbol_by_pc_name, lookup_minimal_symbol_by_pc) (iterate_over_minimal_symbols, lookup_minimal_symbol_and_objfile) (lookup_minimal_symbol_by_pc_section) (lookup_solib_trampoline_symbol_by_pc) (init_minimal_symbol_collection) (make_cleanup_discard_minimal_symbols, install_minimal_symbols) (msymbols_sort): Move to minsyms.h. * objfiles.c (terminate_minimal_symbol_table): Move to minsyms.c. * minsyms.c (terminate_minimal_symbol_table): Move from objfiles.c. * minsyms.h: New file.
* missing check against overlay_debugging in objfiles.cJoel Brobecker2011-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem where the debugger is trying to locate a minimal symbol from its address, when the symbol is inside a section whose VMA is different from its LMA. We have a program that was built on ppc-elf using a linker script such that data sections are placed in ROM, and then loaded onto RAM at execution. So their VMA addresses are indeed different from their LMA address. Unfortunately, there is one place where GDB gets slightly confused into thinking that these data sections are overlayed, while it's not the case here. This show up when trying to print the list of Ada tasks, where GDB is unable to determine their names, and thus prints a generic `Ravenscar task' instead: (gdb) info tasks ID TID P-ID Pri State Name 1 1d580 127 Delay Sleep Ravenscar task 2 183f8 127 Delay Sleep Ravenscar task * 3 13268 127 Runnable Ravenscar task We expected: (gdb) info tasks ID TID P-ID Pri State Name 1 1d580 127 Delay Sleep environment_task 2 183f8 127 Delay Sleep raven2 * 3 13268 127 Runnable raven1 The name of the task is determined by looking up the symbol table using the task ID, which is the address where the symbol is defined. So, ada-tasks calls... msym = lookup_minimal_symbol_by_pc (task_id); ... which in turn first tries to determine the section associated to this address (find_pc_section), which itself uses a map of sections to find it. The map itself is recomputed every time objfiles are loaded/changed by `update_section_map'. And `update_section_map' relies on `insert_section_p' to determine whether the section should be inserted in the map or not. This is where things get interesting for us, because `insert_section_p' simply rejects overlay sections: if (lma != 0 && lma != bfd_section_vma (abfd, section) && (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0) /* This is an overlay section. IN_MEMORY check is needed to avoid discarding sections from the "system supplied DSO" (aka vdso) on some Linux systems (e.g. Fedora 11). */ return 0; However, it shouldn't reject our section in this case, since overlay debugging is off. The fix is to add a check that overlay debugging is active before rejecting the section. This is similar to what is done in `section_is_overlay' (which takes obj_section objects), for instance. gdb/Changelog: * objfiles.c (insert_section_p): Do not detect overlay sections if overlay debugging is off.
* * objfiles.h (struct objfile): Remove obsolete comment.Tom Tromey2011-12-081-6/+0
| | | | | * objfiles.c (build_objfile_section_table): Remove obsolete comment.
* * symtab.h (current_objfile): Don't declare.Tom Tromey2011-06-141-1/+0
| | | | | | | | * objfiles.h (current_objfile): Don't declare. * objfiles.c (current_objfile): Remove. * mdebugread.c (current_objfile): New file-scope global. * dbxread.c (current_objfile): New file-scope global. * coffread.c (current_objfile): New file-scope global.
* gdb/Jan Kratochvil2011-04-251-5/+9
| | | | | | | | | | | | | * elfread.c (elf_symfile_read): Protect dwarf2_initialize_objfile by !objfile_has_partial_symbols. New comment. * objfiles.c (objfile_has_partial_symbols): Call HAS_SYMBOLS if SYM_READ_PSYMBOLS is not present. Extend the comment. * symfile.h (struct sym_fns): Extend the sym_read_psymbols comment. gdb/testsuite/ * gdb.base/gdbindex-stabs-dwarf.c: New file. * gdb.base/gdbindex-stabs.c: New file. * gdb.base/gdbindex-stabs.exp: New file.
* gdb/Jan Kratochvil2011-04-061-3/+6
| | | | | | | Fix crash regression on systems featuring .gdb_index. * objfiles.c (free_objfile): Move the forget_cached_source_info_for_objfile call earlier. Comment it. Extend the comment for objfile_free_data.
* * symtab.h (free_symtab): Remove.Tom Tromey2011-04-041-6/+4
| | | | | | | | | | (forget_cached_source_info_for_objfile): Declare. * symmisc.c (free_symtab): Remove. * source.c (forget_cached_source_info_for_objfile): New function. (forget_cached_source_info): Use it. * objfiles.c (free_objfile): Simplify check before calling clear_current_source_symtab_and_line. Call forget_cached_source_info_for_objfile.
* gdbTom Tromey2011-04-041-4/+0
| | | | | | | | | | | | | | | | | | | | | * symfile.c (reread_symbols): Update. * objfiles.h (struct objfile) <cp_namespace_symtab>: Remove field. * objfiles.c (allocate_objfile): Update. * cp-support.h (cp_check_possible_namespace_symbols): Don't declare. * cp-namespace.c (lookup_symbol_file): Don't call lookup_possible_namespace_symbol. (initialize_namespace_symtab, get_possible_namespace_block) (free_namespace_block, cp_check_possible_namespace_symbols) (check_possible_namespace_symbols_loop) (check_one_possible_namespace_symbol) (lookup_possible_namespace_symbol): Remove. (maintenance_cplus_namespace): Replace with notice. (_initialize_cp_namespace): Deprecate `maint cplus namespace'. gdb/testsuite * gdb.cp/maint.exp (test_help): Update. (test_namespace): Likewise.
* * xcoffread.c (xcoff_sym_fns): Update.Tom Tromey2011-03-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * symfile.h (struct sym_fns) <sym_read_psymbols>: New field. (enum symfile_add_flags) <SYMFILE_NO_READ>: New constant. * symfile.c (syms_from_objfile): Handle SYMFILE_NO_READ. (symbol_file_add_with_addrs_or_offsets): Likewise. (reread_symbols): Handle OBJF_PSYMTABS_READ. * somread.c (som_sym_fns): Update. * psymtab.h (require_partial_symbols): Declare. * psymtab.c (require_partial_symbols): New function. (ALL_OBJFILE_PSYMTABS_REQUIRED): New macro. (ALL_OBJFILE_PSYMTABS): Undef. (ALL_PSYMTABS): Move from psympriv.h. (lookup_partial_symtab, find_pc_sect_psymtab) (lookup_symbol_aux_psymtabs, relocate_psymtabs) (find_last_source_symtab_from_partial) (forget_cached_source_info_partial) (print_psymtab_stats_for_objfile, read_symtabs_for_function) (expand_partial_symbol_tables, read_psymtabs_with_filename) (map_symbol_names_psymtab, map_symbol_filenames_psymtab) (find_symbol_file_from_partial, map_matching_symbols_psymtab) (expand_symtabs_matching_via_partial, maintenance_info_psymtabs): Use ALL_OBJFILE_PSYMTABS_REQUIRED. * psympriv.h (ALL_PSYMTABS): Move to psymtab.c. * objfiles.h (OBJF_PSYMTABS_READ): New macro. * objfiles.c (objfile_has_partial_symbols): Handle lazily-read psymtabs. * mipsread.c (ecoff_sym_fns): Update. * machoread.c (macho_sym_fns): Update. * elfread.c (elf_symfile_read): Set up for lazy psymtab reading. (read_psyms): New function. (elf_sym_fns, elf_sym_fns_gdb_index): Update. (elf_sym_fns_lazy_psyms): New global. * dwarf2read.c (dwarf2_initialize_objfile): Don't call dwarf2_build_psymtabs. * dbxread.c (aout_sym_fns): Update. * coffread.c (coff_sym_fns): Update.
* 2011-01-10 Michael Snyder <msnyder@vmware.com>Michael Snyder2011-01-101-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nto-procfs.c: Comment cleanup, mostly periods and spaces. * nto-tdep.c: Ditto. * nto-tdep.h: Ditto. * objc-exp.y: Ditto. * objc-lang.c: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * observer.c: Ditto. * opencl-lang.c: Ditto. * osabi.c: Ditto. * parse.c: Ditto. * parser-defs.h: Ditto. * p-exp.y: Ditto. * p-lang.c: Ditto. * posix-hdep.c: Ditto. * ppcbug-rom.c: Ditto. * ppc-linux-nat.c: Ditto. * ppc-linux-tdep.c: Ditto. * ppc-linux-tdep.h: Ditto. * ppcnbsd-tdep.c: Ditto. * ppcobsd-tdep.c: Ditto. * ppcobsd-tdep.h: Ditto. * ppc-sysv-tdep.c: Ditto. * ppc-tdep.h: Ditto. * printcmd.c: Ditto. * proc-abi.c: Ditto. * proc-flags.c: Ditto. * procfs.c: Ditto. * proc-utils.h: Ditto. * progspace.h: Ditto. * prologue-value.c: Ditto. * prologue-value.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * ravenscar-sparc-thread.c: Ditto. * ravenscar-thread.c: Ditto. * ravenscar-thread.h: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote.c: Ditto. * remote-fileio.c: Ditto. * remote-fileio.h: Ditto. * remote.h: Ditto. * remote-m32r-sdi.c: Ditto. * remote-mips.c: Ditto. * remote-sim.c: Ditto. * rs6000-aix-tdep.c: Ditto. * rs6000-nat.c: Ditto. * rs6000-tdep.c: Ditto.
* 2011-01-05 Michael Snyder <msnyder@vmware.com>Michael Snyder2011-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
* run copyright.sh for 2011.Joel Brobecker2011-01-011-1/+2
|
* gdb/Jan Kratochvil2010-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | * infrun.c (follow_exec): Replace symbol_file_add_main by symbol_file_add with SYMFILE_DEFER_BP_RESET, set_initial_language and breakpoint_re_set. * m32r-rom.c (m32r_load, m32r_upload_command): Use parameter 0 for clear_symtab_users. * objfiles.c (free_all_objfiles): Likewise. * remote-m32r-sdi.c (m32r_load): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * symfile.c (new_symfile_objfile): New comment for add_flags. Call clear_symtab_users with ADD_FLAGS. (reread_symbols): Use parameter 0 for clear_symtab_users. (clear_symtab_users): New parameter add_flags. Do not call breakpoint_re_set if SYMFILE_DEFER_BP_RESET. (clear_symtab_users_cleanup): Use parameter 0 for clear_symtab_users. * symtab.h (clear_symtab_users): New parameter add_flags. gdb/testsuite/ * gdb.base/pie-execl.exp: New file. * gdb.base/pie-execl.c: New file.
* gdb/Jan Kratochvil2010-09-221-8/+1
| | | | | | | | | | | | | Code cleanup. * objfiles.c (allocate_objfile) <objfile->name != NULL>: Remove. (free_objfile) <objfile->name != NULL>: Remove the conditional around xfree. * objfiles.h (struct objfile) <name>: New comment it is never NULL. * python/py-auto-load.c (auto_load_new_objfile) <!objfile->name>: Remove. * python/py-objfile.c (objfpy_get_filename) <obj->objfile->name> Remove the conditional. * python/py-progspace.c (pspy_get_filename) <objfile->name>: Likewise.
* Create and use a specialized bcache type for psymbolsswagiaal2010-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | 2010-08-31 Sami Wagiaalla <swagiaal@redhat.com> * symfile.c (reread_symbols): Use psymbol_bcache_free, and psymbol_bcache_init. * psymtab.h (psymbol_bcache_init): New function prototype. (psymbol_bcache_free): New function prototype. (psymbol_bcache_get_bcache): New function prototype. * psymtab.c (psymbol_bcache_init): New function. (psymbol_bcache_free): New function. (psymbol_bcache_full): New function. (psymbol_bcache_get_bcache): New function. (add_psymbol_to_bcache): use psymbol_bcache_full. * objfiles.h (psymbol_cache): Change type of psymbol_cache to psymbol_bcache. * symmisc.c (print_symbol_bcache_statistics): Updated. (print_objfile_statistics): Updated. * objfiles.c (allocate_objfile): Use psymbol_bcache_init to initialize psymbol_cache. (free_objfile): Use psymbol_bcache_free.
* Enable custom bcache hash function.swagiaal2010-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 2010-08-25 Sami Wagiaalla <swagiaal@redhat.com> * psymtab.c (add_psymbol_to_bcache): Remove 'static' from 'static partial_symbol psymbol'. (psymbol_hash): New function. (psymbol_compare): New function. * bcache.c (hash_continue): New. (hash): Use hash_continue. * bcache.c: Add hash_function and compare_function pointers to bcache struct. (bcache_full): Use bcache->hash_function, and bcache->compare_function. (bcache_compare): New function. (bcache_xmalloc): Take hash_function and compare_function arguments and initialize the bcach's pointers. Updated comment. * objfiles.c (allocate_objfile): Updated. * symfile.c (reread_symbols): Updated. * python/py-type.c (typy_richcompare): Updated.
* * gdb_assert.h (gdb_assert_not_reached): New macro.Doug Evans2010-08-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | (gdb_assert_fail): Fix typo in comment. * avr-tdep.c (avr_return_value): Use gdb_assert_not_reached instead of gdb_assert (0). * darwin-nat.c (darwin_check_new_threads): Ditto. * dwarf2read.c (dwarf2_get_section_info): Ditto. (munmap_section_buffer): Ditto. * m32c-tdep.c (make_types): Ditto. (m32c_decode_srcdest4, m32c_decode_sd23, m32c_frame_base): Ditto. * macroexp.c (get_character_constant): Ditto. (get_string_literal): Ditto. * mep-tdep.c (mep_pseudo_cr_size): Ditto. (mep_pseudo_cr_index, mep_register_type): Ditto. (mep_pseudo_register_read, mep_pseudo_register_write): Ditto. (mep_get_insn, mep_analyze_prologue): Ditto. * objfiles.c (qsort_cmp): Ditto. * prologue-value.c (pv_is_identical): Ditto. * record.c (record_get_loc): Ditto. * value.c (value_static_field): Ditto. * xtensa-tdep.c (call0_track_op): Ditto.
* create and use symbol_set_language.swagiaal2010-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | 2010-08-09 Sami Wagiaalla <swagiaal@redhat.com> * symtab.h: Renamed SYMBOL_INIT_LANGUAGE_SPECIFIC to SYMBOL_SET_LANGUAGE. (symbol_init_language_specific): Renamed to symbol_set_language. * symtab.c (symbol_init_language_specific): Removed redundant check for language_cplus. Renamed to symbol_set_language. * stabsread.c (define_symbol): Updated. (read_enum_type): Updated * psymtab.c (add_psymbol_to_bcache): Updated. * minsyms.c (install_minimal_symbols): Updated. * coffread.c (process_coff_symbol): SYMBOL_SET_LANGUAGE instead of SYMBOL_LANGUAGE to set the language. * minsyms.c (prim_record_minimal_symbol_full): Ditto. * mdebugread.c (new_symbol): Ditto. * cp-namespace.c (check_one_possible_namespace_symbol): Ditto. * dwarf2read.c (new_symbol_full): Ditto. * jv-lang.c (add_class_symbol): Ditto.
* gdbTom Tromey2010-07-281-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/9946: * symfile.c (reread_symbols): Clear template_symbols. * symtab.h (struct symbol) <is_cplus_template_function>: New field. (SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION): New macro. (struct template_symbol): New. * symtab.c (lookup_symbol_aux_local): Use cp_lookup_symbol_imports_or_template. * objfiles.h (struct objfile) <template_symbols>: New field. * objfiles.c (relocate_one_symbol): New function. (objfile_relocate1): Use it. Relocate isolated symbols. * gdbtypes.h (struct cplus_struct_type) <n_template_arguments, template_arguments>: New fields. (TYPE_N_TEMPLATE_ARGUMENTS): New macro. (TYPE_TEMPLATE_ARGUMENTS): Likewise. (TYPE_TEMPLATE_ARGUMENT): Likewise. (lookup_typename): Update. * gdbtypes.c (lookup_typename): Constify "block" argument. * dwarf2read.c: Include vec.h. (symbolp): New typedef. (read_func_scope): Read template arguments. Allocate a template_symbol when needed. (read_structure_type): Read template arguments. (new_symbol_full): New function, from new_symbol. Handle DW_TAG_template_type_param and DW_TAG_template_value_param. (new_symbol): Rewrite as wrapper. * cp-support.h (cp_lookup_symbol_imports_or_template): Declare. * cp-namespace.c: Include language.h. (search_symbol_list): New function. (cp_lookup_symbol_imports_or_template): Likewise. gdb/testsuite PR c++/9946: * gdb.cp/temargs.exp: New file. * gdb.cp/temargs.cc: New file.
* 2010-05-15 Michael Snyder <msnyder@vmware.com>Michael Snyder2010-05-161-73/+74
| | | | | | | | * objc-lang.c: White space. * objfiles.c: White space. * observer.c: White space. * osabi.c: White space. * osdata.c: White space.
* 2010-05-06 Michael Snyder <msnyder@vmware.com>Michael Snyder2010-05-061-3/+2
| | | | | | | | | * objfiles.c (objfile_relocate): Delete unused variable. * maint.c (_initialize_maint_cmds): Delete unused variable. * demangle.c (_initialize_demangler): Delete unused variable. * corefile.c (reopen_exec_file): Delete unused variable. * dwarf2expr.c (dwarf2_read_address): Delete unused variable. * dwarf2-frame.c (decode_frame_entry): Delete unused variable.
* gdb/Jan Kratochvil2010-04-271-0/+6
| | | | | | | * objfiles.c: Include solist.h. (free_all_objfiles): New variable so. Check stale solist objfiles. * symfile.c (symbol_file_clear): Swap the order of free_all_objfiles and no_shared_libraries.
* * objfiles.h (gdb_bfd_close_or_warn): Declare.Pedro Alves2010-04-141-3/+18
| | | | | | | | * objfiles.c (gdb_bfd_close_or_warn): New. * corelow.c: Include objfiles.h (core_close): Use gdb_bfd_close_or_warn. * elfread.c (build_id_verify): Ditto. * exec.c (exec_close, exec_close_1): Ditto.
* gdbTom Tromey2010-03-101-33/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * xcoffread.c: Include psymtab.h. (xcoff_sym_fns): Update. * symtab.h (struct partial_symbol): Remove. (PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove. (struct partial_symtab): Remove. (PSYMTAB_TO_SYMTAB): Remove. (lookup_partial_symbol, lookup_partial_symtab, find_pc_psymtab) (find_pc_sect_psymtab): Remove. (find_pc_sect_symtab_via_partial): Declare. (find_pc_psymtab, find_pc_sect_psymbol, psymtab_to_symtab) (find_main_psymtab): Remove. (find_main_filename): Declare. (fixup_psymbol_section): Remove. (fixup_section): Declare. * symtab.c: Include psymtab.h. (lookup_symtab): Use lookup_symtab method. (lookup_partial_symtab): Remove. (find_pc_sect_psymtab_closer): Remove. (find_pc_sect_psymtab): Remove. (find_pc_sect_symtab_via_partial): New function. (find_pc_psymtab, find_pc_sect_psymbol, find_pc_psymbol): Remove. (fixup_section): No longer static. (fixup_psymbol_section): Remove. (lookup_symbol_aux): Use lookup_symbol_aux_quick. (lookup_global_symbol_from_objfile): Likewise. (lookup_symbol_aux_psymtabs): Remove. (lookup_symbol_aux_quick): New function. (lookup_symbol_global): Use lookup_symbol_aux_quick. (lookup_partial_symbol): Remove. (basic_lookup_transparent_type_quick): New function. (basic_lookup_transparent_type): Use it. (find_main_psymtab): Remove. (find_main_filename): New function. (find_pc_sect_symtab): Use find_pc_sect_symtab method. (find_line_symtab): Use expand_symtabs_with_filename method. (output_partial_symbol_filename): New function. (sources_info): Use map_partial_symbol_filenames. (struct search_symbols_data): New type. (search_symbols_file_matches): New function. (search_symbols_name_matches): Likewise. (search_symbols): Use expand_symtabs_matching method. (struct add_name_data): Rename from add_macro_name_data. (add_macro_name): Update. (add_partial_symbol_name): New function. (default_make_symbol_completion_list): Use map_partial_symbol_names. (struct add_partial_symbol_name): New type. (maybe_add_partial_symtab_filename): New function. (make_source_files_completion_list): Use map_partial_symbol_filenames. (expand_line_sal): Use expand_symtabs_with_filename method. * symmisc.c: Include psymtab.h. (print_objfile_statistics): Use print_stats method. (dump_objfile): Use dump method. (dump_psymtab, maintenance_print_psymbols) (maintenance_info_psymtabs, maintenance_check_symtabs) (extend_psymbol_list): Remove. * symfile.h (struct quick_symbol_functions): New struct. (struct sym_fns) <qf>: New field. (sort_pst_symbols): Remove. (increment_reading_symtab): Declare. * symfile.c: Include psymtab.h. (compare_psymbols, sort_pst_symbols): Remove. (psymtab_to_symtab): Remove. (increment_reading_symtab): New function. (symbol_file_add_with_addrs_or_offsets): Use expand_all_symtabs method. (set_initial_language): Use find_main_filename. (allocate_psymtab, discard_psymtab, cashier_psymtab): Remove. (free_named_symtabs): Remove unused code. (start_psymtab_common, add_psymbol_to_bcache) (append_psymbol_to_list, add_psymbol_to_list, init_psymbol_list): Remove. * stack.c: Include psymtab.h, symfile.h. (backtrace_command_1): Use find_pc_sect_symtab_via_partial. * source.h (psymtab_to_fullname): Don't declare. * source.c: Include psymtab.h. (select_source_symtab): Use find_last_source_symtab method. (forget_cached_source_info): Use forget_cached_source_info method. (find_and_open_source): No longer static. (psymtab_to_fullname): Remove. * somread.c: Include psymtab.h. (som_sym_fns): Update. * psympriv.h: New file. * psymtab.h: New file. * psymtab.c: New file. * objfiles.h: (ALL_OBJFILE_PSYMTABS): Remove. (ALL_PSYMTABS, ALL_PSPACE_PSYMTABS): Likewise. * objfiles.c: Include psymtab.h. (objfile_relocate1): Use relocate method. (objfile_has_partial_symbols): Use has_symbols method. * mipsread.c: Include psymtab.h. (ecoff_sym_fns): Update. * mi/mi-cmd-file.c: Include psymtab.h. (print_partial_file_name): New function. (mi_cmd_file_list_exec_source_files): Use map_partial_symbol_filenames. * mdebugread.c: Include psympriv.h. * machoread.c: Include psympriv.h. (macho_sym_fns): Update. * m2-exp.y (yylex): Use lookup_symtab. * elfread.c: Include psympriv.h. (elf_sym_fns): Update. * dwarf2read.c: Include psympriv.h. * dbxread.c: Include psympriv.h. (aout_sym_fns): Update. * cp-support.c: Include psymtab.h. (read_in_psymtabs): Remove. (make_symbol_overload_list_qualified): Use expand_symtabs_for_function method. * coffread.c: Include psympriv.h. (coff_sym_fns): Update. * blockframe.c: Include psymtab.h. (find_pc_partial_function): Use find_pc_sect_symtab method. * ada-lang.h (ada_update_initial_language): Update. * ada-lang.c: Include psymtab.h. (ada_update_initial_language): Remove 'main_pst' argument. (ada_lookup_partial_symbol): Remove. (struct ada_psym_data): New type. (ada_add_psyms): New function. (ada_add_non_local_symbols): Use map_ada_symtabs method. (struct add_partial_datum): New type. (ada_add_partial_symbol_completions): New function. (ada_make_symbol_completion_list): Use map_partial_symbol_names. (ada_exception_support_info_sniffer): Update. * Makefile.in (SFILES): Add psymtab.c. (COMMON_OBS): Add psymtab.o. (HFILES_NO_SRCDIR): Add psymtab.h, psympriv.h. gdb/doc * gdbint.texinfo (Symbol Handling): Update.
* gdbTom Tromey2010-02-171-1/+6
| | | | | | | * objfiles.c (gdb_bfd_ref): Handle abfd==NULL. gdb/testsuite * gdb.java/jprint.java (jprint.props): New field. * gdb.java/jprint.exp (set_lang_java): Add regression test.
* 2010-02-08 Tristan Gingold <gingold@adacore.com>Tristan Gingold2010-02-091-4/+7
| | | | | * objfiles.c (objfile_separate_debug_iterate): Do not iterate on brothers of the parent.
* gdb/Jan Kratochvil2010-01-111-6/+12
| | | | | | | * objfiles.c (objfile_relocate1): Change the return type to int. Describe the new return value. Return non-zero if data changed. (objfile_relocate): New variable changed. Set it. Call breakpoint_re_set depending on CHANGED.
* gdb/Jan Kratochvil2010-01-091-3/+52
| | | | | | | | | | | | | | | | Fix displacement of separate debug info files. * objfiles.c (objfile_relocate): Rename to ... (objfile_relocate1): ... here and make it static. Extend the comment. (objfile_relocate): New function. * solib-spu.c (spu_relocate_main_executable): Explicitly check if SYMFILE_OBJFILE is NULL. Remove variables objfile and old_chain. Remove following of SEPARATE_DEBUG_OBJFILE. new_offsets is now allocated using alloca. * symfile.c (copy_section_addr_info): Remove. (build_section_addr_info_from_objfile): Make it global. New variables addr_bit and mask, use them. * symfile.h (build_section_addr_info_from_objfile): New prototype. (copy_section_addr_info): Remove.
* 2010-01-06 Tristan Gingold <gingold@adacore.com>Tristan Gingold2010-01-061-20/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | * symtab.c (lookup_global_symbol_from_objfile): Rename objfile parameter to main_objfile. Iterate on all separate debug objfiles. * symfile.h (symbol_file_add_separate) (find_separate_debug_file_by_debuglink): Remove parameter names. * symfile.c (symbol_file_add_separate): Use add_separate_objfile. (reread_symbols): Use free_objfile_separate_debug. * objfiles.h (struct objfile): Add separate_debug_objfile_link. Adjust comment. (objfile_separate_debug_iterate, add_separate_debug_objfile) (free_objfile_separate_debug): New prototypes. * objfiles.c (objfile_separate_debug_iterate): New function. (add_separate_debug_objfile, free_objfile_separate_debug): New functions. (free_objfile): Use free_objfile_separate_debug. Adjust for multiple separate debug objfile. (objfile_has_symbols): Adjust comment. Iterate on all separate debug objfiles. * minsyms.c (lookup_minimal_symbol): Adjust for multiple separate debug objfile. (lookup_minimal_symbol_text): Ditto. (lookup_minimal_symbol_by_pc_name): Ditto. (lookup_minimal_symbol_solib_trampoline): Ditto. (lookup_minimal_symbol_by_pc_section_1): Iterate on all separate debug objfiles.
* Update copyright year in most headers.Joel Brobecker2010-01-011-1/+1
| | | | Automatic update by copyright.sh.
* gdb/Jan Kratochvil2009-11-111-0/+4
| | | | | | | * objfiles.c (objfile_relocate): Update also the field psymtabs_addrmap. gdb/testsuite/ * gdb.dwarf2/dw2-ranges.exp: Call runto_main.
* * symmisc.c (print_symbol_bcache_statistics): Print filename cacheTom Tromey2009-11-051-0/+2
| | | | | | | | | | | | | statistics. (print_objfile_statistics): Likewise. * symfile.c (reread_symbols): Initialize filename_cache. (allocate_symtab): Cache the file name. (allocate_psymtab): Likewise. * solib-sunos.c (allocate_rt_common_objfile): Initialize filename_cache. * objfiles.h (struct objfile) <filename_cache>: New field. * objfiles.c (allocate_objfile): Initialize filename_cache. (free_objfile): Free filename_cache.
* gdb/Jan Kratochvil2009-11-021-11/+30
| | | | | | | | | | | | | | | | | | | Remove INVALID_ENTRY_POINT. * frame.c (inside_entry_func): New variable entry_point. Return 0 if the entry point is not known. * solib-irix.c (enable_break): Likewise. * objfiles.c (init_entry_point_info): Stop using INVALID_ENTRY_POINT. Initialize EI.ENTRY_POINT_P. (entry_point_address): Rename to ... (entry_point_address_query): ... a new function. Use EI.ENTRY_POINT_P. (entry_point_address): New function. (objfile_relocate): Use EI.ENTRY_POINT_P. * objfiles.h (struct entry_info): Simplify entry_point comment. New field entry_point_p. (INVALID_ENTRY_POINT): Remove. (entry_point_address_query): New prototype. * solib-frv.c (enable_break): Check for NULL SYMFILE_OBJFILE and its EI.ENTRY_POINT_P. Return 0 if ".interp" is not found.
* 2009-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2009-10-231-2/+1
| | | | * objfiles.c (allocate_objfile): Use xzalloc.
* 2009-10-23 Tristan Gingold <gingold@adacore.com>Tristan Gingold2009-10-231-17/+11
| | | | | * objfiles.c (allocate_objfile): Remove useless test. Move declaration of last_one to the block that uses it.
* 2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2009-10-221-0/+16
| | | | | | | PR gdb/10819 * dwarf2-frame.c (find_cie): Don't call bsearch on empty cie_table. * objfiles.c (find_pc_section): Likewise. (update_section_map): Don't allocate empty table.