summaryrefslogtreecommitdiff
path: root/gdb/objfiles.h
Commit message (Collapse)AuthorAgeFilesLines
* New flag OBJF_NOT_FILENAMEJan Kratochvil2013-10-091-0/+5
| | | | | | | | | | | | | | | | | gdb/ 2013-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> New flag OBJF_NOT_FILENAME. * auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME. * jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for allocate_objfile. (jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for symbol_file_add_from_bfd. * jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for allocate_objfile. * objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is NULL. * objfiles.h (OBJF_NOT_FILENAME): New.
* move the demangled_names_hash into the per-BFDTom Tromey2013-10-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | This moves the demangled_names_hash from the objfile into the per-BFD object. This is part of the objfile splitting project. The demangled names hash is independent of the program space. And, it is needed by the symbol tables. Both of these things indicate that it must be pushed into the per-BFD object, which this patch does. Built and regtested on x86-64 Fedora 18. * objfiles.c (free_objfile_per_bfd_storage): Delete the demangled_names_hash. (free_objfile): Don't delete the demangled_names_hash. * objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash>: New field. (struct objfile) <demangled_names_hash>: Move to objfile_per_bfd_storage. * symfile.c (reread_symbols): Don't delete the demangled_names_hash. * symtab.c (create_demangled_names_hash): Update. (symbol_set_names): Update.
* New option "set debug symfile on".Doug Evans2013-09-251-0/+3
| | | | | | | | | | | | | * NEWS: Mention "set debug symfile". * Makefile.in (SFILES): Add symfile-debug.c. (COMMON_OBS): Add symfile-debug.o. * elfread.c (elf_symfile_read): Use objfile_set_sym_fns to set the objfile's symbol functions. * objfiles.h (objfile_set_sym_fns): Declare. * symfile-debug.c: New file. * symfile.c (syms_from_objfile_1): Use objfile_set_sym_fns to set the objfile's symbol functions. (reread_symbols): Ditto.
* Keep objfile original filenameJan Kratochvil2013-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb/ 2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com> Pass down original filename for objfile. * coffread.c (coff_symfile_read): Update symbol_file_add_separate call. * elfread.c (elf_symfile_read): Likewise. * jit.c (jit_object_close_impl): Update allocate_objfile call, no longer set ORIGINAL_NAME. (jit_bfd_try_read_symtab): Update symbol_file_add_from_bfd call. * jv-lang.c (get_dynamics_objfile): Update allocate_objfile call. * machoread.c (macho_add_oso_symfile): Add parameter name. Update symbol_file_add_from_bfd call. (macho_symfile_read_all_oso): Update two macho_add_oso_symfile calls. (macho_check_dsym): Add parameter filenamep. Change function comment. Set *filenamep. (macho_symfile_read): New variable dsym_filename. Update macho_check_dsym call. Use it for symbol_file_add_separate. * objfiles.c (allocate_objfile): Add parameter name. New comment for it. Use it for objfile->original_name. (objfile_name): Return OBFD's filename, if available. * objfiles.h (allocate_objfile): Add new parameter name. * solib.c (solib_read_symbols): Update symbol_file_add_from_bfd call. * symfile-mem.c (symbol_file_add_from_memory): Update symbol_file_add_from_bfd call. * symfile.c (read_symbols): Update symbol_file_add_separate call, new comment for it. (symbol_file_add_with_addrs): New parameter name, add function comment for it. Remove variable name. Update allocate_objfile call. (symbol_file_add_separate): New parameter name, add function comment for it. Update symbol_file_add_with_addrs call. (symbol_file_add_from_bfd): New parameter name. Update symbol_file_add_with_addrs call. (symbol_file_add): Update symbol_file_add_from_bfd call. (reread_symbols): New variable original_name. Save objfile->original_name by it. * symfile.h (symbol_file_add_from_bfd, symbol_file_add_separate): Add second parameter.
* Code cleanup: Add objfile_name accessorJan Kratochvil2013-09-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb/ 2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup: Add objfile_name accessor function. * ada-lang.c (is_known_support_routine): Use objfile_name. * auto-load.c (source_gdb_script_for_objfile) (auto_load_objfile_script): Likewise. * coffread.c (coff_symtab_read, read_one_sym): Likewise. * dbxread.c (dbx_symfile_read): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. * dwarf2loc.c (locexpr_describe_location_piece): Likewise. * dwarf2read.c (dwarf2_get_dwz_file, dwarf2_read_index) (dw2_symtab_iter_next, dw2_expand_symtabs_matching) (lookup_dwp_signatured_type, lookup_dwo_unit) (dwarf2_build_psymtabs_hard, scan_partial_symbols, process_queue) (fixup_go_packaging, process_imported_unit_die, dwarf2_physname) (read_import_statement, create_dwo_cu, open_and_init_dwp_file) (lookup_dwo_cutu, read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, read_common_block, read_typedef) (read_subrange_type, load_partial_dies, read_partial_die) (read_addr_index_1, read_str_index, dwarf_decode_lines_1) (die_containing_type, build_error_marker_type, lookup_die_type) (follow_die_ref_or_sig, follow_die_ref, dwarf2_fetch_die_loc_sect_off) (dwarf2_fetch_constant_bytes, follow_die_sig, get_signatured_type) (get_DW_AT_signature_type, write_psymtabs_to_index) (save_gdb_index_command): Likewise. * elfread.c (find_separate_debug_file_by_buildid, elf_symfile_read): Likewise. * expprint.c (dump_subexp_body_standard): Likewise. * gdbtypes.c (type_name_no_tag_or_error): Likewise. * jit.c (jit_object_close_impl): Use the objfile field name renamed to original_name. * linux-thread-db.c (try_thread_db_load_from_pdir_1): New variable obj_name, use objfile_name for it, use the variable. (try_thread_db_load_from_pdir, has_libpthread, thread_db_new_objfile): Use objfile_name. * machoread.c (macho_symtab_read, macho_check_dsym) (macho_symfile_relocate): Likewise. * maint.c (maintenance_translate_address): Likewise. * minidebug.c (find_separate_debug_file_in_section): Likewise. * minsyms.c (install_minimal_symbols): Likewise. * objfiles.c (allocate_objfile): Use the objfile field name renamed to original_name. (filter_overlapping_sections): Use objfile_name. (objfile_name): New function. * objfiles.h (struct objfile): Rename field name to original_name. (objfile_name): New prototype. * printcmd.c (sym_info, address_info): Use objfile_name. * probe.c (parse_probes, collect_probes, compare_probes) (info_probes_for_ops): Likewise. * progspace.c (clone_program_space): Likewise. * psymtab.c (require_partial_symbols, dump_psymtab, allocate_psymtab) (maintenance_info_psymtabs): Likewise. * python/py-auto-load.c (gdbpy_load_auto_script_for_objfile) (source_section_scripts): Likewise. * python/py-objfile.c (objfpy_get_filename): Likewise. * python/py-progspace.c (pspy_get_filename): Likewise. * solib-aix.c (solib_aix_get_toc_value): Likewise. * solib-som.c (match_main, som_solib_section_offsets): Likewise. * solib.c (solib_read_symbols): Likewise. * stabsread.c (scan_file_globals): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (symbol_file_clear, separate_debug_file_exists) (find_separate_debug_file_by_debuglink): Likewise. (reread_symbols): Likewise. Use the objfile field name renamed to original_name. (allocate_symtab): Use objfile_name. * symmisc.c (print_symbol_bcache_statistics, print_objfile_statistics) (dump_objfile, dump_msymbols, dump_symtab_1) (maintenance_print_msymbols, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs): Likewise. * target.c (target_translate_tls_address, target_info): Likewise. * xcoffread.c (xcoff_initial_scan): Make variable name const. Use objfile_name.
* Remove solib-sunos.cJan Kratochvil2013-09-241-5/+0
| | | | | | | | | | | | | | gdb/ 2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com> Remove solib-sunos.c. * Makefile.in (ALLDEPFILES): Remove solib-sunos.c. * config/m68k/obsd.mh (NATDEPFILES): Remove solib-sunos.o. * objfiles.c (rt_common_objfile): Remove. (free_objfile): Remove rt_common_objfile comparison. * objfiles.h (rt_common_objfile): Remove. * solib-sunos.c: Remove. * symfile.c (reread_symbols): Remove solib-sunos.c comment.
* move gdbarch object from objfile to per-BFDTom Tromey2013-08-201-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the "gdbarch" field from the objfile into the BFD. This field's value is derived from the BFD and is immutable over the lifetime of the BFD. This makes it a reasonable candidate for pushing into the per-BFD object. This is part of the long-term objfile splitting project. In the long run I think this patch will make it simpler to moves types from the objfile to the per-BFD object; but the patch makes sense as a minor cleanup by itself. Built and regtested on x86-64 Fedora 18. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Use get_objfile_arch. * elfread.c (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Use get_objfile_arch. * jit.c (jit_object_close_impl): Update. * jv-lang.c (get_dynamics_objfile): Update. * linespec.c (add_minsym): Use get_dynamics_objfile. * objfiles.c (get_objfile_bfd_data): Initialize 'gdbarch' field. (allocate_objfile): Don't initialize 'gdbarch' field. (get_objfile_arch): Update. * objfiles.h (struct objfile_per_bfd_storage) <gdbarch>: New field, moved from... (struct objfile) <gdbarch>: ... here. Remove. * stap-probe.c (stap_can_evaluate_probe_arguments): Use get_objfile_arch. * symfile.c (init_entry_point_info): Use get_objfile_arch.
* * objfiles.h (pc_in_section): New prototype.Maciej W. Rozycki2013-06-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (in_plt_section): Remove name argument, replace prototype with static inline function. * mips-tdep.h: Include "objfiles.h". (in_mips_stubs_section): New function. * hppa-tdep.h (gdbarch_tdep): Remove name argument of in_solib_call_trampoline member. (hppa_in_solib_call_trampoline): Remove name argument. * objfiles.c (pc_in_section): New function. (in_plt_section): Remove function. * mips-linux-tdep.c: Include "objfiles.h". (mips_linux_in_dynsym_stub): Call in_mips_stubs_section. Remove name argument. Return 1 rather than the low 16-bit halfword of any instruction examined. (mips_linux_in_dynsym_resolve_code): Update mips_linux_in_dynsym_stub call accordingly. * mips-tdep.c (mips_stub_frame_sniffer): Use in_mips_stubs_section rather than an equivalent hand-coded sequence. * hppa-hpux-tdep.c (in_opd_section): Remove function. (hppa32_hpux_in_solib_call_trampoline): Remove name argument. (hppa64_hpux_in_solib_call_trampoline): Likewise. (hppa64_hpux_find_global_pointer): Use pc_in_section rather than in_opd_section. * hppa-tdep.c (hppa_stub_unwind_sniffer): Remove name argument on call to tdep->in_solib_call_trampoline. (hppa_in_solib_call_trampoline): Remove name argument, update according to in_plt_section change. (hppa_skip_trampoline_code): Update according to in_plt_section change. * aarch64-tdep.c (aarch64_stub_unwind_sniffer): Likewise. * arm-symbian-tdep.c (arm_symbian_skip_trampoline_code): Likewise. * arm-tdep.c (arm_stub_unwind_sniffer): Likewise. * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise. * hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise. * nios2-tdep.c (nios2_stub_frame_sniffer): Likewise. * nto-tdep.c (nto_relocate_section_addresses): Likewise. * s390-tdep.c (s390_stub_frame_sniffer): Likewise. * sh-tdep.c (sh_stub_unwind_sniffer): Likewise. * solib-dsbt.c (dsbt_in_dynsym_resolve_code): Likewise. * solib-frv.c (frv_in_dynsym_resolve_code): Likewise. * solib-svr4.c (svr4_in_dynsym_resolve_code): Likewise. * solib-target.c (solib_target_in_dynsym_resolve_code): Likewise. * sparc-tdep.c (sparc_analyze_prologue): Likewise. * tic6x-tdep.c (tic6x_stub_unwind_sniffer): Likewise.
* 2013-06-04 Gary Benson <gbenson@redhat.com>gary2013-06-041-0/+16
| | | | | | | | | | | | | | | | | | | * objfiles.h (inhibit_section_map_updates): New function declaration. (resume_section_map_updates): Likewise. (resume_section_map_updates_cleanup): Likewise. * objfiles.c (objfile_pspace_info): Removed field "objfiles_changed_p". New fields "new_objfiles_available", "section_map_dirty" and "inhibit_updates". (allocate_objfile): Set new_objfiles_available. (free_objfile): Set section_map_dirty. (objfile_relocate1): Likewise. (in_plt_section): Likewise. (find_pc_section): Update the conditions under which the section map will be updated. (inhibit_section_map_updates): New function. (resume_section_map_updates): Likewise. (resume_section_map_updates_cleanup): Likewise.
* * dbxread.c (process_one_symbol): Constify section_offsets parameter.Doug Evans2013-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * stabsread.h (process_one_symbol): Update declaration. * dwarf2read.c (dw2_relocate): Constify new_offsets, delta parameters. * elfread.c (elf_symfile_relocate_probe): Ditto. * psymtab.c (relocate_psymtabs): Ditto. * objfiles.c (objfile_relocate1): Constify new_offsets parameter. (objfile_relocate): Ditto. * objfiles.h (objfile_relocate): Update declaration. * symfile.c (relative_addr_info_to_section_offsets): Constify addrs parameter. (default_symfile_offsets): Ditto. (syms_from_objfile_1): Constify offsets parameter. (syms_from_objfile): Ditto. (symbol_file_add_with_addrs_or_offsets): Ditto. (symfile_map_offsets_to_segments): Constify data parameter. * symfile.h (struct quick_symbol_functions): Constify new_offsets, delta parameters of member relocate. (struct sym_probe_fns): Constify new_offsets, delta parameters of member sym_relocate_probe. (struct sym_fns): Constify section_addr_info parameter of member sym_offsets. (relative_addr_info_to_section_offsets): Update declaration. (default_symfile_offsets): Ditto. (syms_from_objfile): Ditto. (symfile_map_offsets_to_segments): Ditto.
* * coffread.c (cs_to_section): Use gdb_bfd_section_index.Tom Tromey2013-04-081-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elfread.c (record_minimal_symbol, elf_symtab_read): Use gdb_bfd_section_index. * gdb_bfd.c (gdb_bfd_section_index, gdb_bfd_count_sections): New functions. * gdb_bfd.h (gdb_bfd_section_index, gdb_bfd_count_sections): Declare. * machoread.c (macho_symtab_add_minsym, macho_symfile_offsets): Update. * objfiles.c (add_to_objfile_sections_full): New function. (add_to_objfile_sections): Use it. (build_section_table): Rewrite. (objfile_relocate1): Use gdb_bfd_section_index. Update. * objfiles.h (obj_section_offset): Use gdb_bfd_section_index. (struct objfile) <sections>: Update comment. (ALL_OBJFILE_OSECTIONS): Skip sections where the_bfd_section is NULL. (ALL_OBJSECTIONS): Use it. * solib-dsbt.c (dsbt_relocate_main_executable): Update. * solib-frv.c (frv_relocate_main_executable): Update. * solib-target.c (solib_target_relocate_section_addresses): Use gdb_bfd_section_index. * symfile.c (build_section_addr_info_from_section_table): Use gdb_bfd_section_index. (build_section_addr_info_from_bfd, place_section): Likewise. * symtab.c (fixup_section): Update. * xcoffread.c (find_targ_sec): Use gdb_bfd_section_index.
* * gdb_bfd.c (struct gdb_bfd_data) <crc_computed, crc>:Tom Tromey2013-03-141-5/+0
| | | | | | | | | | New fields. (get_file_crc): Move from symfile.c. (gdb_bfd_crc): New function. * gdb_bfd.h (gdb_bfd_crc): Declare. * objfiles.h (struct objfile) <crc32, crc32_p>: Remove. * symfile.c (get_file_crc): Move to gdb_bfd.c. (separate_debug_file_exists): Use gdb_bfd_crc.
* * objfiles.h (ALL_PSPACE_OBJFILES): Remove trailing backlash.Tom Tromey2013-02-281-1/+1
|
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* solib-darwin.c: handle PIE when attaching processes.Joel Brobecker2012-12-181-0/+1
| | | | | | | | | | gdb/ChangeLog: * solib-darwin.c (darwin_current_sos): Fix indentation. (darwin_read_exec_load_addr): New function. (darwin_solib_create_inferior_hook): Rebase executable. * objfiles.c (objfile_rebase1, objfile_rebase): New functions. * objfiles.h (objfile_rebase1, objfile_rebase): Add prototypes.
* Move init_entry_point_info to symfile.c and make it static.Joel Brobecker2012-12-151-2/+0
| | | | | | | | gdb/ChangeLog: * objfiles.c (init_entry_point_info): Move function from here... * symfile.c (init_entry_point_info): ... to there. Make static. * objfiles.h (objfiles.h): Delete declaration.
* * coffread.c (coff_objfile_data_key): New global.Tom Tromey2012-12-121-13/+0
| | | | | | | | | | | | | | | | | | | | | | | (coff_symfile_init): Use set_objfile_data. (coff_symfile_read): Use objfile_data. (coff_symfile_finish): Don't free deprecated_sym_private. (coff_free_info): New function. (_initialize_coffread): Initialize coff_objfile_data_key. * mdebugread.c (pending_list): Update comment. * objfiles.h (struct objfile) <deprecated_sym_private>: Remove. * symfile.c (reread_symbols): Don't mention deprecated_sym_private. * xcoffread.c (xcoff_objfile_data_key): New global. (XCOFF_DATA): New macro. (process_linenos, enter_line_range, xcoff_next_symbol_text) (read_xcoff_symtab, coff_getfilename, read_symbol_lineno): Use XCOFF_DATA. (xcoff_new_init) Use set_objfile_data. (xcoff_symfile_finish): Don't free deprecated_sym_private. (init_stringtab, swap_sym, scan_xcoff_symtab) (xcoff_get_toc_offset, xcoff_initial_scan): Use XCOFF_DATA. (xcoff_free_info): New function. (_initialize_xcoffread): Initialize xcoff_objfile_data_key.
* * coffread.c (coff_symfile_init): Use set_objfile_data.Tom Tromey2012-12-121-11/+1
| | | | | | | | | | | | | | | | | | | | | | (coff_symfile_read): Use DBX_SYMFILE_INFO. * dbxread.c (dbx_objfile_data_key): New global. (dbx_symfile_init): Use set_objfile_data. (dbx_symfile_finish): Don't free deprecated_sym_stab_info. (dbx_free_symfile_info): New function. (coffstab_build_psymtabs, elfstab_build_psymtabs): Use DBX_SYMFILE_INFO. (stabsect_build_psymtabs): Use set_objfile_data. (_initialize_dbxreadb): Initialize dbx_objfile_data_key. * elfread.c (elf_symtab_read): Use DBX_SYMFILE_INFO, set_objfile_data. (free_elfinfo): Use DBX_SYMFILE_INFO. (elf_symfile_finish): Don't free deprecated_sym_stab_info. (elfstab_offset_sections): Use DBX_SYMFILE_INFO. * gdb-stabs.h (dbx_objfile_data_key): Declare. (DBX_SYMFILE_INFO): Rewrite to use objfile_data. * objfiles.h (struct objfile) <deprecated_sym_stab_info>: Remove. * somread.c (som_symfile_finish): Don't free deprecated_sym_stab_info.
* * jit.c (jit_object_close_impl): Don't malloc the objfileTom Tromey2012-08-221-2/+3
| | | | | | | | | | 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-1/+3
| | | | | | | | | | | | * 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-1/+25
| | | | | | | | | | | | | | | | | | | * 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.
* * auto-load.c (_initialize_auto_load): Update.Tom Tromey2012-08-221-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * dwarf2read.c (try_open_dwo_file): Use gdb_bfd_ref andTom Tromey2012-07-181-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * objfiles.h (ALL_OBJFILE_PRIMARY_SYMTABS): New macro.Doug Evans2012-06-041-4/+8
| | | | | | | | | (ALL_PRIMARY_SYMTABS): Use it. (ALL_PSPACE_PRIMARY_SYMTABS): Ditto. * dwarf2read.c (dw2_find_symbol_file): Ditto. * linespec.c (iterate_over_all_matching_symtabs): Ditto. * symtab.c (lookup_symbol_aux_objfile): Ditto. (basic_lookup_transparent_type): Ditto.
* * objfiles.c (add_to_objfile_sections): Remove outdated comments.Doug Evans2012-02-211-11/+10
| | | | | | | | 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.
* * objfiles.h (struct objfile): Remove obsolete comment.Tom Tromey2011-12-081-13/+3
| | | | | * objfiles.c (build_objfile_section_table): Remove obsolete comment.
* gdb/Jan Kratochvil2011-10-111-0/+5
| | | | | | | | | | Fix separate debuginfo warning with "remote:" access. * objfiles.h (struct objfile): New fields crc32 and crc32_p. * symfile.c (get_file_crc): New function with the code moved from ... (separate_debug_file_exists): ... this function, specifically variables buffer and count. New variable verified_as_different, set it. Remove file_crc initialization. Verify also if both files are not the same manually, if needed.
* * linux-thread-db.c (thread_db_new_objfile): Only try to loadDoug Evans2011-10-111-1/+7
| | | | | | | | | | | | libthread_db when we load libpthread or the main symbol file. (thread_db_inferior_created): New function. (_initialize_thread_db): Attach inferior_created observer. * linux-nat.c (linux_child_post_attach): Remove call to check_for_thread_db. (linux_child_post_startup_inferior): Ditto. * objfiles.h (OBJF_MAINLINE): Define. * symfile.c (symbol_file_add_with_addrs_or_offsets): Pass it to allocate_objfile when appropriate.
* * symtab.h (current_objfile): Don't declare.Tom Tromey2011-06-141-15/+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.
* 2011-06-01 Yao Qi <yao@codesourcery.com>qiyao2011-06-011-2/+2
| | | | | | * objfiles.h (obj_section_addr): Update reference to objfile from `abfd' to `obfd'. (obj_section_endaddr): Likewise.
* gdbTom Tromey2011-04-041-7/+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-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-25 Mathieu Lacage <mathieu.lacage@inria.fr>Thiago Jung Bauermann2011-01-261-0/+2
| | | | | | | PR/symtab 11766: * gdb/objfiles.h (struct objfile) <addr_low>: New field. * gdb/solib.c (solib_read_symbols): Check for addr_low in equality test for objfile, initialize addr_low if needed.
* 2011-01-10 Michael Snyder <msnyder@vmware.com>Michael Snyder2011-01-101-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
|
* * symfile.h (struct sym_fns) <next>: Remove.Tom Tromey2010-09-301-1/+1
| | | | | | | | | | | | | | | | | | (add_symtab_fns): Update. * symfile.c (sym_fns_ptr): New typedef. (symtab_fns): Now a VEC. (add_symtab_fns): Update. Change argument type. (find_sym_fns): Update. Change return type. (get_symfile_segment_data): Update. * objfiles.h (struct objfile) <sf>: Now const. * somread.c (som_sym_fns): Now const. Update. * xcoffread.c (xcoff_sym_fns): Now const. Update. * mipsread.c (ecoff_sym_fns): Now const. Update. * machoread.c (macho_sym_fns): Now const. Update. * elfread.c (elf_sym_fns): Now const. Update. (elf_sym_fns_gdb_index): Likewise. * dbxread.c (aout_sym_fns): Now const. Update. * coffread.c (coff_sym_fns): Now const. Update.
* * objfiles.h (ALL_OBJSECTIONS): Handle breaks in the inner loop.Pedro Alves2010-09-241-3/+38
|
* gdb/Jan Kratochvil2010-09-221-2/+2
| | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* gdbTom Tromey2010-07-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * objfiles.h (gdb_bfd_close_or_warn): Declare.Pedro Alves2010-04-141-0/+1
| | | | | | | | * 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-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2010-01-06 Tristan Gingold <gingold@adacore.com>Tristan Gingold2010-01-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * symmisc.c (print_symbol_bcache_statistics): Print filename cacheTom Tromey2009-11-051-0/+1
| | | | | | | | | | | | | 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-7/+5
| | | | | | | | | | | | | | | | | | | 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-19 Pedro Alves <pedro@codesourcery.com>Pedro Alves2009-10-191-21/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stan Shebs <stan@codesourcery.com> Add base multi-executable/process support to GDB. gdb/ * Makefile.in (SFILES): Add progspace.c. (COMMON_OBS): Add progspace.o. * progspace.h: New. * progspace.c: New. * breakpoint.h (struct bp_target_info) <placed_address_space>: New field. (struct bp_location) <pspace>: New field. (struct breakpoint) <pspace>: New field. (bpstat_stop_status, breakpoint_here_p) (moribund_breakpoint_here_p, breakpoint_inserted_here_p) (regular_breakpoint_inserted_here_p) (software_breakpoint_inserted_here_p, breakpoint_thread_match) (set_default_breakpoint): Adjust prototypes. (remove_breakpoints_pid, breakpoint_program_space_exit): Declare. (insert_single_step_breakpoint, deprecated_insert_raw_breakpoint): Adjust prototypes. * breakpoint.c (executing_startup): Delete. (default_breakpoint_sspace): New. (breakpoint_restore_shadows): Skip if the address space doesn't match. (update_watchpoint): Record the frame's program space in the breakpoint location. (insert_bp_location): Record the address space in target_info. Adjust to pass the symbol space to solib_name_from_address. (breakpoint_program_space_exit): New. (insert_breakpoint_locations): Switch the symbol space and thread when inserting breakpoints. Don't insert breakpoints in a vfork parent waiting for vfork done if we're not attached to the vfork child. (remove_breakpoints_pid): New. (reattach_breakpoints): Switch to a thread of PID. Ignore breakpoints of other symbol spaces. (create_internal_breakpoint): Store the symbol space in the sal. (create_longjmp_master_breakpoint): Iterate over all symbol spaces. (update_breakpoints_after_exec): Ignore breakpoints for other symbol spaces. (remove_breakpoint): Rename to ... (remove_breakpoint_1): ... this. Pass the breakpoints symbol space to solib_name_from_address. (remove_breakpoint): New. (mark_breakpoints_out): Ignore breakpoints from other symbol spaces. (breakpoint_init_inferior): Ditto. (breakpoint_here_p): Add an address space argument and adjust to use breakpoint_address_match. (moribund_breakpoint_here_p): Ditto. (regular_breakpoint_inserted_here_p): Ditto. (breakpoint_inserted_here_p): Ditto. (software_breakpoint_inserted_here_p): Ditto. (breakpoint_thread_match): Ditto. (bpstat_check_location): Ditto. (bpstat_stop_status): Ditto. (print_breakpoint_location): If there's a location to print, switch the current symbol space. (print_one_breakpoint_location): Add `allflag' argument. (print_one_breakpoint): Ditto. Adjust. (do_captured_breakpoint_query): Adjust. (breakpoint_1): Adjust. (breakpoint_has_pc): Also match the symbol space. (describe_other_breakpoints): Add a symbol space argument and adjust. (set_default_breakpoint): Add a symbol space argument. Set default_breakpoint_sspace. (breakpoint_address_match): New. (check_duplicates_for): Add an address space argument, and adjust. (set_raw_breakpoint): Record the symbol space in the location and in the breakpoint. (set_longjmp_breakpoint): Skip longjmp master breakpoints from other symbol spaces. (remove_thread_event_breakpoints, remove_solib_event_breakpoints) (disable_breakpoints_in_shlibs): Skip breakpoints from other symbol spaces. (disable_breakpoints_in_unloaded_shlib): Match symbol spaces. (create_catchpoint): Set the symbol space in the sal. (disable_breakpoints_before_startup): Skip breakpoints from other symbol spaces. Set executing_startup in the current symbol space. (enable_breakpoints_after_startup): Clear executing_startup in the current symbol space. Skip breakpoints from other symbol spaces. (clone_momentary_breakpoint): Also copy the symbol space. (add_location_to_breakpoint): Set the location's symbol space. (bp_loc_is_permanent): Switch thread and symbol space. (create_breakpoint): Adjust. (expand_line_sal_maybe): Expand comment to mention symbol spaces. Switch thread and symbol space when reading memory. (parse_breakpoint_sals): Set the symbol space in the sal. (break_command_really): Ditto. (skip_prologue_sal): Switch and space. (resolve_sal_pc): Ditto. (watch_command_1): Record the symbol space in the sal. (create_ada_exception_breakpoint): Adjust. (clear_command): Adjust. Match symbol spaces. (update_global_location_list): Use breakpoint_address_match. (breakpoint_re_set_one): Switch thread and space. (breakpoint_re_set): Save symbol space. (breakpoint_re_set_thread): Also reset the symbol space. (deprecated_insert_raw_breakpoint): Add an address space argument. Adjust. (insert_single_step_breakpoint): Ditto. (single_step_breakpoint_inserted_here_p): Ditto. (clear_syscall_counts): New. (_initialize_breakpoint): Install it as inferior_exit observer. * exec.h: Include "progspace.h". (exec_bfd, exec_bfd_mtime): New defines. (exec_close): Declare. * exec.c: Include "gdbthread.h" and "progspace.h". (exec_bfd, exec_bfd_mtime, current_target_sections_1): Delete. (using_exec_ops): New. (exec_close_1): Rename to exec_close, and make public. (exec_close): Rename to exec_close_1, and adjust all callers. Add description. Remove target sections and close executables from all program spaces. (exec_file_attach): Add comment. (add_target_sections): Check on `using_exec_ops' to check if the target should be pushed. (remove_target_sections): Only unpush the target if there are no more target sections in any symbol space. * gdbcore.h: Include "exec.h". (exec_bfd, exec_bfd_mtime): Remove declarations. * frame.h (get_frame_program_space, get_frame_address_space) (frame_unwind_program_space): Declare. * frame.c (struct frame_info) <pspace, aspace>: New fields. (create_sentinel_frame): Add program space argument. Set the pspace and aspace fields of the frame object. (get_current_frame, create_new_frame): Adjust. (get_frame_program_space): New. (frame_unwind_program_space): New. (get_frame_address_space): New. * stack.c (print_frame_info): Adjust. (print_frame): Use the frame's program space. * gdbthread.h (any_live_thread_of_process): Declare. * thread.c (any_live_thread_of_process): New. (switch_to_thread): Switch the program space as well. (restore_selected_frame): Don't warn if trying to restore frame level 0. * inferior.h: Include "progspace.h". (detach_fork): Declare. (struct inferior) <removable, aspace, pspace> <vfork_parent, vfork_child, pending_detach> <waiting_for_vfork_done>: New fields. <terminal_info>: Remove field. <data, num_data>: New fields. (register_inferior_data, register_inferior_data_with_cleanup) (clear_inferior_data, set_inferior_data, inferior_data): Declare. (exit_inferior, exit_inferior_silent, exit_inferior_num_silent) (inferior_appeared): Declare. (find_inferior_pid): Typo. (find_inferior_id, find_inferior_for_program_space): Declare. (set_current_inferior, save_current_inferior, prune_inferiors) (number_of_inferiors): Declare. (inferior_list): Declare. * inferior.c: Include "gdbcore.h" and "symfile.h". (inferior_list): Make public. (delete_inferior_1): Always delete thread silently. (find_inferior_id): Make public. (current_inferior_): New. (current_inferior): Use it. (set_current_inferior): New. (restore_inferior): New. (save_current_inferior): New. (free_inferior): Free the per-inferior data. (add_inferior_silent): Allocate per-inferior data. Call inferior_appeared. (delete_threads_of_inferior): New. (delete_inferior_1): Adjust interface to take an inferior pointer. (delete_inferior): Adjust. (delete_inferior_silent): Adjust. (exit_inferior_1): New. (exit_inferior): New. (exit_inferior_silent): New. (exit_inferior_num_silent): New. (detach_inferior): Adjust. (inferior_appeared): New. (discard_all_inferiors): Adjust. (find_inferior_id): Make public. Assert pid is not zero. (find_inferior_for_program_space): New. (have_inferiors): Check if we have any inferior with pid not zero. (have_live_inferiors): Go over all pushed targets looking for process_stratum. (prune_inferiors): New. (number_of_inferiors): New. (print_inferior): Add executable column. Print vfork parent/child relationships. (inferior_command): Adjust to cope with not running inferiors. (remove_inferior_command): New. (add_inferior_command): New. (clone_inferior_command): New. (struct inferior_data): New. (struct inferior_data_registration): New. (struct inferior_data_registry): New. (inferior_data_registry): New. (register_inferior_data_with_cleanup): New. (register_inferior_data): New. (inferior_alloc_data): New. (inferior_free_data): New. (clear_inferior_data): New. (set_inferior_data): New. (inferior_data): New. (initialize_inferiors): New. (_initialize_inferiors): Register "add-inferior", "remove-inferior" and "clone-inferior" commands. * objfiles.h: Include "progspace.h". (struct objfile) <pspace>: New field. (symfile_objfile, object_files): Don't declare. (ALL_PSPACE_OBJFILES): New. (ALL_PSPACE_OBJFILES_SAFE): New. (ALL_OBJFILES, ALL_OBJFILES_SAFE): Adjust. (ALL_PSPACE_SYMTABS): New. (ALL_PRIMARY_SYMTABS): Adjust. (ALL_PSPACE_PRIMARY_SYMTABS): New. (ALL_PSYMTABS): Adjust. (ALL_PSPACE_PSYMTABS): New. * objfiles.c (object_files, symfile_objfile): Delete. (struct objfile_sspace_info): New. (objfiles_pspace_data): New. (objfiles_pspace_data_cleanup): New. (get_objfile_pspace_data): New. (objfiles_changed_p): Delete. (allocate_objfile): Set the objfile's program space. Adjust to reference objfiles_changed_p in pspace data. (free_objfile): Adjust to reference objfiles_changed_p in pspace data. (objfile_relocate): Ditto. (update_section_map): Add pspace argument. Adjust to iterate over objfiles in the passed in pspace. (find_pc_section): Delete sections and num_sections statics. Adjust to refer to program space's objfiles_changed_p. Adjust to refer to sections and num_sections store in the objfile's pspace data. (objfiles_changed): Adjust to reference objfiles_changed_p in pspace data. (_initialize_objfiles): New. * linespec.c (decode_all_digits, decode_dollar): Set the sal's program space. * source.c (current_source_pspace): New. (get_current_source_symtab_and_line): Set the sal's program space. (set_current_source_symtab_and_line): Set current_source_pspace. (select_source_symtab): Ditto. Use ALL_OBJFILES. (forget_cached_source_info): Iterate over all program spaces. * symfile.c (clear_symtab_users): Adjust. * symmisc.c (print_symbol_bcache_statistics): Iterate over all program spaces. (print_objfile_statistics): Ditto. (maintenance_print_msymbols): Ditto. (maintenance_print_objfiles): Ditto. (maintenance_info_symtabs): Ditto. (maintenance_info_psymtabs): Ditto. * symtab.h (SYMTAB_PSPACE): New. (struct symtab_and_line) <pspace>: New field. * symtab.c (init_sal): Clear the sal's program space. (find_pc_sect_symtab): Set the sal's program space. Switch thread and space. (append_expanded_sal): Add program space argument. Iterate over all program spaces. (expand_line_sal): Iterate over all program spaces. Switch program space. * target.h (enum target_waitkind) <TARGET_WAITKIND_VFORK_DONE>: New. (struct target_ops) <to_thread_address_space>: New field. (target_thread_address_space): Define. * target.c (target_detach): Only remove breakpoints from the inferior we're detaching. (target_thread_address_space): New. * defs.h (initialize_progspace): Declare. * top.c (gdb_init): Call it. * solist.h (struct so_list) <sspace>: New field. * solib.h (struct program_space): Forward declare. (solib_name_from_address): Adjust prototype. * solib.c (so_list_head): Replace with a macro referencing the program space. (update_solib_list): Set the so's program space. (solib_name_from_address): Add a program space argument and adjust. * solib-svr4.c (struct svr4_info) <pid>: Delete field. <interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low> <interp_plt_sect_high>: New fields. (svr4_info_p, svr4_info): Delete. (solib_svr4_sspace_data): New. (get_svr4_info): Rewrite. (svr4_sspace_data_cleanup): New. (open_symbol_file_object): Adjust. (svr4_default_sos): Adjust. (svr4_fetch_objfile_link_map): Adjust. (interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low) (interp_plt_sect_high): Delete. (svr4_in_dynsym_resolve_code): Adjust. (enable_break): Adjust. (svr4_clear_solib): Revert bit that removed the svr4_info here, and reinstate clearing debug_base, debug_loader_offset_p, debug_loader_offset and debug_loader_name. (_initialize_svr4_solib): Register solib_svr4_pspace_data. Don't install an inferior_exit observer anymore. * printcmd.c (struct display) <pspace>: New field. (display_command): Set the display's sspace. (do_one_display): Match the display's sspace. (display_uses_solib_p): Ditto. * linux-fork.c (detach_fork): Moved to infrun.c. (_initialize_linux_fork): Moved "detach-on-fork" command to infrun.c. * infrun.c (detach_fork): Moved from linux-fork.c. (proceed_after_vfork_done): New. (handle_vfork_child_exec_or_exit): New. (follow_exec_mode_replace, follow_exec_mode_keep) (follow_exec_mode_names, follow_exec_mode_string) (show_follow_exec_mode_string): New. (follow_exec): New. Reinstate the mark_breakpoints_out call. Remove shared libraries before attaching new executable. If user wants to keep the inferior, keep it. (displaced_step_fixup): Adjust to pass an address space to the breakpoints module. (resume): Ditto. (clear_proceed_status): In all-stop mode, always clear the proceed status of all threads. (prepare_to_proceed): Adjust to pass an address space to the breakpoints module. (proceed): Ditto. (adjust_pc_after_break): Ditto. (handle_inferior_event): When handling a process exit, switch the program space to the inferior's that had exited. Call handle_vfork_child_exec_or_exit. Adjust to pass an address space to the breakpoints module. In non-stop mode, when following a fork and detach-fork is off, also resume the other branch. Handle TARGET_WAITKIND_VFORK_DONE. Set the program space in sals. (normal_stop): Prune inferiors. (_initialize_infrun): Install the new "follow-exec-mode" command. "detach-on-fork" moved here. * regcache.h (get_regcache_aspace): Declare. * regcache.c (struct regcache) <aspace>: New field. (regcache_xmalloc): Clear the aspace. (get_regcache_aspace): New. (regcache_cpy): Copy the aspace field. (regcache_cpy_no_passthrough): Ditto. (get_thread_regcache): Fetch the thread's address space from the target, and store it in the regcache. * infcall.c (call_function_by_hand): Set the sal's pspace. * arch-utils.c (default_has_shared_address_space): New. * arch-utils.h (default_has_shared_address_space): Declare. * gdbarch.sh (has_shared_address_space): New. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.c: Include auxv.h, target.h, elf/common.h. (linux_has_shared_address_space): New. (_initialize_linux_tdep): Declare. * arm-tdep.c (arm_software_single_step): Pass the frame's address space to insert_single_step_breakpoint. * arm-linux-tdep.c (arm_linux_software_single_step): Pass the frame's pspace to breakpoint functions. * cris-tdep.c (crisv32_single_step_through_delay): Ditto. (cris_software_single_step): Ditto. * mips-tdep.c (deal_with_atomic_sequence): Add frame argument. Pass the frame's pspace to breakpoint functions. (mips_software_single_step): Adjust. (mips_single_step_through_delay): Adjust. * rs6000-aix-tdep.c (rs6000_software_single_step): Adjust. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Adjust. * solib-irix.c (enable_break): Adjust to pass the current frame's address space to breakpoint functions. * sparc-tdep.c (sparc_software_single_step): Ditto. * spu-tdep.c (spu_software_single_step): Ditto. * alpha-tdep.c (alpha_software_single_step): Ditto. * record.c (record_wait): Adjust to pass an address space to the breakpoints module. * fork-child.c (fork_inferior): Set the new inferior's program and address spaces. * inf-ptrace.c (inf_ptrace_follow_fork): Copy the parent's program and address spaces. (inf_ptrace_attach): Set the inferior's program and address spaces. * linux-nat.c: Include "solib.h". (linux_child_follow_fork): Manage parent and child's program and address spaces. Clone the parent's program space if necessary. Don't wait for the vfork to be done here. Refuse to resume if following the vfork parent while leaving the child stopped. (resume_callback): Don't resume a vfork parent. (linux_nat_resume): Also check for pending events in the lp->waitstatus field. (linux_handle_extended_wait): Report TARGET_WAITKIND_VFORK_DONE events to the core. (stop_wait_callback): Don't wait for SIGSTOP on vfork parents. (cancel_breakpoint): Adjust. * linux-thread-db.c (thread_db_wait): Don't remove thread event breakpoints here. (thread_db_mourn_inferior): Don't mark breakpoints out here. Remove thread event breakpoints after mourning. * corelow.c: Include progspace.h. (core_open): Set the inferior's program and address spaces. * remote.c (remote_add_inferior): Set the new inferior's program and address spaces. (remote_start_remote): Update address spaces. (extended_remote_create_inferior_1): Don't init the thread list if we already debugging other inferiors. * darwin-nat.c (darwin_attach): Set the new inferior's program and address spaces. * gnu-nat.c (gnu_attach): Ditto. * go32-nat.c (go32_create_inferior): Ditto. * inf-ttrace.c (inf_ttrace_follow_fork, inf_ttrace_attach): Ditto. * monitor.c (monitor_open): Ditto. * nto-procfs.c (procfs_attach, procfs_create_inferior): Ditto. * procfs.c (do_attach): Ditto. * windows-nat.c (do_initial_windows_stuff): Ditto. * inflow.c (inferior_process_group) (terminal_init_inferior_with_pgrp, terminal_inferior, (terminal_ours_1, inflow_inferior_exit, copy_terminal_info) (child_terminal_info, new_tty_postfork, set_sigint_trap): Adjust to use per-inferior data instead of inferior->terminal_info. (inflow_inferior_data): New. (inflow_new_inferior): Delete. (inflow_inferior_data_cleanup): New. (get_inflow_inferior_data): New. * mi/mi-interp.c (mi_new_inferior): Rename to... (mi_inferior_appeared): ... this. (mi_interpreter_init): Adjust. * tui/tui-disasm.c: Include "progspace.h". (tui_set_disassem_content): Pass an address space to breakpoint_here_p. * NEWS: Mention multi-program debugging support. Mention new commands "add-inferior", "clone-inferior", "remove-inferior", "maint info program-spaces", and new option "set follow-exec-mode". 2009-10-19 Pedro Alves <pedro@codesourcery.com> Stan Shebs <stan@codesourcery.com> gdb/doc/ * observer.texi (new_inferior): Rename to... (inferior_appeared): ... this. 2009-10-19 Pedro Alves <pedro@codesourcery.com> Stan Shebs <stan@codesourcery.com> gdb/testsuite/ * gdb.base/foll-vfork.exp: Adjust to spell out "follow-fork". * gdb.base/foll-exec.exp: Adjust to expect a process id before "Executing new program". * gdb.base/foll-fork.exp: Adjust to spell out "follow-fork". * gdb.base/multi-forks.exp: Ditto. Adjust to the inferior being left listed after having been killed. * gdb.base/attach.exp: Adjust to spell out "symbol-file". * gdb.base/maint.exp: Adjust test. * Makefile.in (ALL_SUBDIRS): Add gdb.multi. * gdb.multi/Makefile.in: New. * gdb.multi/base.exp: New. * gdb.multi/goodbye.c: New. * gdb.multi/hangout.c: New. * gdb.multi/hello.c: New. * gdb.multi/bkpt-multi-exec.c: New. * gdb.multi/bkpt-multi-exec.exp: New. * gdb.multi/crashme.c: New. 2009-10-19 Pedro Alves <pedro@codesourcery.com> Stan Shebs <stan@codesourcery.com> gdb/doc/ * gdb.texinfo (Inferiors): Rename node to ... (Inferiors and Programs): ... this. Mention running multiple programs in the same debug session. <info inferiors>: Mention the new 'Executable' column if "info inferiors". Update examples. Document the "add-inferior", "clone-inferior", "remove-inferior" and "maint info program-spaces" commands. (Process): Rename node to... (Forks): ... this. Document "set|show follow-exec-mode".