summaryrefslogtreecommitdiff
path: root/gdb/symfile.c
Commit message (Collapse)AuthorAgeFilesLines
* move the demangled_names_hash into the per-BFDTom Tromey2013-10-071-5/+0
| | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | * 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.
* * symfile.h (struct sym_fns): Delete member "sym_flavour".Doug Evans2013-09-251-12/+24
| | | | | | | | | | All uses updated. (add_symtab_fns): Update prototype. * symfile.c (sym_fns_ptr): Delete. Replace with ... (registered_sym_fns): ... this. (symtab_fns): Update. (add_symtab_fns): New arg "flavour". All callers updated. (find_sym_fns): Rewrite to use new sym_fns registry.
* Keep objfile original filenameJan Kratochvil2013-09-241-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+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.
* Mostly code cleanup: Constification.Jan Kratochvil2013-09-191-12/+12
| | | | | | | | | | | | | | | | | gdb/ 2013-09-19 Jan Kratochvil <jan.kratochvil@redhat.com> Constification. * main.c (captured_main): Replace catch_command_errors by catch_command_errors_const. Twice. * symfile.c (symbol_file_add_main_1): Make args parameter const. (symbol_file_add): Make name parameter const. (symbol_file_add_main, symbol_file_add_main_1): Make args parameter const. (symfile_bfd_open): Make name parameter const, rename it to cname. Add variable name. Change their usage accordingly. * symfile.h (symbol_file_add, symfile_bfd_open): Make first parameter const. (symbol_file_add_main): Make args parameter const.
* Code cleanup: Move variable.Jan Kratochvil2013-09-131-1/+1
| | | | | | | | | gdb/ 2013-09-13 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup. * symfile.c (reread_symbols): Move variable obfd_filename to a more inner block.
* 2013-09-05 Muhammad Bilal <mbilal@codesourcery.com>mbilal2013-09-051-1/+0
| | | | | * symfile.c (add_symbol_file_command): Remove trailing whitespaces and blank line after comment.
* Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH.Jan Kratochvil2013-09-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | gdb/ 2013-09-04 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH. * cli/cli-cmds.c (find_and_open_script): Add OPF_RETURN_REALPATH to variable search_flags. * defs.h (OPF_DISABLE_REALPATH): Rename to ... (OPF_RETURN_REALPATH): ... here. * dwarf2read.c (try_open_dwop_file): Set OPF_RETURN_REALPATH for flags. * exec.c (exec_file_attach): Remove OPF_DISABLE_REALPATH from openp call. Twice. * nto-tdep.c (nto_find_and_open_solib): Add OPF_RETURN_REALPATH for openp call. * solib.c (solib_find): Likewise. Four times. * source.c (openp): Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH in the function comment and for the realpath_fptr variable. (source_full_path_of): Add OPF_RETURN_REALPATH for openp call. (find_and_open_source): Likewise. Twice. * symfile.c (symfile_bfd_open): Likewise, also twice.
* 2013-09-04 Muhammad Bilal <mbilal@codesourcery.com>mbilal2013-09-041-56/+48
| | | | | | | | | | | | | Pedro Alves <palves@redhat.com> * symfile.c (add_symbol_file_command): Error out on unknown option. Handle EXPECTING_SEC_ADDR/EXPECTING_SEC_NAME before '-' options and collapse into single conditional branch. 2013-09-13 Muhammad Bilal <mbilal@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.base/relocate.exp: Check that invalid options are rejected.
* PR symtab/15885Doug Evans2013-08-261-0/+6
| | | | | | | | | | | * dwarf2read.c (dw2_dump): Print some minimal information indicating .gdb_index is in use. * symfile.c (reread_symbols): Reset objfile->sf. testsuite/ * gdb.dwarf2/Makefile.in (EXECUTABLES): Add gdb-index. (clean): rm -f *.gdb-index *.with-index. * gdb.dwarf2/gdb-index.exp: New testcase.
* move gdbarch object from objfile to per-BFDTom Tromey2013-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* use language of the main symbolTom Tromey2013-08-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With "dwz -m", "main" appears in both the PU and the importing CU when running anon-struct.exp. However, the PU does not have a file name. So, find_main_filename returns the empty string, making deduce_language_from_filename return language_unknown. This patch fixes this problem by changing gdb to use the ordinary symbol-lookup functions to find "main"'s symbol. Then, it examines the symbol's language. I think this is cleaner than the current approach. For one thing it avoids trying to guess the language based on the source file name, instead deferring to the presumably more reliable debuginfo. Another possible fix would have been to change how the file name is found via the "qf" methods. However, I think the approach given is preferable for the reason outlined above. This required a minor test suite change, as now a symtab is expanded during the search for "main". Built and regtested (both ways) on x86-64 Fedora 18. * symfile.c (set_initial_language): Look up "main" symbol and use its language. * symtab.c (find_main_filename): Remove. * symtab.h (find_main_filename): Remove. * gdb.base/maint.exp: Allow zero symtabs to be expanded.
* remove msymbol_objfileTom Tromey2013-08-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another patch in my ongoing series to "split" objfile to share more read-only data across inferiors. See http://sourceware.org/gdb/wiki/ObjfileSplitting When symbols are finally shared, there will be no back-link from the symbol to its containing objfile, because there may be more than one such objfile. So, all such back-links must be removed. One hidden back-link is the msymbol_objfile function. Since (eventually) a symbol may appear in more than one objfile, trying to look up the objfile given just a symbol cannot work. This patch removes msymbol_objfile in favor of using a bound minimal symbol. It introduces a new function to make this conversion simpler in some spots. The bonus of this patch is that using msymbol_objfile is slower than simply looking up the owning objfile in the first place. Built and regtested on x86-64 Fedora 18. * ada-exp.y (write_var_or_type): Use bound_minimal_symbol. * ada-lang.c (ada_lookup_simple_minsym): Return bound_minimal_symbol. * ada-lang.h (ada_lookup_simple_minsym): Update. * c-exp.y (variable): Use lookup_bound_minimal_symbol. * f-exp.y (variable): Use lookup_bound_minimal_symbol. * go-exp.y (variable): Use lookup_bound_minimal_symbol. * jv-exp.y (push_expression_name): Use lookup_bound_minimal_symbol. * m2-exp.y (variable): Use lookup_bound_minimal_symbol. * minsyms.c (msymbol_objfile): Remove. (lookup_minimal_symbol_internal): New function, from lookup_minimal_symbol. (lookup_minimal_symbol): Rewrite using lookup_minimal_symbol_internal. (lookup_bound_minimal_symbol): New function. * minsyms.h (msymbol_objfile): Remove. (lookup_bound_minimal_symbol): Declare. * p-exp.y (variable): Use lookup_bound_minimal_symbol. * parse.c (write_exp_msymbol): Change parameter to a bound_minimal_symbol. (write_dollar_variable): Use lookup_bound_minimal_symbol. * parser-defs.h (write_exp_msymbol): Update. * printcmd.c (address_info): Use lookup_bound_minimal_symbol. * symfile.c (simple_read_overlay_table): Use lookup_bound_minimal_symbol. * symtab.c (skip_prologue_sal): Don't use msymbol_objfile. (search_symbols): Likewise. (print_msymbol_info): Take a bound_minimal_symbol argument. (symtab_symbol_info, rbreak_command): Update. * symtab.h (struct symbol_search) <msymbol>: Change type to bound_minimal_symbol. * valops.c (find_function_in_inferior): Use lookup_bound_minimal_symbol. * value.c (value_fn_field): Use lookup_bound_minimal_symbol.
* * target.h (struct target_section): Delete member bfd.Doug Evans2013-07-161-6/+6
| | | | | | | | | | | | | | | | | All users updated to use the_bfd_section->owner instead. * exec.c (add_to_section_table): Assert bfd is expected value. Remove initialization of target_section.bfd. (remove_target_sections): Update. (section_table_available_memory): Update. (section_table_xfer_memory_partial): Update. (print_section_info): Update. (exec_set_section_address): Update. * record-full.c (record_full_core_xfer_partial): Update. * solib-svr4.c (svr4_relocate_section_addresses): Update. * solib-target.c (solib_target_relocate_section_addresses): Update. * symfile.c (build_section_addr_info_from_section_table): Update. * target.c (memory_xfer_live_readonly_partial): Update. (memory_xfer_partial_1): Update.
* * symfile.c (symfile_bfd_open): Delete unnecessary declaration.Doug Evans2013-06-191-4/+0
| | | | (get_section_index): Ditto.
* fix one bug in symfile.cTom Tromey2013-05-301-2/+8
| | | | | | | find_separate_debug_file could leak a cleanup along some return paths. * symfile.c (find_separate_debug_file): Call do_cleanups along all return paths.
* some cleanup checker fixesTom Tromey2013-05-301-0/+4
| | | | | | | | | | | | | | | Fix some bugs pointed out by the cleanup checker. This one just fixes some simple CLI reports, where CLI commands know that their caller will do cleanups. This an older style with few instances, so it is simpler to fix them up than to teach the checker about it. * cli/cli-cmds.c (cd_command, alias_command): Call do_cleanups. * cli/cli-dump.c (restore_binary_file): Call do_cleanups. * interps.c (interpreter_exec_cmd): Call do_cleanups. * source.c (show_substitute_path_command): Call do_cleanups. (unset_substitute_path_command, set_substitute_path_command): Likewise. * symfile.c (load_command): Call do_cleanups.
* * symfile.c (syms_from_objfile_1): Delete args offsets, num_offsets.Doug Evans2013-05-091-60/+17
| | | | | | | | | All callers updated. (syms_from_objfile): Ditto. Make static. (symbol_file_add_with_addrs): Renamed from symbol_file_add_with_addrs_or_offsets. Delete args offsets, num_offsets. All callers updated. * symfile.h (syms_from_objfile): Delete.
* * symfile.c (decrement_reading_symtab): Add assert.Doug Evans2013-05-091-0/+2
| | | | (increment_reading_symtab): Ditto.
* * symfile.c: Whitespace cleanup.Doug Evans2013-05-071-12/+10
|
* * dbxread.c (process_one_symbol): Constify section_offsets parameter.Doug Evans2013-05-061-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * symfile.c (syms_from_objfile_1): Use correct section count whenDoug Evans2013-05-061-1/+1
| | | | objfile->sf == NULL.
* gdb/Jan Kratochvil2013-05-051-6/+6
| | | | | | | * event-top.c (display_gdb_prompt): Call missing do_cleanups. * infcmd.c (get_return_value) <!stop_regs>: Do not overwrite CLEANUP. * symfile.c (symfile_bfd_open): New variable back_to. Do not leave a stale cleanup. Fix double free of NAME.
* * objfiles.c (objfile_relocate): Use gdb_bfd_count_sections insteadDoug Evans2013-05-041-4/+3
| | | | | | | | of bfd_count_sections. * solib-target.c (solib_target_relocate_section_addresses): Ditto. * symfile.c (default_symfile_offsets): Ditto. (syms_from_objfile_1): Ditto. Make dummy addrs list an array of one entry, not bfd_count_sections entries.
* * coffread.c (cs_to_section): Use gdb_bfd_section_index.Tom Tromey2013-04-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * symfile.c (find_separate_debug_file): Add comment.Doug Evans2013-03-281-2/+4
| | | | (terminate_after_last_dir_separator): Tweak comment.
* * symfile.c (alloc_section_addr_info): Update header. Don't setTom Tromey2013-03-211-9/+15
| | | | | | | | | | | | | | | | | | | | 'num_sections' field. (build_section_addr_info_from_section_table): Set 'num_sections'. (build_section_addr_info_from_bfd): Likewise. (build_section_addr_info_from_objfile): Remove dead loop condition. (free_section_addr_info): Unconditionally call xfree. (relative_addr_info_to_section_offsets, addrs_section_sort) (addr_info_make_relative, syms_from_objfile_1): Remove dead loop condition. (syms_from_objfile_1): Remove dead 'if' condition. Check 'num_sections'. (add_symbol_file_command): Set 'num_sections'. * symfile-mem.c (symbol_file_add_from_memory): Set 'num_sections'. * somread.c (som_symfile_offsets): Remove dead loop condition. * machoread.c (macho_symfile_offsets): Remove dead 'if'. * jit.c (jit_bfd_try_read_symtab): Set 'num_sections'.
* * gdb_bfd.c (struct gdb_bfd_data) <crc_computed, crc>:Tom Tromey2013-03-141-43/+6
| | | | | | | | | | 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.
* gdbTom Tromey2013-03-141-31/+1
| | | | | | | | | | | * symfile.c (get_debug_link_info): Remove. (find_separate_debug_file_by_debuglink): Use bfd_get_debug_link_info. bfd * opncls.c (bfd_get_debug_link_info): Rename from get_debug_link_info. Export. Update comment. (find_separate_debug_file): Update. * bfd-in2.h: Rebuild.
* * breakpoint.c (catch_syscall_split_args): Use skip_spaces.Keith Seitz2013-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (trace_pass_command): Likewise. * cli/cli-cmds.c: Include cli/cli-utils.h. (source_command): Use skip-spaces. (disassemble_command): Likewise. * findcmd.c: Include cli/cli-utils.h. (parse_find_args): Use skip_spaces. * go32-nat.c: Include cli/cli-utils.h. (go32_sldt): Use skip_spaces. (go32_sgdt): Likewise. (go32_sidt): Likewise. (go32_pde): Likewise. (go32_pte): Likewise. (go32_pte_for_address): Likewise. * infcmd.c: Include cli/cli-utils.h. (registers_info): Use skip_spaces. * linux-tdep.c (read_mapping): Use skip_spaces_const. (linux_info_proc): Likewise. * linux-thread-db.c: Include cli/cli-utils.h. (info_auto_load_libthread_db): Use skip_spaces_const. * m32r-rom.c: Include cli/cli-utils.h. (m32r_upload_command): Use skip_spaces. * maint.c: Include cli/cli-utils.h. (maintenance_translate_address): Use skip_spaces. * mi/mi-parse.c: Include cli/cli-utils.h. (mi_parse_argv): Use skip_spaces. (mi_parse): Likewise. * minsyms.c: Include cli/cli-utils.h. (msymbol_hash_iw): Use skip_spaces_const. * objc-lang.c: Include cli/cli-utils.h. (parse_selector): Use skip_spaces. (parse_method): Likewise. * python/python.c: Include cli/cli-utils.h. (python_interactive_command)[HAVE_PYTHON]: Use skip_spaces. (python_command)[HAVE_PYTHON]: Likewise. (python_interactive_command)[!HAVE_PYTHON]: Likewise. * remote-m32r-sdi.c: Include cli/cli-utils.h. (m32r_load): Use skip_spaces. * serial.c: Include cli/cli-utils.h. (serial_open): Use skip_spaces_const. * stack.c: Include cli/cli-utils.h. (parse_frame_specification_1): Use skip_spaces_const. * symfile.c: Include cli/cli-utils.h. (set_ext_lang_command): Use skip_spaces. * symtab.c: Include cli/cli-utils.h. (rbreak_command): Use skip_spaces. * thread.c (thread_name_command): Use skip_spaces. * tracepoint.c (validate_actionline): Use skip_spaces. (encode_actions_1): Likewise. (trace_find_range_command): Likewise. (trace_find_outside_command): Likewise. (trace_dump_actions): Likewise.
* PR gdb/15161Kai Tietz2013-02-191-3/+3
| | | | | | | * symfile.c (load_section_data): Change type of load_offset to CORE_ADDR. (generic_load): User strtoulst instead of strtoul for conversion of load_offset.
* gdb/Jan Kratochvil2013-02-011-1/+6
| | | | | | | | | | | | | | * elfread.c (elf_symfile_read): Limit separate debug info additions to files with no separate debug info. * objfiles.c (add_separate_debug_objfile): Add gdb_assert calls. * symfile.c (read_symbols): Call find_separate_debug_file_in_section only for files with no separate debug info. gdb/testsuite/ * gdb.base/gnu-debugdata.exp): Create ${binfile}.debug, ${binfile}.mini_debuginfo-debuglink, add -k to xz, use now ${binfile}.mini_debuginfo-debuglink and ${binfile}.mini_debuginfo-debuglink.xz.
* * symfile.c (get_file_crc): Use bfd_calc_gnu_debuglink_crc32.Tom Tromey2013-01-301-1/+1
| | | | | * utils.c (gnu_debuglink_crc32): Remove. * utils.h (gnu_debuglink_crc32): Don't declare.
* * gdb_obstack.h (obconcat): Move declaration here, from...Tom Tromey2013-01-211-26/+0
| | | | | | | | | * symfile.h (obconcat): ... here. * gdb_obstack.c: New file. (obconcat): Move from... * symfile.c (obconcat): ... here. * Makefile.in (SFILES): Add gdb_obstack.c. (COMMON_OBS): Add gdb_obstack.o.
* * symfile.h (obsavestring): Don't declare.Tom Tromey2013-01-211-24/+0
| | | | | | | | | | | | | | | * symfile.c (obsavestring): Remove. * ada-exp.y: Use obstack_copy0, not obsavestring. * ada-lang.c: Use obstack_copy0, not obsavestring. * coffread.c: Use obstack_copy0, not obsavestring. * cp-namespace.c: Use obstack_copy0, not obsavestring. * dbxread.c: Use obstack_copy0, not obsavestring. * dwarf2read.c: Use obstack_copy0, not obsavestring. * jit.c: Use obstack_copy0, not obsavestring. * mdebugread.c: Use obstack_copy0, not obsavestring. * psymtab.c: Use obstack_copy0, not obsavestring. * stabsread.c: Use obstack_copy0, not obsavestring. * xcoffread.c: Use obstack_copy0, not obsavestring.
* 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.
* * symfile.c (list_overlays_command, map_overlay_command)Tom Tromey2012-12-181-9/+3
| | | | (unmap_overlay_command): Now static.
* Move init_entry_point_info to symfile.c and make it static.Joel Brobecker2012-12-151-0/+48
| | | | | | | | 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.
* Fix NULL objfile's section_offsets dereference during symbol load.Joel Brobecker2012-12-151-8/+34
| | | | | | | | | | | | | | gdb/ChangeLog: * symfile.c (syms_from_objfile_1): Renames syms_from_objfile. Remove call to init_entry_point_info. Add OBJFILE's section_offsets and num_sections initialization. Add note about entry info in the function documentation. (syms_from_objfile): New function. * coffread.c (coff_symfile_init): Remove call to init_entry_point_info. * machoread.c (macho_symfile_init): Likewise. * xcoffread.c(xcoff_symfile_init): Likewise.
* * coffread.c (coff_objfile_data_key): New global.Tom Tromey2012-12-121-1/+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.
* * dsrec.c (report_transfer_performance): Don't declare.Tom Tromey2012-12-111-22/+0
| | | | | (load_srec): Use gettimeofday, print_transfer_performance. * symfile.c (report_transfer_performance): Remove.
* gdb/qiyao2012-11-271-0/+1
| | | | | | | | | | | | | | | 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.
* 2012-11-26 Alexander Larsson <alexl@redhat.com>Tom Tromey2012-11-261-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> * NEWS: Mention mini debuginfo feature. * minidebug.c: New file. * configure.ac: Check for lzma. * configure, config.in: Rebuild. * Makefile.in (LIBLZMA): New variable. (CLIBS): Include LIBLZMA. (SFILES): Mention minidebug.c. (COMMON_OBS): Mention minidebug.o. * symfile.c (read_symbols): New function. (syms_from_objfile, reread_symbols): Call it. * symfile.h (find_separate_debug_file_in_section): Declare. doc * gdb.texinfo (MiniDebugInfo): New node. (GDB Files): Update. testsuite * gdb.base/gnu-debugdata.exp: New file. * gdb.base/gnu-debugdata.c: New file. * lib/gdb.exp (gdb_file_cmd): Handle LZMA warning. (gdb_unload): Return 0 on success.
* * gdbarch.sh (target_gdbarch): Remove macro.Tom Tromey2012-11-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | (get_target_gdbarch): Rename to target_gdbarch. * gdbarch.c, gdbarch.h: Rebuild. * ada-tasks.c, aix-thread.c, amd64-linux-nat.c, arch-utils.c, arm-tdep.c, auxv.c, breakpoint.c, bsd-uthread.c, corefile.c, darwin-nat-info.c, dcache.c, dsrec.c, exec.c, fbsd-nat.c, filesystem.c, gcore.c, gnu-nat.c, i386-darwin-nat.c, i386-nat.c, ia64-vms-tdep.c, inf-ptrace.c, infcmd.c, jit.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, m32r-rom.c, memattr.c, mep-tdep.c, microblaze-tdep.c, mips-linux-nat.c, mips-linux-tdep.c, mips-tdep.c, monitor.c, moxie-tdep.c, nto-procfs.c, nto-tdep.c, ppc-linux-nat.c, proc-service.c, procfs.c, progspace.c, ravenscar-thread.c, record.c, remote-m32r-sdi.c, remote-mips.c, remote-sim.c, remote.c, rl78-tdep.c, rs6000-nat.c, rx-tdep.c, s390-nat.c, sol-thread.c, solib-darwin.c, solib-dsbt.c, solib-frv.c, solib-ia64-hpux.c, solib-irix.c, solib-pa64.c, solib-som.c, solib-spu.c, solib-sunos.c, solib-svr4.c, solib.c, spu-linux-nat.c, spu-multiarch.c, spu-tdep.c, symfile-mem.c, symfile.c, symtab.c, target-descriptions.c, target.c, target.h, tracepoint.c, windows-nat.c, windows-tdep.c, xcoffsolib.c, cli/cli-dump.c, common/agent.c, mi/mi-interp.c, python/py-finishbreakpoint.c, python/py-inferior.c, python/python.c: Update.
* * defs.h (quit_flag): Don't declare.Tom Tromey2012-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (clear_quit_flag, check_quit_flag, set_quit_flag): Declare. (QUIT): Use new functions. * event-top.c (command_handler): Use clear_quit_flag. (handle_sigint): Use set_quit_flag. (async_request_quit): Use check_quit_flag. Don't check immediate_quit. * exceptions.c (throw_exception): Use clear_quit_flag. * main.c (captured_main): Use clear_quit_flag. * python/python.c (clear_quit_flag, set_quit_flag) (check_quit_flag): New functions. * remote-sim.c (gdb_os_poll_quit): Use check_quit_flag, clear_quit_flag. * remote.c (remote_wait_as): Use check_quit_flag, clear_quit_flag. (remote_start_remote): Call QUIT. * symfile.c (load_progress): Use check_quit_flag. * top.c (command_loop): Use clear_quit_flag. (command_line_input): Call QUIT. * utils.c (quit_flag): Conditionally define. (clear_quit_flag, check_quit_flag, set_quit_flag): New functions. (prompt_for_continue): Call QUIT. Use quit, not async_request_quit. * remote-mips.c (mips_expect_timeout): Call QUIT. * monitor.c (monitor_expect): Call QUIT.
* * jit.c (jit_object_close_impl): Don't malloc the objfileTom Tromey2012-08-221-5/+10
| | | | | | | | | | 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.
* * windows-nat.c (windows_make_so): Use gdb_bfd_open.Tom Tromey2012-08-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * symfile.c (bfd_open_maybe_remote): Use gdb_bfd_open. (symfile_bfd_open): Likewise. (generic_load): Likewise. * solib.c (solib_bfd_fopen): Use gdb_bfd_open. * solib-pa64.c (pa64_solib_create_inferior_hook): Use gdb_bfd_open. * solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init): Use gdb_bfd_open. * rs6000-nat.c (add_vmap): Use gdb_bfd_open. * remote-mips.c (mips_load_srec): Use gdb_bfd_open. (pmon_load_fast): Likewise. * remote-m32r-sdi.c (m32r_load): Use gdb_bfd_open. * procfs.c (insert_dbx_link_bpt_in_file): Use gdb_bfd_open. * machoread.c (macho_symfile_read_all_oso): Use gdb_bfd_open. (macho_check_dsym): Likewise. * m32r-rom.c (m32r_load): Use gdb_bfd_open. (m32r_upload_command): Likewise. * gdb_bfd.h (gdb_bfd_cache): Declare. * gdb_bfd.c (struct gdb_bfd_data): New. (gdb_bfd_cache): New global. (struct gdb_bfd_cache_search): New. (hash_bfd): New function. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (gdb_bfd_ref): Allocate a gdb_bfd_data and attach to the BFD. (gdb_bfd_unref): Remove closed BFD from cache. Update for gdb_bfd_data. * exec.c (exec_file_attach): Use gdb_bfd_open. * dsrec.c (load_srec): Use gdb_bfd_open.
* * dwarf2read.c (macro_start_file): Update.Tom Tromey2012-08-221-2/+0
| | | | | | | | | | | | * 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.