aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-02-03More fixes for illegal memory accesses triggered by running objdump on ↵Nick Clifton50-99/+185
fuzzed binaries. PR binutils/17512 * objdump.c (display_any_bfd): Fail if archives nest too deeply. * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays. (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol index or an out of range fdr index. * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message. * elf32-arc.c (arc_info_to_howto_rel): Likewise. * elf32-avr.c (avr_info_to_howto_rela): Likewise. * elf32-cr16.c (elf_cr16_info_to_howto): Likewise. * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise. * elf32-cris.c (cris_info_to_howto_rela): Likewise. * elf32-crx.c (elf_crx_info_to_howto): Likewise. * elf32-d10v.c (d10v_info_to_howto_rel): Likewise. * elf32-d30v.c (d30v_info_to_howto_rel): Likewise. * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise. * elf32-fr30.c (fr30_info_to_howto_rela): Likewise. * elf32-frv.c (frv_info_to_howto_rela): Likewise. * elf32-i370.c (i370_elf_info_to_howto): Likewise. * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise. * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise. * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise. * elf32-lm32.c (lm32_info_to_howto_rela): Likewise. * elf32-m32c.c (m32c_info_to_howto_rela): Likewise. * elf32-m32r.c (m32r_info_to_howto_rel): Likewise. * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise. * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise. * elf32-mcore.c (mcore_elf_info_to_howto): Likewise. * elf32-mep.c (mep_info_to_howto_rela): Likewise. * elf32-metag.c (metag_info_to_howto_rela): Likewise. * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise. * elf32-moxie.c (moxie_info_to_howto_rela): Likewise. * elf32-msp430.c (msp430_info_to_howto_rela): Likewise. * elf32-mt.c (mt_info_to_howto_rela): Likewise. * elf32-nds32.c (nds32_info_to_howto_rel): Likewise. * elf32-or1k.c (or1k_info_to_howto_rela): Likewise. * elf32-pj.c (pj_elf_info_to_howto): Likewise. * elf32-ppc.c (ppc_elf_info_to_howto): Likewise. * elf32-rl78.c (rl78_info_to_howto_rela): Likewise. * elf32-rx.c (rx_info_to_howto_rela): Likewise. * elf32-sh.c (sh_elf_info_to_howto): Likewise. * elf32-spu.c (spu_elf_info_to_howto): Likewise. * elf32-v850.c (v850_elf_perform_relocation): Likewise. * elf32-vax.c (rtype_to_howto): Likewise. * elf32-visium.c (visium_info_to_howto_rela): Likewise. * elf32-xgate.c (xgate_info_to_howto_rel): Likewise. * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise. * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise. * elf64-mmix.c (mmix_info_to_howto_rela): Likewise. * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays. (bfd_mach_o_canonicalize_one_reloc): Fix check on out of range symbol indicies. (bfd_mach_o_canonicalize_relocs): Check for out of range alloc. (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. (bfd_mach_o_build_dysymtab): Likewise. (bfd_mach_o_write_symtab_content): Set the string table size to zero upon error. (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the read fails. * peXXigen.c (pe_print_edata): Check for numeric overflow in edt fields. * tekhex.c (first_phase): Check for src pointer reaching end of buffer.
2015-02-03bfd/elfnn-aarch64.c: Set st_value to zero for undefined symbolsWill Newton2-4/+15
Unless pointer_equality_needed is set then set st_value to be zero for undefined symbols. bfd/ChangeLog: 2015-02-03 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Set st_value to zero for undefined symbols if the reference is weak or pointer_equality_needed is FALSE.
2015-02-03bfd/elf32-arm.c: Improve comment in elf32_arm_finish_dynamic_symbolWill Newton2-3/+12
Improve the comment discussing why we clear st_value for some symbols. bfd/ChangeLog: 2015-02-03 Will Newton <will.newton@linaro.org> * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve comment discussing why we clear st_value for some symbols.
2015-02-03[AARCH64] Document .arch and .arch_extension directiveJiong Wang2-0/+23
2015-02-03 Renlin Li <renlin.li@arm.com> gas/ * doc/c-aarch64.texi (.arch): Document the directive. (.arch_extension): Likewise.
2015-02-03Fix use of uninitialised memory by the RL78 port of GAS.Nick Clifton2-0/+7
* config/tc-rl78.h (TC_PARSE_CONS_EXPRESSION): Define.
2015-02-03Automatic date update in version.inGDB Administrator1-1/+1
2015-02-03sim: Be sure of calling freeargv() after successfully call buildargv().Chen Gang2-0/+8
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * microblaze/interp.c (sim_do_command): Call freeargv() before return.
2015-02-03sim: Be sure of calling freeargv() after successfully call buildargv().Chen Gang2-0/+7
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * mcore/interp.c (sim_do_command): Call freeargv() before return.
2015-02-03sim: Call freeargv() when failure occursChen Gang2-1/+9
After successfully call buildargv(), the code need to be sure of calling freeargv() in any cases. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * common/sim-options.c (sim_args_command): Call freeargv() when failure occurs.
2015-02-02Fix bug with previous patch for unresolved TLS symbol.Cary Coutant2-1/+8
We need to check that the output is executable before assuming that we can replace the reference with zero. 2015-02-02 Cary Coutant <ccoutant@google.com> gold/ * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for executable output file.
2015-02-02Mention which return values need to be freed in lang_varobj_opsSimon Marchi2-4/+13
This is the result of a little bit of investigation of the C and Ada languages, as well as some common sense. gdb/ChangeLog: * varobj.h (lang_varobj_ops): Mention which return values need to be freed.
2015-02-02xlc -z relro toc section fixesAlan Modra2-2/+15
Moving .toc out of .got caused us to lose toc sorting and multi-toc support. * emultempl/ppc64elf.em (toc_section_name): New var. (ppc_after_open): Set it. (ppc_before_allocation): Use it. (gld${EMULATION_NAME}_after_allocation): Here too.
2015-02-02NDS32/bfd: Add one more argument to control contents cache.Kuan-Lin Chen2-25/+47
The hook bfd_elf32_bfd_get_relocated_section_contents frees contents in gdb, and it make contents pointer mismatched.
2015-02-02Add missing i18n marker in dwarf2_evaluate_property warning message.Joel Brobecker2-1/+5
gdb/ChangeLog: * dwarf2loc.c (dwarf2_evaluate_property): Add i18n marker.
2015-02-02[Ada] Do not re-cache symbol-lookup result found from cache lookup.Joel Brobecker2-6/+11
When ada-lang.c:ada_lookup_symbol_list_worker finds a match in the symbol cache, it caches the result again, which is unecessary. This patch fixes the code to avoid that. gdb/ChangeLog: PR gdb/17856: * ada-lang.c (ada_lookup_symbol_list_worker): Do not re-cache results found in the cache. Tested on x86_64-linux, no regression.
2015-02-02[Ada] pspace_data->sym_cache is always NULLJoel Brobecker2-5/+10
The Ada symbol cache has been designed to have one instance of that of that cache per program space, and for each instance to be created on-demand. ada_get_symbol_cache is the function responsible for both lookup and creation on demand. Unfortunately, ada_get_symbol_cache forgot to store the reference to newly created caches, thus causing it to: - Leak old caches; - Allocate a new cache each time the cache is being searched or a new entry is to be inserted. This patch fixes the issue by avoiding the use of the local variable, which indirectly allowed the bug to happen. We manipulate the reference in the program-space data instead. gdb/ChangeLog: PR gdb/17854: * ada-lang.c (ada_get_symbol_cache): Set pspace_data->sym_cache when allocating a new one.
2015-02-02Automatic date update in version.inGDB Administrator1-1/+1
2015-02-01remove myself from MAINTAINERSTom Tromey2-3/+4
2015-02-01 Tom Tromey <tom@tromey.com> * MAINTAINERS: Remove myself.
2015-01-31Move vptr_{fieldno,basetype} out of main_type, and update everything ↵Doug Evans9-53/+126
accordingly. Every type has to pay the price in memory usage for their presence. The proper place for them is in the type_specific field which exists for this purpose. gdb/ChangeLog: * dwarf2read.c (process_structure_scope): Update setting of TYPE_VPTR_BASETYPE, TYPE_VPTR_FIELDNO. * gdbtypes.c (internal_type_vptr_fieldno): New function. (set_type_vptr_fieldno): New function. (internal_type_vptr_basetype): New function. (set_type_vptr_basetype): New function. (get_vptr_fieldno): Update setting of TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE. (allocate_cplus_struct_type): Initialize vptr_fieldno. (recursive_dump_type): Printing of vptr_fieldno, vptr_basetype ... (print_cplus_stuff): ... moved here. (copy_type_recursive): Don't copy TYPE_VPTR_BASETYPE. * gdbtypes.h (struct main_type): Members vptr_fieldno, vptr_basetype moved to ... (struct cplus_struct_type): ... here. All uses updated. (TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE): Rewrite. (internal_type_vptr_fieldno, set_type_vptr_fieldno): Declare. (internal_type_vptr_basetype, set_type_vptr_basetype): Declare. * stabsread.c (read_tilde_fields): Update setting of TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE. gdb/testsuite/ChangeLog: * gdb.base/maint.exp <maint print type argc>: Update expected output.
2015-01-31Move TYPE_SELF_TYPE into new field type_specific.Doug Evans9-67/+189
This patch moves TYPE_SELF_TYPE into new field type_specific.self_type for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff for METHODs, and then updates everything to use that. TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC (e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together. Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD is also nice because when we allocate space for function types we assume they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that space then that space would be wasted, and cleaning that up would involve more invasive changes. In order to catch errant uses I've added accessor functions that do some checking. One can no longer assign to TYPE_SELF_TYPE like this: TYPE_SELF_TYPE (foo) = bar; One instead has to do: set_type_self_type (foo, bar); But I've left reading of the type to the macro: bar = TYPE_SELF_TYPE (foo); In order to discourage bypassing the TYPE_SELF_TYPE macro I've named the underlying function that implements it internal_type_self_type. While testing this I found the stabs reader leaving methods as TYPE_CODE_FUNCs, hitting my newly added asserts. Since the dwarf reader smashes functions to methods (via smash_to_method) I've done a similar thing for stabs. gdb/ChangeLog: * cp-valprint.c (cp_find_class_member): Rename parameter domain_p to self_p. (cp_print_class_member): Rename local domain to self_type. * dwarf2read.c (quirk_gcc_member_function_pointer): Rename local domain_type to self_type. (set_die_type) <need_gnat_info>: Handle TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD. * gdb-gdb.py (StructMainTypePrettyPrinter): Handle TYPE_SPECIFIC_SELF_TYPE. * gdbtypes.c (internal_type_self_type): New function. (set_type_self_type): New function. (smash_to_memberptr_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE. (smash_to_method_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (check_stub_method): Call smash_to_method_type. (recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE. (copy_type_recursive): Ditto. * gdbtypes.h (enum type_specific_kind): New value TYPE_SPECIFIC_SELF_TYPE. (struct main_type) <type_specific>: New member self_type. (struct cplus_struct_type) <fn_field.type>: Update comment. (TYPE_SELF_TYPE): Rewrite. (internal_type_self_type, set_type_self_type): Declare. * gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to self_type. (gnuv3_method_ptr_to_value): Rename local domain_type to self_type. * m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with TYPE_TARGET_TYPE. * stabsread.c (read_member_functions): Mark methods with TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of TYPE_SELF_TYPE.
2015-01-31gdbtypes.h (TYPE_SELF_TYPE): Renamed from TYPE_DOMAIN_TYPE.Doug Evans11-21/+26
gdb/ChangeLog: * gdbtypes.h (TYPE_SELF_TYPE): Renamed from TYPE_DOMAIN_TYPE. All uses updated.
2015-01-31Be more strict about what kinds of types can be passed.Doug Evans2-4/+28
gdb/ChangeLog: * gnu-v3-abi.c (gnuv3_dynamic_class): Assert only passed structs or unions. Return zero if union. (gnuv3_get_vtable): Call check_typedef. Assert only passed structs. (gnuv3_rtti_type): Pass already-check_typedef'd value to gnuv3_get_vtable. (compute_vtable_size): Assert only passed structs. (gnuv3_print_vtable): Don't call gnuv3_get_vtable for non-structs.
2015-01-31gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD kinds.Doug Evans2-6/+28
gdb/ChangeLog: * gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD kinds.
2015-02-01Automatic date update in version.inGDB Administrator1-1/+1
2015-01-31ChangeLog entries for max-completions patch.Gary Benson3-0/+55
gdb/ChangeLog: PR cli/9007 PR cli/11920 PR cli/15548 * cli/cli-cmds.c (complete_command): Notify user if max-completions reached. * common/common-exceptions.h (enum errors) <MAX_COMPLETIONS_REACHED_ERROR>: New value. * completer.h (get_max_completions_reached_message): New declaration. (max_completions): Likewise. (completion_tracker_t): New typedef. (new_completion_tracker): New declaration. (make_cleanup_free_completion_tracker): Likewise. (maybe_add_completion_enum): New enum. (maybe_add_completion): New declaration. (throw_max_completions_reached_error): Likewise. * completer.c (max_completions): New global variable. (new_completion_tracker): New function. (free_completion_tracker): Likewise. (make_cleanup_free_completion_tracker): Likewise. (maybe_add_completions): Likewise. (throw_max_completions_reached_error): Likewise. (complete_line): Remove duplicates and limit result to max_completions entries. (get_max_completions_reached_message): New function. (gdb_display_match_list): Handle max_completions. (_initialize_completer): New declaration and function. * symtab.c: Include completer.h. (completion_tracker): New static variable. (completion_list_add_name): Call maybe_add_completion. (default_make_symbol_completion_list_break_on_1): Renamed from default_make_symbol_completion_list_break_on. Maintain completion_tracker across calls to completion_list_add_name. (default_make_symbol_completion_list_break_on): New function. * top.c (init_main): Set rl_completion_display_matches_hook. * tui/tui-io.c: Include completer.h. (tui_old_rl_display_matches_hook): New static global. (tui_rl_display_match_list): Notify user if max-completions reached. (tui_setup_io): Save/restore rl_completion_display_matches_hook. * NEWS (New Options): Mention set/show max-completions. gdb/doc/ChangeLog: * gdb.texinfo (Command Completion): Document new "set/show max-completions" option. gdb/testsuite/ChangeLog: * gdb.base/completion.exp: Disable completion limiting for existing tests. Add new tests to check completion limiting. * gdb.linespec/ls-errs.exp: Disable completion limiting.
2015-01-31Add max-completions parameter, and implement tab-completion limiting.Gary Benson10-24/+478
This commit adds a new exception, MAX_COMPLETIONS_REACHED_ERROR, to be thrown whenever the completer has generated too many candidates to be useful. A new user-settable variable, "max_completions", is added to control this behaviour. A top-level completion limit is added to complete_line_internal, as the final check to ensure the user never sees too many completions. An additional limit is added to default_make_symbol_completion_list_break_on, to halt time-consuming symbol table expansions. gdb/ChangeLog: PR cli/9007 PR cli/11920 PR cli/15548 * cli/cli-cmds.c (complete_command): Notify user if max-completions reached. * common/common-exceptions.h (enum errors) <MAX_COMPLETIONS_REACHED_ERROR>: New value. * completer.h (get_max_completions_reached_message): New declaration. (max_completions): Likewise. (completion_tracker_t): New typedef. (new_completion_tracker): New declaration. (make_cleanup_free_completion_tracker): Likewise. (maybe_add_completion_enum): New enum. (maybe_add_completion): New declaration. (throw_max_completions_reached_error): Likewise. * completer.c (max_completions): New global variable. (new_completion_tracker): New function. (free_completion_tracker): Likewise. (make_cleanup_free_completion_tracker): Likewise. (maybe_add_completions): Likewise. (throw_max_completions_reached_error): Likewise. (complete_line): Remove duplicates and limit result to max_completions entries. (get_max_completions_reached_message): New function. (gdb_display_match_list): Handle max_completions. (_initialize_completer): New declaration and function. * symtab.c: Include completer.h. (completion_tracker): New static variable. (completion_list_add_name): Call maybe_add_completion. (default_make_symbol_completion_list_break_on_1): Renamed from default_make_symbol_completion_list_break_on. Maintain completion_tracker across calls to completion_list_add_name. (default_make_symbol_completion_list_break_on): New function. * top.c (init_main): Set rl_completion_display_matches_hook. * tui/tui-io.c: Include completer.h. (tui_old_rl_display_matches_hook): New static global. (tui_rl_display_match_list): Notify user if max-completions reached. (tui_setup_io): Save/restore rl_completion_display_matches_hook. * NEWS (New Options): Mention set/show max-completions. gdb/doc/ChangeLog: * gdb.texinfo (Command Completion): Document new "set/show max-completions" option. gdb/testsuite/ChangeLog: * gdb.base/completion.exp: Disable completion limiting for existing tests. Add new tests to check completion limiting. * gdb.linespec/ls-errs.exp: Disable completion limiting.
2015-01-31Build list of completions as symbol tables are expanded.Gary Benson2-39/+80
This commit makes default_make_symbol_completion_list_break_on build the list of completions as it expands the necessary symbol tables, rather than expanding all necessary symbol tables first and then building the completion lists second. This allows for the early termination of symbol table expansion if required. gdb/ChangeLog: * symtab.c (struct add_name_data) <code>: New field. Updated comments. (add_symtab_completions): New function. (symtab_expansion_callback): Likewise. (default_make_symbol_completion_list_break_on): Set datum.code. Move minimal symbol scan before calling expand_symtabs_matching. Scan known primary symtabs for externs and statics before calling expand_symtabs_matching. Pass symtab_expansion_callback as expansion_notify argument to expand_symtabs_matching. Do not scan primary symtabs for externs and statics after calling expand_symtabs_matching.
2015-01-31new callback parameter expansion_notify for expand_symtabs_matchingGary Benson10-12/+60
This commit adds a new callback parameter, "expansion_notify", to the top-level expand_symtabs_matching function and to all the vectorized functions it defers to. If expansion_notify is non-NULL, it will be called every time a symbol table is expanded. gdb/ChangeLog: * symfile.h (expand_symtabs_exp_notify_ftype): New typedef. (struct quick_symbol_functions) <expand_symtabs_matching>: New argument expansion_notify. All uses updated. (expand_symtabs_matching): New argument expansion_notify. All uses updated. * symfile-debug.c (debug_qf_expand_symtabs_matching): Also print expansion notify. * symtab.c (expand_symtabs_matching_via_partial): Call expansion_notify whenever a partial symbol table is expanded. * dwarf2read.c (dw2_expand_symtabs_matching): Call expansion_notify whenever a symbol table is instantiated.
2015-01-31gdb.ada/dyn_arrayidx.exp: Add additional_flags=-gnat12.Doug Evans2-1/+5
gdb/testsuite/ChangeLog: * gdb.ada/dyn_arrayidx.exp: Add additional_flags=-gnat12.
2015-01-31Remove premature comments from previous patch to completer.cDoug Evans1-7/+2
These comments are for a followup patch.
2015-01-31Unify CLI/TUI interface to readline tab completion.Doug Evans7-161/+803
This copies a lot of code from readline, but this is temporary. Readline currently doesn't export what we need. The plan is to have something that has been working for awhile, and then we'll have a complete story to present to the readline maintainers. gdb/ChangeLog: * cli-out.c: #include completer.h, readline/readline.h. (cli_mld_crlf, cli_mld_putch, cli_mld_puts): New functions. (cli_mld_flush, cld_mld_erase_entire_line): Ditto. (cli_mld_beep, cli_mld_read_key, cli_display_match_list): Ditto. * cli-out.h (cli_display_match_list): Declare. * completer.c (MB_INVALIDCH, MB_NULLWCH): New macros. (ELLIPSIS_LEN): Ditto. (gdb_get_y_or_n, gdb_display_match_list_pager): New functions. (gdb_path_isdir, gdb_printable_part, gdb_fnwidth): Ditto. (gdb_fnprint, gdb_print_filename): Ditto. (gdb_complete_get_screenwidth, gdb_display_match_list_1): Ditto. (gdb_display_match_list): Ditto. * completer.h (mld_crlf_ftype, mld_putch_ftype): New typedefs. (mld_puts_ftype, mld_flush_ftype, mld_erase_entire_line_ftype): Ditto. (mld_beep_ftype, mld_read_key_ftype): Ditto. (match_list_displayer): New struct. (gdb_display_match_list): Declare. * top.c (init_main): Set rl_completion_display_matches_hook. * tui/tui-io.c: #include completer.h. (printable_part, PUTX, print_filename, get_y_or_n): Delete. (tui_mld_crlf, tui_mld_putch, tui_mld_puts): New functions. (tui_mld_flush, tui_mld_erase_entire_line, tui_mld_beep): Ditto. (tui_mld_getc, tui_mld_read_key): Ditto. (tui_rl_display_match_list): Rewrite. (tui_handle_resize_during_io): New arg for_completion. All callers updated.
2015-01-31Add symbol lookup cache.Doug Evans5-14/+819
gdb/ChangeLog: Add symbol lookup cache. * NEWS: Document new options and commands. * symtab.c (symbol_cache_key): New static global. (DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros. (SYMBOL_LOOKUP_FAILED): New macro. (symbol_cache_slot_state): New enum. (block_symbol_cache): New struct. (symbol_cache): New struct. (new_symbol_cache_size, symbol_cache_size): New static globals. (hash_symbol_entry, eq_symbol_entry): New functions. (symbol_cache_byte_size, resize_symbol_cache): New functions. (make_symbol_cache, free_symbol_cache): New functions. (get_symbol_cache, symbol_cache_cleanup): New function. (set_symbol_cache_size, set_symbol_cache_size_handler): New functions. (symbol_cache_lookup, symbol_cache_clear_slot): New function. (symbol_cache_mark_found, symbol_cache_mark_not_found): New functions. (symbol_cache_flush, symbol_cache_dump): New functions. (maintenance_print_symbol_cache): New function. (maintenance_flush_symbol_cache): New function. (symbol_cache_stats): New function. (maintenance_print_symbol_cache_statistics): New function. (symtab_new_objfile_observer): New function. (symtab_free_objfile_observer): New function. (lookup_static_symbol, lookup_global_symbol): Use symbol cache. (_initialize_symtab): Init symbol_cache_key. New parameter maint symbol-cache-size. New maint commands print symbol-cache, print symbol-cache-statistics, flush-symbol-cache. Install new_objfile, free_objfile observers. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new commands "maint print symbol-cache", "maint print symbol-cache-statistics", "maint flush-symbol-cache". Document new option "maint set symbol-cache-size".
2015-01-31PR symtab/17855Joel Brobecker2-2/+10
gdb/ChangeLog: PR symtab/17855 * symfile.c (clear_symtab_users): Move call to breakpoint_re_set to end.
2015-01-31Add support for inlining scripts into .debug_gdb_scripts.Doug Evans20-193/+743
include/gdb/ChangeLog: * section-scripts.h: Remove "future extension" comment. (SECTION_SCRIPT_ID_PYTHON_TEXT): New macro. (SECTION_SCRIPT_ID_SCHEME_TEXT): New macro. gdb/ChangeLog: * NEWS: Mention inlined scripts in .debug_gdb_scripts section. * auto-load.c: #include ctype.h. (struct auto_load_pspace_info): Replace member loaded_scripts with new members loaded_script_files, loaded_script_texts. (auto_load_pspace_data_cleanup): Update. (init_loaded_scripts_info): Update. (get_auto_load_pspace_data_for_loading): Update. (maybe_add_script_file): Renamed from maybe_add_script. All callers updated. (maybe_add_script_text): New function. (clear_section_scripts): Update. (source_script_file, execute_script_contents): New functions. (source_section_scripts): Add support for SECTION_SCRIPT_ID_PYTHON_TEXT, SECTION_SCRIPT_ID_GUILE_TEXT. (print_scripts): New function. (auto_load_info_scripts): Also print inlined scripts. (maybe_print_unsupported_script_warning): Renamed from unsupported_script_warning_print. All callers updated. (maybe_print_script_not_found_warning): Renamed from script_not_found_warning_print. All callers updated. * extension-priv.h (struct extension_language_script_ops): New member objfile_script_executor. * extension.c (ext_lang_objfile_script_executor): New function. * extension.h (objfile_script_executor_func): New typedef. (ext_lang_objfile_script_executor): Declare. * guile/guile-internal.h (gdbscm_execute_objfile_script): Declare. * guile/guile.c (guile_extension_script_ops): Update. * guile/scm-objfile.c (gdbscm_execute_objfile_script): New function. * python/python.c (python_extension_script_ops): Update. (gdbpy_execute_objfile_script): New function. gdb/doc/ChangeLog: * gdb.texinfo (dotdebug_gdb_scripts section): Update docs to distinguish script files vs inlined scripts. * python.texi (Python Auto-loading): Ditto. gdb/testsuite/ChangeLog: * gdb.guile/scm-section-script.c: Add duplicate inlined section script entries. Duplicate file section script entries. * gdb.guile/scm-section-script.exp: Add tests for duplicate entries, inlined entries. Add test for safe-path rejection. * gdb.python/py-section-script.c: Add duplicate inlined section script entries. Duplicate file section script entries. * gdb.python/py-section-script.exp: Add tests for duplicate entries, inlined entries. Add test for safe-path rejection.
2015-01-31Make sure TABs are expanded in TUI windows on MS-Windows.Eli Zaretskii4-2/+94
gdb/ 2015-01-31 Eli Zaretskii <eliz@gnu.org> * tui/tui-io.c (tui_expand_tabs): New function. (tui_puts, tui_redisplay_readline): Expand TABs into the appropriate number of spaces. * tui/tui-regs.c: Include tui-io.h. (tui_register_format): Call tui_expand_tabs to expand TABs into the appropriate number of spaces. * tui/tui-io.h: Add prototype for tui_expand_tabs.
2015-01-30Add producer string to output of info source.Doug Evans5-2/+25
gdb/ChangeLog: * NEWS: "info source" command now display producer string if present. * source.c (source_info): Print producer string if present. gdb/doc/ChangeLog: * gdb.texinfo (Symbols) <info source>: Output now contains producer string if present.
2015-01-31Automatic date update in version.inGDB Administrator1-1/+1
2015-01-30Fix varobj_delete commentSimon Marchi2-3/+8
gdb/ChangeLog: * varobj.c (varobj_delete): Fix comment.
2015-01-30Mention that create_child takes ownership of the allocated nameSimon Marchi2-1/+8
gdb/ChangeLog: * varobj.c (create_child): Modify comment.
2015-01-30Constify some parameters in the varobj codeSimon Marchi6-79/+137
To make it clear that some functions should not modify the variable object, this patch adds the const qualifier where it makes sense to some struct varobj * parameters. Most getters should take a const pointer to guarantee they don't modify the object. Unfortunately, I couldn't add it to some callbacks (such as name_of_child). In the C implementation, they call c_describe_child, which calls varobj_get_path_expr. varobj_get_path_expr needs to modify the object in order to cache the computed value. It therefore can't take a const pointer, and it affects the whole call chain. I suppose that's where you would use a "mutable" in C++. I did that to make sure there was no other cases like the one fixed in the previous patch. I don't think it can hurt. gdb/ChangeLog: * ada-varobj.c (ada_number_of_children): Constify struct varobj * parameter. (ada_name_of_variable): Same. (ada_path_expr_of_child): Same. (ada_value_of_variable): Same. (ada_value_is_changeable_p): Same. (ada_value_has_mutated): Same. * c-varobj.c (varobj_is_anonymous_child): Same. (c_is_path_expr_parent): Same. (c_number_of_children): Same. (c_name_of_variable): Same. (c_path_expr_of_child): Same. (get_type): Same. (c_value_of_variable): Same. (cplus_number_of_children): Same. (cplus_name_of_variable): Same. (cplus_path_expr_of_child): Same. (cplus_value_of_variable): Same. * jv-varobj.c (java_number_of_children): Same. (java_name_of_variable): Same. (java_path_expr_of_child): Same. (java_value_of_variable): Same. * varobj.c (number_of_children): Same. (name_of_variable): Same. (is_root_p): Same. (varobj_ensure_python_env): Same. (varobj_get_objname): Same. (varobj_get_expression): Same. (varobj_get_display_format): Same. (varobj_get_display_hint): Same. (varobj_has_more): Same. (varobj_get_thread_id): Same. (varobj_get_frozen): Same. (dynamic_varobj_has_child_method): Same. (varobj_get_gdb_type): Same. (is_path_expr_parent): Same. (varobj_default_is_path_expr_parent): Same. (varobj_get_language): Same. (varobj_get_attributes): Same. (varobj_is_dynamic_p): Same. (varobj_get_child_range): Same. (varobj_value_has_mutated): Same. (varobj_get_value_type): Same. (number_of_children): Same. (name_of_variable): Same. (check_scope): Same. (varobj_editable_p): Same. (varobj_value_is_changeable_p): Same. (varobj_floating_p): Same. (varobj_default_value_is_changeable_p): Same. * varobj.h (struct lang_varobj_ops): Consitfy some struct varobj * parameters. (varobj_get_objname): Constify struct varobj * parameter. (varobj_get_expression): Same. (varobj_get_thread_id): Same. (varobj_get_frozen): Same. (varobj_get_child_range): Same. (varobj_get_display_hint): Same. (varobj_get_gdb_type): Same. (varobj_get_language): Same. (varobj_get_attributes): Same. (varobj_editable_p): Same. (varobj_floating_p): Same. (varobj_has_more): Same. (varobj_is_dynamic_p): Same. (varobj_ensure_python_env): Same. (varobj_default_value_is_changeable_p): Same. (varobj_value_is_changeable_p): Same. (varobj_get_value_type): Same. (varobj_is_anonymous_child): Same. (varobj_value_get_print_value): Same. (varobj_default_is_path_expr_parent): Same.
2015-01-30Set varobj->path_expr in varobj_get_path_exprSimon Marchi3-8/+20
It seems like different languages are doing this differently (e.g. C and Ada). For C, var->path_expr is set inside c_path_expr_of_child. The next time the value is requested, is it therefore not recomputed. Ada does not set this field, but just returns the value. Since the field is never set, the value is recomputed every time it is requested. This patch makes it so that path_expr_of_child's only job is to compute the path expression, not save/cache the value. The field is set by the varobj common code. gdb/ChangeLog: * varobj.c (varobj_get_path_expr): Set var->path_expr. * c-varobj.c (c_path_expr_of_child): Set local var instead of child->path_expr. (cplus_path_expr_of_child): Same.
2015-01-30Free results of varobj_get_expressionSimon Marchi3-3/+21
varobj_get_expression returns an allocated string, which must be freed by the caller. gdb/ChangeLog: * mi-cmd-var.c (print_varobj): Free varobj_get_expression result. (mi_cmd_var_info_expression): Same. * varobj.c (varobj_get_expression): Mention in the comment that the result must by freed by the caller.
2015-01-30Free results of varobj_get_type and type_to_stringSimon Marchi3-4/+29
varobj_get_type and type_to_string return an allocated string, which is not freed at a couple of places. New in v2: * Rename char * type to type_name. * Free in all cases in update_type_if_necessary. gdb/ChangeLog: * mi/mi-cmd-var.c (mi_cmd_var_info_type): Free result of varobj_get_type. (varobj_update_one): Same. * varobj.c (update_type_if_necessary): Free curr_type_str and new_type_str. (varobj_get_type): Specify in comment that the result needs to be freed by the caller.
2015-01-30Automatic date update in version.inGDB Administrator1-1/+1
2015-01-29Move -rc before $aroptsH.J. Lu2-1/+5
* lib/ld-lib.exp (ar_simple_create): Move -rc before $aropts.
2015-01-29PR symtab/17890Doug Evans2-0/+15
gdb/ChangeLog: PR symtab/17890 * dwarf2read.c (dwarf_decode_line_header): Punt if version > 4.
2015-01-29This patch adds IFUNC support for arm gold backend.Han Shen6-50/+613
This is a feature required in chromeos arm development work. Tested: 1) Built passed all-gold on x86_64 machine 2) Tested with basic gold aarch64 ifunc unittests - a) global ifunc, statically/non-statically linked b) local ifunc, statically/non-statically linked c) global/local, other shared library routine mixed, statically/non-statically linked d) arm/thumb mode ifunc e) linking chrome browser passed
2015-01-29Remove plugin_active_plugins_p()H.J. Lu6-15/+12
Replace plugin_active_plugins_p() with link_info.lto_plugin_active. * ldfile.c (ldfile_try_open_bfd): Replace plugin_active_plugins_p() with link_info.lto_plugin_active. * ldlang.c (lang_process): Likewise. * ldmain.c (add_archive_element): Likewise. * plugin.c (plugin_active_plugins_p): Removed. * plugin.h (plugin_active_plugins_p): Likewise.
2015-01-29Merge GCC producer parsers. Allow digits in identifiers.Mark Wielaard4-45/+43
Both dwarf2read.c (checkproducer) and utils.c (producer_is_gcc_ge_4) implemented a GCC producer parser that tried to extract the major and minor version of GCC. Merge them into one GCC producer parser used by both. Also allow digits in the identifier after "GNU " such as used by GCC5 like: "GNU C11 5.0.0 20150123 (experimental) -mtune=generic -march=x86-64 -gdwarf-5" gdb/ChangeLog: * dwarf2read.c (checkproducer): Call producer_is_gcc. * utils.c (producer_is_gcc_ge_4): Likewise. (producer_is_gcc): New function. * utils.h (producer_is_gcc): New declaration.
2015-01-29Correct GOLD PowerPC64 local-dynamic TLS linker optimizationAlan Modra2-6/+15
Similar to b86ac8e3 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD and GOT_TLSGD to LE optimization.