Commit Graph

110 Commits

Author SHA1 Message Date
Simon Marchi 940da03e32 gdb: remove TYPE_FIELD_TYPE macro
Remove the `TYPE_FIELD_TYPE` macro, changing all the call sites to use
`type::field` and `field::type` directly.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_FIELD_TYPE): Remove.  Change all call sites
	to use type::field and field::type instead.

Change-Id: Ifda6226a25c811cfd334a756a9fbc5c0afdddff3
2020-06-08 15:26:31 -04:00
Simon Marchi ceacbf6edf gdb: remove TYPE_FIELD macro
Replace all uses of it by type::field.

Note that since type::field returns a reference to the field, some spots
are used to assign the whole field structure.  See ctfread.c, function
attach_fields_to_type, for example.  This is the same as was happening
with the macro, so I don't think it's a problem, but if anybody sees a
really nicer way to do this, now could be a good time to implement it.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_FIELD): Remove.  Replace all uses with
	type::field.
2020-05-23 17:39:54 -04:00
Simon Marchi 1f704f761b gdb: remove TYPE_NFIELDS macro
Remove `TYPE_NFIELDS`, changing all the call sites to use
`type::num_fields` directly.  This is quite a big diff, but this was
mostly done using sed and coccinelle.  A few call sites were done by
hand.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_NFIELDS): Remove.  Change all cal sites to use
	type::num_fields instead.

Change-Id: Ib73be4c36f9e770e0f729bac3b5257d7cb2f9591
2020-05-22 16:55:15 -04:00
Simon Marchi 7813437494 gdb: remove TYPE_CODE macro
Remove TYPE_CODE, changing all the call sites to use type::code
directly.  This is quite a big diff, but this was mostly done using sed
and coccinelle.  A few call sites were done by hand.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_CODE): Remove.  Change all call sites to use
	type::code instead.
2020-05-14 13:46:38 -04:00
Joel Brobecker b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Christian Biesinger c9d95fa3d0 Replace the MSYMBOL_*_NAME macros with member functions
Improves readability. In the future, it will also allow making the name
private, once the name setter functions become member functions.

gdb/ChangeLog:

2019-11-22  Christian Biesinger  <cbiesinger@google.com>

	* ada-lang.c (ada_lookup_simple_minsym): Update.
	(ada_collect_symbol_completion_matches): Update.
	* ada-tasks.c (read_atcb): Update.
	* amd64-windows-tdep.c (amd64_skip_main_prologue): Update.
	(amd64_windows_skip_trampoline_code): Update.
	* arm-tdep.c (skip_prologue_function): Update.
	(arm_skip_stack_protector): Update.
	* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
	(arm_wince_skip_main_prologue): Update.
	* ax-gdb.c (gen_expr): Update.
	* block.c (call_site_for_pc): Update.
	* blockframe.c (find_pc_partial_function): Update.
	* breakpoint.c (set_breakpoint_location_function): Update.
	* btrace.c (ftrace_print_function_name): Update.
	(ftrace_function_switched): Update.
	* c-valprint.c (print_unpacked_pointer): Update.
	* coffread.c (coff_symfile_read): Update.
	* compile/compile-c-symbols.c (convert_symbol_bmsym): Update.
	* compile/compile-cplus-symbols.c (convert_symbol_bmsym): Update.
	* dwarf-index-write.c (write_psymbols): Update.
	* dwarf2loc.c (call_site_to_target_addr): Update.
	(func_verify_no_selftailcall): Update.
	(tailcall_dump): Update.
	(call_site_find_chain_1): Update.
	(dwarf_expr_reg_to_entry_parameter): Update.
	* elfread.c (elf_gnu_ifunc_record_cache): Update.
	* eval.c (evaluate_funcall): Update.
	(evaluate_subexp_standard): Update.
	(evaluate_subexp_for_sizeof): Update.
	* expprint.c (print_subexp_standard): Update.
	(dump_subexp_body_standard): Update.
	* frame.c (get_prev_frame_always_1): Update.
	* frv-tdep.c (frv_skip_main_prologue): Update.
	* gnu-v2-abi.c (gnuv2_value_rtti_type): Update.
	* gnu-v3-abi.c (gnuv3_rtti_type): Update.
	(gnuv3_get_typename_from_type_info): Update.
	(gnuv3_skip_trampoline): Update.
	* hppa-tdep.c (hppa_lookup_stub_minimal_symbol): Update.
	* i386-tdep.c (i386_skip_main_prologue): Update.
	(i386_pe_skip_trampoline_code): Update.
	* ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update.
	* infcall.c (get_function_name): Update.
	* linespec.c (minsym_found): Update.
	* linux-fork.c (info_checkpoints_command): Update.
	* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
	(m32c_m16c_pointer_to_address): Update.
	* maint.c (maintenance_translate_address): Update.
	* minsyms.c (add_minsym_to_hash_table): Update.
	(add_minsym_to_demangled_hash_table): Update.
	(lookup_minimal_symbol_mangled): Update.
	(lookup_minimal_symbol_demangled): Update.
	(lookup_minimal_symbol_linkage): Update.
	(lookup_minimal_symbol_text): Update.
	(lookup_minimal_symbol_by_pc_name): Update.
	(minimal_symbol_is_less_than): Update.
	(compact_minimal_symbols): Update.
	(build_minimal_symbol_hash_tables): Update.
	(find_solib_trampoline_target): Update.
	* mips-tdep.c (mips_stub_frame_sniffer): Update.
	(mips_skip_pic_trampoline_code): Update.
	* msp430-tdep.c (msp430_skip_trampoline_code): Update.
	* objc-lang.c (info_selectors_command): Update.
	(info_classes_command): Update.
	(find_methods): Update.
	(find_imps): Update.
	* p-valprint.c (pascal_val_print): Update.
	* ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Update.
	* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
	* printcmd.c (build_address_symbolic): Update.
	(info_symbol_command): Update.
	* psymtab.c (psymbol_name_matches): Update.
	(match_partial_symbol): Update.
	(lookup_partial_symbol): Update.
	(print_partial_symbols): Update.
	(sort_pst_symbols): Update.
	(maintenance_check_psymtabs): Update.
	* python/py-framefilter.c (py_print_frame): Update.
	* python/python.c (gdbpy_rbreak): Update.
	* record-btrace.c (btrace_get_bfun_name): Update.
	(btrace_call_history): Update.
	* rs6000-tdep.c (rs6000_skip_main_prologue): Update.
	(rs6000_skip_trampoline_code): Update.
	* sol-thread.c (info_cb): Update.
	* stabsread.c (scan_file_globals): Update.
	* stack.c (find_frame_funname): Update.
	(info_frame_command_core): Update.
	* symmisc.c (dump_msymbols): Update.
	* symtab.c (symbol_natural_name): Rename to..,
	(general_symbol_info::natural_name): ...this.
	(symbol_demangled_name): Rename to...
	(general_symbol_info::demangled_name): ...this.
	(symbol_search_name): Rename to...
	(general_symbol_info::search_name): ...this.
	(symbol_matches_search_name): Update.
	(find_pc_sect_line): Update.
	(skip_prologue_sal): Update.
	(search_symbols): Update.
	(print_msymbol_info): Update.
	(rbreak_command): Update.
	(completion_list_add_msymbol): Update.
	(completion_list_objc_symbol): Update.
	(get_msymbol_address): Update.
	* symtab.h (struct general_symbol_info): Add member functions
	natural_name (), linkage_name (), print_name (), demangled_name (),
	and search_name ().
	(SYMBOL_NATURAL_NAME): Update.
	(symbol_natural_name): Move to a member function on general_symbol_info.
	(SYMBOL_DEMANGLED_NAME): Update.
	(symbol_demangled_name): Move to a member function on
	general_symbol_info.
	(SYMBOL_SEARCH_NAME): Update.
	(symbol_search_name): Move to a member function on general_symbol_info.
	(MSYMBOL_NATURAL_NAME): Remove.
	(MSYMBOL_LINKAGE_NAME): Remove.
	(MSYMBOL_PRINT_NAME): Remove.
	(MSYMBOL_DEMANGLED_NAME): Remove.
	(MSYMBOL_SEARCH_NAME): Remove.
	* x86-tdep.c (x86_in_indirect_branch_thunk): Update.

Change-Id: I65aa529843a9903e174ce799037e41f954a9fcee
2019-11-22 12:05:14 -06:00
Tom de Vries 85102364b2 [gdb] Fix more typos in comments
Fix typos in comments.  NFC.

Tested on x86_64-linux.

gdb/ChangeLog:

2019-10-18  Tom de Vries  <tdevries@suse.de>

	* aarch64-tdep.c: Fix typos in comments.
	* ada-lang.c: Same.
	* ada-tasks.c: Same.
	* alpha-tdep.c: Same.
	* alpha-tdep.h: Same.
	* amd64-nat.c: Same.
	* amd64-windows-tdep.c: Same.
	* arc-tdep.c: Same.
	* arc-tdep.h: Same.
	* arch-utils.c: Same.
	* arm-nbsd-tdep.c: Same.
	* arm-tdep.c: Same.
	* ax-gdb.c: Same.
	* blockframe.c: Same.
	* btrace.c: Same.
	* c-varobj.c: Same.
	* coff-pe-read.c: Same.
	* coffread.c: Same.
	* cris-tdep.c: Same.
	* darwin-nat.c: Same.
	* dbxread.c: Same.
	* dcache.c: Same.
	* disasm.c: Same.
	* dtrace-probe.c: Same.
	* dwarf-index-write.c: Same.
	* dwarf2-frame-tailcall.c: Same.
	* dwarf2-frame.c: Same.
	* dwarf2read.c: Same.
	* eval.c: Same.
	* exceptions.c: Same.
	* fbsd-tdep.c: Same.
	* findvar.c: Same.
	* frame.c: Same.
	* frv-tdep.c: Same.
	* gnu-v3-abi.c: Same.
	* go32-nat.c: Same.
	* h8300-tdep.c: Same.
	* hppa-tdep.c: Same.
	* i386-linux-tdep.c: Same.
	* i386-tdep.c: Same.
	* ia64-libunwind-tdep.c: Same.
	* ia64-tdep.c: Same.
	* infcmd.c: Same.
	* infrun.c: Same.
	* linespec.c: Same.
	* linux-nat.c: Same.
	* linux-thread-db.c: Same.
	* machoread.c: Same.
	* mdebugread.c: Same.
	* mep-tdep.c: Same.
	* mn10300-tdep.c: Same.
	* namespace.c: Same.
	* objfiles.c: Same.
	* opencl-lang.c: Same.
	* or1k-tdep.c: Same.
	* osabi.c: Same.
	* ppc-linux-nat.c: Same.
	* ppc-linux-tdep.c: Same.
	* ppc-sysv-tdep.c: Same.
	* printcmd.c: Same.
	* procfs.c: Same.
	* record-btrace.c: Same.
	* record-full.c: Same.
	* remote-fileio.c: Same.
	* remote.c: Same.
	* rs6000-tdep.c: Same.
	* s12z-tdep.c: Same.
	* score-tdep.c: Same.
	* ser-base.c: Same.
	* ser-go32.c: Same.
	* skip.c: Same.
	* sol-thread.c: Same.
	* solib-svr4.c: Same.
	* solib.c: Same.
	* source.c: Same.
	* sparc-nat.c: Same.
	* sparc-sol2-tdep.c: Same.
	* sparc-tdep.c: Same.
	* sparc64-tdep.c: Same.
	* stabsread.c: Same.
	* stack.c: Same.
	* symfile.c: Same.
	* symtab.c: Same.
	* target-descriptions.c: Same.
	* target-float.c: Same.
	* thread.c: Same.
	* utils.c: Same.
	* valops.c: Same.
	* valprint.c: Same.
	* value.c: Same.
	* varobj.c: Same.
	* windows-nat.c: Same.
	* xcoffread.c: Same.
	* xstormy16-tdep.c: Same.
	* xtensa-tdep.c: Same.

Change-Id: I5175f1b107bfa4e1cdd4a3361ccb4739e53c75c4
2019-10-18 02:48:08 +02:00
Joel Brobecker 42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Alan Hayward cf84fa6bcf Pass return_method to _push_dummy_call
gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_push_dummy_call): Replace arg with
	return_method.
	* alpha-tdep.c (alpha_push_dummy_call): Likewise.
	* amd64-tdep.c (amd64_push_arguments): Likewise.
	(amd64_push_dummy_call): Likewise.
	* amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise.
	* arc-tdep.c (arc_push_dummy_call): Likewise.
	* arm-tdep.c (arm_push_dummy_call): Likewise.
	* avr-tdep.c (avr_push_dummy_call): Likewise.
	* bfin-tdep.c (bfin_push_dummy_call): Likewise.
	* cris-tdep.c (cris_push_dummy_call): Likewise.
	* csky-tdep.c (csky_push_dummy_call): Likewise.
	* frv-tdep.c (frv_push_dummy_call): Likewise.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (gdbarch_push_dummy_call): Replace arg with
	return_method.
	* h8300-tdep.c (h8300_push_dummy_call): Likewise.
	* hppa-tdep.c (hppa32_push_dummy_call): Likewise.
	(hppa64_push_dummy_call): Likewise.
	* i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise.
	* i386-tdep.c (i386_push_dummy_call): Likewise.
	* ia64-tdep.c (ia64_push_dummy_call): Likewise.
	* infcall.c (call_function_by_hand_dummy): Likewise.
	* iq2000-tdep.c (iq2000_push_dummy_call): Likewise.
	* lm32-tdep.c (lm32_push_dummy_call): Likewise.
	* m32c-tdep.c (m32c_push_dummy_call): Likewise.
	* m32r-tdep.c (m32r_push_dummy_call): Likewise.
	* m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise.
	* m68k-tdep.c (m68k_push_dummy_call): Likewise.
	* mep-tdep.c (mep_push_dummy_call): Likewise.
	* mips-tdep.c (mips_eabi_push_dummy_call): Likewise.
	(mips_n32n64_push_dummy_call): Likewise.
	(mips_o32_push_dummy_call): Likewise.
	(mips_o64_push_dummy_call): Likewise.
	* mn10300-tdep.c (mn10300_push_dummy_call): Likewise.
	* msp430-tdep.c (msp430_push_dummy_call): Likewise.
	* nds32-tdep.c (nds32_push_dummy_call): Likewise.
	* nios2-tdep.c (nios2_push_dummy_call): Likewise.
	* or1k-tdep.c (or1k_push_dummy_call): Likewise.
	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Likewise.
	* ppc-tdep.h (ppc_sysv_abi_push_dummy_call): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Likewise.
	* riscv-tdep.c (riscv_push_dummy_call): Likewise.
	* rl78-tdep.c (rl78_push_dummy_call): Likewise.
	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
	* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
	* rx-tdep.c (rx_push_dummy_call): Likewise.
	* s390-tdep.c (s390_push_dummy_call): Likewise.
	* score-tdep.c (score_push_dummy_call): Likewise.
	* sh-tdep.c (sh_push_dummy_call_fpu): Likewise.
	(sh_push_dummy_call_nofpu): Likewise.
	* sparc-tdep.c (sparc32_store_arguments): Likewise.
	(sparc32_push_dummy_call): Likewise.
	* sparc64-tdep.c (sparc64_store_arguments): Likewise.
	(sparc64_push_dummy_call): Likewise.
	* spu-tdep.c (spu_push_dummy_call): Likewise.
	* tic6x-tdep.c (tic6x_push_dummy_call): Likewise.
	* tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
	* v850-tdep.c (v850_push_dummy_call): Likewise.
	* vax-tdep.c (vax_push_dummy_call): Likewise.
	* xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise.
	* xtensa-tdep.c (xtensa_push_dummy_call): Likewise.
2018-11-16 13:45:38 +00:00
Tom Tromey b926417afa Simple -Wshadow=local fixes
This fixes all the straightforward -Wshadow=local warnings in gdb.  A
few standard approaches are used here:

* Renaming an inner (or outer, but more commonly inner) variable;
* Lowering a declaration to avoid a clash;
* Moving a declaration into a more inner scope to avoid a clash,
  including the special case of moving a declaration into a loop header.

I did not consider any of the changes in this patch to be particularly
noteworthy, though of course they should all still be examined.

gdb/ChangeLog
2018-10-04  Tom Tromey  <tom@tromey.com>

	* ctf.c (SET_ARRAY_FIELD): Rename "u32".
	* p-valprint.c (pascal_val_print): Split inner "i" variable.
	* xtensa-tdep.c (xtensa_push_dummy_call): Declare "i" in loop
	header.
	* xstormy16-tdep.c (xstormy16_push_dummy_call): Declare "val" in
	more inner scope.
	* xcoffread.c (read_xcoff_symtab): Rename inner "symbol".
	* varobj.c (varobj_update): Rename inner "newobj",
	"type_changed".
	* valprint.c (generic_emit_char): Rename inner "buf".
	* valops.c (find_overload_match): Rename inner "temp".
	(value_struct_elt_for_reference): Declare "v" in more inner
	scope.
	* v850-tdep.c (v850_push_dummy_call): Rename "len".
	* unittests/array-view-selftests.c (run_tests): Rename inner
	"vec".
	* tui/tui-stack.c (tui_show_frame_info): Declare "i" in loop
	header.
	* tracepoint.c (merge_uploaded_trace_state_variables): Declare
	"tsv" in more inner scope.
	(print_one_static_tracepoint_marker): Rename inner
	"tuple_emitter".
	* tic6x-tdep.c (tic6x_analyze_prologue): Declare "inst" lower.
	(tic6x_push_dummy_call): Don't redeclare "addr".
	* target-float.c: Declare "dto" lower.
	* symtab.c (lookup_local_symbol): Rename inner "sym".
	(find_pc_sect_line): Rename inner "pc".
	* stack.c (print_frame): Don't redeclare "gdbarch".
	(return_command): Rename inner "gdbarch".
	* s390-tdep.c (s390_prologue_frame_unwind_cache): Renam inner
	"sp".
	* rust-lang.c (rust_internal_print_type): Declare "i" in loop
	header.
	* rs6000-tdep.c (ppc_process_record): Rename inner "addr".
	* riscv-tdep.c (riscv_push_dummy_call): Declare "info" in inner
	scope.
	* remote.c (remote_target::update_thread_list): Don't redeclare
	"tp".
	(remote_target::process_initial_stop_replies): Rename inner
	"thread".
	(remote_target::remote_parse_stop_reply): Don't redeclare "p".
	(remote_target::wait_as): Don't redeclare "stop_reply".
	(remote_target::get_thread_local_address): Rename inner
	"result".
	(remote_target::get_tib_address): Likewise.
2018-10-04 22:51:45 -06:00
Simon Marchi e4c4a59b48 Remove regcache_cooked_write_part
Remove regcache_cooked_write_part, update callers to use
regcache::cooked_write_part.

gdb/ChangeLog:

	* regcache.h (regcache_cooked_write_part): Remove, update
	callers to use regcache::cooked_write_part.
	* regcache.c (regcache_cooked_write_part): Remove.
2018-05-30 14:54:44 -04:00
Simon Marchi 73bb000052 Remove regcache_cooked_read_part
Remove regcache_cooked_read_part, update callers to use
readable_regcache::cooked_read_part.

gdb/ChangeLog:

	* regcache.h (regcache_cooked_read_part): Remove, update callers
	to use readable_regcache::cooked_read_part.
	* regcache.c (regcache_cooked_read_part): Remove.
2018-05-30 14:54:43 -04:00
Simon Marchi b66f5587de Remove regcache_cooked_write
Remove regcache_cooked_write, update callers to use
regcache::cooked_write.

gdb/ChangeLog:

	* regcache.h (regcache_cooked_write): Remove, update callers to
	use regcache::cooked_write.
	* regcache.c (regcache_cooked_write): Remove.
2018-05-30 14:54:42 -04:00
Simon Marchi dca08e1fe1 Remove regcache_cooked_read
Remove regcache_cooked_read, update callers to use
readable_regcache::cooked_read instead.

gdb/ChangeLog:

	* regcache.h (regcache_cooked_read): Remove, update callers to
	use readable_regcache::cooked_read instead.
	* regcache.c (regcache_cooked_read): Remove.
2018-05-30 14:54:38 -04:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Ulrich Weigand 3b2ca8248c Target FP: Remove convert_typed_floating from tdep files
This patch mechanically replaces convert_typed_floating with the
equivalent target_float_convert throughout tdep files, to prepare
for the removal of doublest.{c,h}.

No functional change intended.

gdb/ChangeLog:
2017-11-06  Ulrich Weigand  <uweigand@de.ibm.com>

	* i386-tdep.c: Include "target-float.h".  Do not include "doublest.h".
	(i386_extract_return_value): Use target_float_convert.
	(i386_store_return_value): Likewise.
	* i387-tdep.c (i387_register_to_value): Use target_float_convert.
	(i387_value_to_register): Likewise.
	* ia64-tdep.c: Include "target-float.h".  Do not include "doublest.h".
	(ia64_register_to_value): Use target_float_convert.
	(ia64_value_to_register): Likewise.
	(ia64_extract_return_value): Likewise.
	(ia64_store_return_value): Likewise.
	(ia64_push_dummy_call): Likewise.
	* m68k-tdep.c: Include "target-float.h".
	(m68k_register_to_value): Use target_float_convert.
	(m68k_value_to_register): Likewise.
	(m68k_svr4_extract_return_value): Likewise.
	(m68k_svr4_store_return_value): Likewise.
	* ppc-sysv-tdep.c: Include "target-float.h".
	(ppc_sysv_abi_push_dummy_call): Use target_float_convert.
	(do_ppc_sysv_return_value): Likewise.
	(ppc64_sysv_abi_push_freg): Likewise.
	(ppc64_sysv_abi_return_value_base): Likewise.
	* rs6000-aix-tdep.c: Include "target-float.h".
	(rs6000_push_dummy_call): Use target_float_convert.
	(rs6000_return_value): Likewise.
	* rs6000-lynx178-tdep.c: Include "target-float.h".
	(rs6000_lynx178_push_dummy_call): Use target_float_convert.
	(rs6000_lynx178_return_value): Likewise.
	* rs6000-tdep.c: Include "target-float.h".  Do not include "doublest.h".
	(rs6000_register_to_value): Use target_float_convert.
	(rs6000_value_to_register): Likewise.
	* arm-tdep.c: Include "target-float.h".  Do not include "doublest.h".
	(arm_extract_return_value): Use target_float_convert.
	(arm_store_return_value): Likewise.
	* sh-tdep.c: Include "target-float.h".  Do not include "doublest.h".
	(sh_register_convert_to_virtual): Use target_float_convert.
	(sh_register_convert_to_raw): Likewise.
	* sh64-tdep.c: Include "target-float.h".
	(sh64_extract_return_value): Use target_float_convert.
	(sh64_register_convert_to_virtual): Likewise.
	(sh64_register_convert_to_raw): Likewise.  Fix argument types.
2017-11-06 16:01:37 +01:00
Alan Hayward 0f068fb5e5 Add PPC_MAX_REGISTER_SIZE
gdb/
	* ppc-linux-nat.c (fetch_register): Use PPC_MAX_REGISTER_SIZE.
	(store_register): Likewise.
	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Likewise.
	(get_decimal_float_return_value): Likewise.
	(do_ppc_sysv_return_value): Likewise.
	(ppc64_sysv_abi_push_integer): Likewise.
	(ppc64_sysv_abi_push_freg): Likewise.
	(ppc64_sysv_abi_return_value_base): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
	* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
	* rs6000-nat.c: Likewise.
	* rs6000-tdep.c (rs6000_register_to_value): Likewise.
	(rs6000_value_to_register): Likewise.
	* ppc-tdep.h (PPC_MAX_REGISTER_SIZE): Add.
2017-05-22 09:23:22 +01:00
Artemiy Volkov aa0061181a Convert lvalue reference type check to general reference type check
In almost all contexts (except for overload resolution rules and expression
semantics), lvalue and rvalue references are equivalent. That means that in all
but these cases we can replace a TYPE_CODE_REF check to a TYPE_IS_REFERENCE
check and, for switch statements, add a case label for a rvalue reference type
next to a case label for an lvalue reference type. This patch does exactly
that.

gdb/ChangeLog

	PR gdb/14441
	* aarch64-tdep.c (aarch64_type_align)
	(aarch64_extract_return_value, aarch64_store_return_value): Change
	lvalue reference type checks to general reference type checks.
	* amd64-tdep.c (amd64_classify): Likewise.
	* amd64-windows-tdep.c (amd64_windows_passed_by_integer_register):
	Likewise.
	* arm-tdep.c (arm_type_align, arm_extract_return_value)
	(arm_store_return_value): Likewise.
	* ax-gdb.c (gen_fetch, gen_cast): Likewise.
	* c-typeprint.c (c_print_type): Likewise.
	* c-varobj.c (adjust_value_for_child_access, c_value_of_variable)
	(cplus_number_of_children, cplus_describe_child): Likewise.
	* compile/compile-c-symbols.c (generate_vla_size): Likewise.
	* completer.c (expression_completer): Likewise.
	* cp-support.c (make_symbol_overload_list_adl_namespace):
	Likewise.
	* darwin-nat-info.c (info_mach_region_command): Likewise.
	* dwarf2loc.c (entry_data_value_coerce_ref)
	(value_of_dwarf_reg_entry): Likewise.
	* eval.c (ptrmath_type_p, evaluate_subexp_standard)
	(evaluate_subexp_for_address, evaluate_subexp_for_sizeof):
	Likewise.
	* findvar.c (extract_typed_address, store_typed_address):
	Likewise.
	* gdbtypes.c (rank_one_type): Likewise.
	* hppa-tdep.c (hppa64_integral_or_pointer_p): Likewise.
	* infcall.c (value_arg_coerce): Likewise.
	* language.c (pointer_type): Likewise.
	* m32c-tdep.c (m32c_reg_arg_type, m32c_m16c_address_to_pointer):
	Likewise.
	* m88k-tdep.c (m88k_integral_or_pointer_p): Likewise.
	* mn10300-tdep.c (mn10300_type_align): Likewise.
	* msp430-tdep.c (msp430_push_dummy_call): Likewise.
	* ppc-sysv-tdep.c (do_ppc_sysv_return_value)
	(ppc64_sysv_abi_push_param, ppc64_sysv_abi_return_value):
	Likewise.
	* printcmd.c (print_formatted, x_command): Likewise.
	* python/py-type.c (typy_get_composite, typy_template_argument):
	Likewise.
	* python/py-value.c (valpy_referenced_value)
	(valpy_get_dynamic_type, value_has_field): Likewise.
	* s390-linux-tdep.c (s390_function_arg_integer): Likewise.
	* sparc-tdep.c (sparc_integral_or_pointer_p): Likewise.
	* sparc64-tdep.c (sparc64_integral_or_pointer_p): Likewise.
	* spu-tdep.c (spu_scalar_value_p): Likewise.
	* symtab.c (lookup_symbol_aux): Likewise.
	* typeprint.c (whatis_exp, print_type_scalar): Likewise.
	* valarith.c (binop_types_user_defined_p, unop_user_defined_p):
	Likewise.
	* valops.c (value_cast_pointers, value_cast)
	(value_reinterpret_cast, value_dynamic_cast, value_addr, typecmp)
	(value_struct_elt, value_struct_elt_bitpos)
	(value_find_oload_method_list, find_overload_match)
	(value_rtti_indirect_type): Likewise.
	* valprint.c (val_print_scalar_type_p, generic_val_print):
	Likewise.
	* value.c (value_actual_type, value_as_address, unpack_long)
	(pack_long, pack_unsigned_long, coerce_ref_if_computed)
	(coerce_ref): Likewise.
	* varobj.c (varobj_get_value_type): Likewise.
2017-03-20 13:47:54 -07:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Pedro Alves 325fac504a gdb: Use std::min and std::max throughout
Otherwise including <string> or some other C++ header is broken.
E.g.:

  In file included from /opt/gcc/include/c++/7.0.0/bits/char_traits.h:39:0,
		   from /opt/gcc/include/c++/7.0.0/string:40,
		   from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/infrun.c:68:
  /opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
       min(const _Tp& __a, const _Tp& __b, _Compare __comp)
							  ^
  /opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
       max(const _Tp& __a, const _Tp& __b, _Compare __comp)
							  ^
  In file included from .../src/gdb/infrun.c:21:0:

To the best of my grepping abilities, I believe I adjusted all min/max
calls.

gdb/ChangeLog:
2016-09-16  Pedro Alves  <palves@redhat.com>

	* defs.h (min, max): Delete.
	* aarch64-tdep.c: Include <algorithm> and use std::min and
	std::max throughout.
	* aarch64-tdep.c: Likewise.
	* alpha-tdep.c: Likewise.
	* amd64-tdep.c: Likewise.
	* amd64-windows-tdep.c: Likewise.
	* arm-tdep.c: Likewise.
	* avr-tdep.c: Likewise.
	* breakpoint.c: Likewise.
	* btrace.c: Likewise.
	* ctf.c: Likewise.
	* disasm.c: Likewise.
	* doublest.c: Likewise.
	* dwarf2loc.c: Likewise.
	* dwarf2read.c: Likewise.
	* environ.c: Likewise.
	* exec.c: Likewise.
	* f-exp.y: Likewise.
	* findcmd.c: Likewise.
	* ft32-tdep.c: Likewise.
	* gcore.c: Likewise.
	* hppa-tdep.c: Likewise.
	* i386-darwin-tdep.c: Likewise.
	* i386-tdep.c: Likewise.
	* linux-thread-db.c: Likewise.
	* lm32-tdep.c: Likewise.
	* m32r-tdep.c: Likewise.
	* m88k-tdep.c: Likewise.
	* memrange.c: Likewise.
	* minidebug.c: Likewise.
	* mips-tdep.c: Likewise.
	* moxie-tdep.c: Likewise.
	* nds32-tdep.c: Likewise.
	* nios2-tdep.c: Likewise.
	* nto-procfs.c: Likewise.
	* parse.c: Likewise.
	* ppc-sysv-tdep.c: Likewise.
	* probe.c: Likewise.
	* record-btrace.c: Likewise.
	* remote.c: Likewise.
	* rs6000-tdep.c: Likewise.
	* rx-tdep.c: Likewise.
	* s390-linux-nat.c: Likewise.
	* s390-linux-tdep.c: Likewise.
	* ser-tcp.c: Likewise.
	* sh-tdep.c: Likewise.
	* sh64-tdep.c: Likewise.
	* source.c: Likewise.
	* sparc-tdep.c: Likewise.
	* symfile.c: Likewise.
	* target-memory.c: Likewise.
	* target.c: Likewise.
	* tic6x-tdep.c: Likewise.
	* tilegx-tdep.c: Likewise.
	* tracefile-tfile.c: Likewise.
	* tracepoint.c: Likewise.
	* valprint.c: Likewise.
	* value.c: Likewise.
	* xtensa-tdep.c: Likewise.
	* cli/cli-cmds.c: Likewise.
	* compile/compile-object-load.c: Likewise.
2016-09-16 19:55:17 +01:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Simon Marchi f486487f55 Mostly trivial enum fixes
This is a patch I extracted from Pedro's C++ branch.  It contains the
most trivial enum fixes, where an integer type/value was used instead
of the appropriate enum type/value.  It fixes many C++ errors, since
in C++ you can't mix integers and enums implicitely.

Regardless of the C++ conversion, I think this is a good cleanup to make
use of the appropriate enum types.

Regression-tested on native x86_64.

gdb/ChangeLog:

	* aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum
	type or value instead of integer.
	(aarch64_linux_insert_watchpoint): Likewise.
	(aarch64_linux_remove_watchpoint): Likewise.
	* ada-lang.c (ada_op_print_tab): Likewise.
	* amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise.
	(amd64_linux_syscall_record_common): Likewise.
	* arch-utils.c (target_byte_order_user): Likewise.
	(default_byte_order): Likewise.
	* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise.
	(arm_linux_get_hwbp_type): Likewise.
	(arm_linux_hw_watchpoint_initialize): Likewise.
	(arm_linux_insert_watchpoint): Likewise.
	* arm-linux-tdep.c (arm_canonicalize_syscall): Likewise.
	(arm_linux_syscall_record): Likewise.
	* breakpoint.c (update_watchpoint): Likewise.
	(breakpoint_here_p): Likewise.
	(bpstat_print): Likewise.
	(enable_breakpoint_disp): Likewise.
	* c-lang.c (c_op_print_tab): Likewise.
	* cli/cli-decode.c (add_info_alias): Likewise.
	* d-lang.c (d_op_print_tab): Likewise.
	* eval.c (evaluate_subexp_standard): Likewise.
	* f-exp.y (dot_ops): Likewise.
	(f77_keywords): Likewise.
	* f-lang.c (f_op_print_tab): Likewise.
	* go-lang.c (go_op_print_tab): Likewise.
	* guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise.
	* guile/scm-cmd.c (gdbscm_make_command): Likewise.
	* guile/scm-param.c (gdbscm_make_parameter): Likewise.
	* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise.
	* guile/scm-string.c (struct scm_to_stringn_data): Likewise.
	(struct scm_from_stringn_data): Likewise.
	* i386-linux-tdep.c (i386_canonicalize_syscall): Likewise.
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
	(ia64_linux_remove_watchpoint): Likewise.
	(ia64_linux_can_use_hw_breakpoint): Likewise.
	* infrun.c (print_stop_event): Likewise.
	* jv-lang.c (java_op_print_tab): Likewise.
	* linux-nat.c (linux_proc_xfer_partial): Likewise.
	* linux-nat.h (struct lwp_info): Likewise.
	* linux-thread-db.c (enable_thread_event): Likewise.
	* m2-lang.c (m2_op_print_tab): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise.
	(mi_cmd_stack_list_variables): Likewise.
	* mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
	* mi/mi-out.c (mi_table_begin): Likewise.
	(mi_table_header): Likewise.
	* mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise.
	(mips_linux_insert_watchpoint): Likewise.
	(mips_linux_remove_watchpoint): Likewise.
	* nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise.
	* nat/mips-linux-watch.h (struct mips_watchpoint): Likewise.
	(mips_linux_watch_type_to_irw): Likewise.
	* nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise.
	(procfs_insert_hw_watchpoint): Likewise.
	(procfs_remove_hw_watchpoint): Likewise.
	(procfs_hw_watchpoint): Likewise.
	(procfs_can_use_hw_breakpoint): Likewise.
	(procfs_remove_hw_watchpoint): Likewise.
	(procfs_insert_hw_watchpoint): Likewise.
	* p-lang.c (pascal_op_print_tab): Likewise.
	* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise.
	* ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise.
	* ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise.
	* procfs.c (procfs_can_use_hw_breakpoint): Likewise.
	(procfs_insert_watchpoint): Likewise.
	(procfs_remove_watchpoint): Likewise.
	* psymtab.c (recursively_search_psymtabs): Likewise.
	* remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise.
	(m32r_insert_watchpoint): Likewise.
	* remote-mips.c (mips_can_use_watchpoint): Likewise.
	(mips_insert_watchpoint): Likewise.
	(mips_remove_watchpoint): Likewise.
	* remote.c (watchpoint_to_Z_packet): Likewise.
	(remote_insert_watchpoint): Likewise.
	(remote_remove_watchpoint): Likewise.
	(remote_check_watch_resources): Likewise.
	* s390-linux-nat.c (s390_insert_watchpoint): Likewise.
	(s390_remove_watchpoint): Likewise.
	(s390_can_use_hw_breakpoint): Likewise.
	* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
	* spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise.
	* target.h (struct target_ops): Likewise.
	* tilegx-tdep.c (tilegx_analyze_prologue): Likewise.
	* ui-out.c (struct ui_out_hdr): Likewise.
	(append_header_to_list): Likewise.
	(get_next_header): Likewise.
	(verify_field): Likewise.
	(ui_out_begin): Likewise.
	(ui_out_field_int): Likewise.
	(ui_out_field_fmt_int): Likewise.
	(ui_out_field_skip): Likewise.
	(ui_out_field_string): Likewise.
	(ui_out_field_fmt): Likewise.
	* varobj.c (new_variable): Likewise.
	* x86-nat.c (x86_insert_watchpoint): Likewise.
	(x86_remove_watchpoint): Likewise.
	(x86_can_use_hw_breakpoint): Likewise.
	* xtensa-tdep.h (struct gdbarch_tdep): Likewise.
	* inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to
	previously anonymous enumeration type..
	* linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall
	value.
	* target-debug.h (target_debug_print_enum_target_hw_bp_type): New.
	(target_debug_print_enum_bptype): New.
	* target-delegates.c: Regenerate.
2015-07-31 13:19:53 -04:00
Ulrich Weigand a1da2672bd ppc64: Handle short vectors as function return types
Short synthetic vector types (i.e. those defined using GCC's
attribute ((vector_size)) instead of AltiVec vector types)
are returned in r3.  Fix ppc64_sysv_abi_return_value to
correctly handle this.

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value_base): Handle short
	synthetic (non-AltiVec) vector types.
	(ppc64_sysv_abi_return_value): Likewise.
2015-06-12 17:43:48 +02:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Gary Benson 6d3d12ebef Include string.h in common-defs.h
This commit includes string.h in common-defs.h and removes all other
inclusions.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* common/common-defs.h: Include string.h.
	* aarch64-tdep.c: Do not include string.h.
	* ada-exp.y: Likewise.
	* ada-lang.c: Likewise.
	* ada-lex.l: Likewise.
	* ada-typeprint.c: Likewise.
	* ada-valprint.c: Likewise.
	* aix-thread.c: Likewise.
	* alpha-linux-tdep.c: Likewise.
	* alpha-mdebug-tdep.c: Likewise.
	* alpha-nat.c: Likewise.
	* alpha-osf1-tdep.c: Likewise.
	* alpha-tdep.c: Likewise.
	* alphanbsd-tdep.c: Likewise.
	* amd64-dicos-tdep.c: Likewise.
	* amd64-linux-tdep.c: Likewise.
	* amd64-nat.c: Likewise.
	* amd64-sol2-tdep.c: Likewise.
	* amd64fbsd-tdep.c: Likewise.
	* amd64obsd-tdep.c: Likewise.
	* arch-utils.c: Likewise.
	* arm-linux-nat.c: Likewise.
	* arm-linux-tdep.c: Likewise.
	* arm-tdep.c: Likewise.
	* arm-wince-tdep.c: Likewise.
	* armbsd-tdep.c: Likewise.
	* armnbsd-nat.c: Likewise.
	* armnbsd-tdep.c: Likewise.
	* armobsd-tdep.c: Likewise.
	* avr-tdep.c: Likewise.
	* ax-gdb.c: Likewise.
	* ax-general.c: Likewise.
	* bcache.c: Likewise.
	* bfin-tdep.c: Likewise.
	* breakpoint.c: Likewise.
	* build-id.c: Likewise.
	* buildsym.c: Likewise.
	* c-exp.y: Likewise.
	* c-lang.c: Likewise.
	* c-typeprint.c: Likewise.
	* c-valprint.c: Likewise.
	* charset.c: Likewise.
	* cli-out.c: Likewise.
	* cli/cli-cmds.c: Likewise.
	* cli/cli-decode.c: Likewise.
	* cli/cli-dump.c: Likewise.
	* cli/cli-interp.c: Likewise.
	* cli/cli-logging.c: Likewise.
	* cli/cli-script.c: Likewise.
	* cli/cli-setshow.c: Likewise.
	* cli/cli-utils.c: Likewise.
	* coffread.c: Likewise.
	* common/agent.c: Likewise.
	* common/buffer.c: Likewise.
	* common/buffer.h: Likewise.
	* common/common-utils.c: Likewise.
	* common/filestuff.c: Likewise.
	* common/filestuff.c: Likewise.
	* common/format.c: Likewise.
	* common/print-utils.c: Likewise.
	* common/rsp-low.c: Likewise.
	* common/signals.c: Likewise.
	* common/vec.h: Likewise.
	* common/xml-utils.c: Likewise.
	* core-regset.c: Likewise.
	* corefile.c: Likewise.
	* corelow.c: Likewise.
	* cp-abi.c: Likewise.
	* cp-name-parser.y: Likewise.
	* cp-support.c: Likewise.
	* cp-valprint.c: Likewise.
	* cris-tdep.c: Likewise.
	* d-exp.y: Likewise.
	* darwin-nat.c: Likewise.
	* dbxread.c: Likewise.
	* dcache.c: Likewise.
	* demangle.c: Likewise.
	* dicos-tdep.c: Likewise.
	* disasm.c: Likewise.
	* doublest.c: Likewise.
	* dsrec.c: Likewise.
	* dummy-frame.c: Likewise.
	* dwarf2-frame.c: Likewise.
	* dwarf2loc.c: Likewise.
	* dwarf2read.c: Likewise.
	* elfread.c: Likewise.
	* environ.c: Likewise.
	* eval.c: Likewise.
	* event-loop.c: Likewise.
	* exceptions.c: Likewise.
	* exec.c: Likewise.
	* expprint.c: Likewise.
	* f-exp.y: Likewise.
	* f-lang.c: Likewise.
	* f-typeprint.c: Likewise.
	* f-valprint.c: Likewise.
	* fbsd-nat.c: Likewise.
	* findcmd.c: Likewise.
	* findvar.c: Likewise.
	* fork-child.c: Likewise.
	* frame.c: Likewise.
	* frv-linux-tdep.c: Likewise.
	* frv-tdep.c: Likewise.
	* gdb.c: Likewise.
	* gdb_bfd.c: Likewise.
	* gdbarch.c: Likewise.
	* gdbarch.sh: Likewise.
	* gdbtypes.c: Likewise.
	* gnu-nat.c: Likewise.
	* gnu-v2-abi.c: Likewise.
	* gnu-v3-abi.c: Likewise.
	* go-exp.y: Likewise.
	* go-lang.c: Likewise.
	* go32-nat.c: Likewise.
	* guile/guile.c: Likewise.
	* guile/scm-auto-load.c: Likewise.
	* hppa-hpux-tdep.c: Likewise.
	* hppa-linux-nat.c: Likewise.
	* hppanbsd-tdep.c: Likewise.
	* hppaobsd-tdep.c: Likewise.
	* i386-cygwin-tdep.c: Likewise.
	* i386-dicos-tdep.c: Likewise.
	* i386-linux-tdep.c: Likewise.
	* i386-nto-tdep.c: Likewise.
	* i386-sol2-tdep.c: Likewise.
	* i386-tdep.c: Likewise.
	* i386bsd-tdep.c: Likewise.
	* i386gnu-nat.c: Likewise.
	* i386nbsd-tdep.c: Likewise.
	* i386obsd-tdep.c: Likewise.
	* i387-tdep.c: Likewise.
	* ia64-libunwind-tdep.c: Likewise.
	* ia64-linux-nat.c: Likewise.
	* inf-child.c: Likewise.
	* inf-ptrace.c: Likewise.
	* inf-ttrace.c: Likewise.
	* infcall.c: Likewise.
	* infcmd.c: Likewise.
	* inflow.c: Likewise.
	* infrun.c: Likewise.
	* interps.c: Likewise.
	* iq2000-tdep.c: Likewise.
	* irix5-nat.c: Likewise.
	* jv-exp.y: Likewise.
	* jv-lang.c: Likewise.
	* jv-typeprint.c: Likewise.
	* jv-valprint.c: Likewise.
	* language.c: Likewise.
	* linux-fork.c: Likewise.
	* linux-nat.c: Likewise.
	* lm32-tdep.c: Likewise.
	* m2-exp.y: Likewise.
	* m2-typeprint.c: Likewise.
	* m32c-tdep.c: Likewise.
	* m32r-linux-nat.c: Likewise.
	* m32r-linux-tdep.c: Likewise.
	* m32r-rom.c: Likewise.
	* m32r-tdep.c: Likewise.
	* m68hc11-tdep.c: Likewise.
	* m68k-tdep.c: Likewise.
	* m68kbsd-tdep.c: Likewise.
	* m68klinux-nat.c: Likewise.
	* m68klinux-tdep.c: Likewise.
	* m88k-tdep.c: Likewise.
	* machoread.c: Likewise.
	* macrocmd.c: Likewise.
	* main.c: Likewise.
	* mdebugread.c: Likewise.
	* mem-break.c: Likewise.
	* memattr.c: Likewise.
	* memory-map.c: Likewise.
	* mep-tdep.c: Likewise.
	* mi/mi-cmd-break.c: Likewise.
	* mi/mi-cmd-disas.c: Likewise.
	* mi/mi-cmd-env.c: Likewise.
	* mi/mi-cmd-stack.c: Likewise.
	* mi/mi-cmd-var.c: Likewise.
	* mi/mi-cmds.c: Likewise.
	* mi/mi-console.c: Likewise.
	* mi/mi-getopt.c: Likewise.
	* mi/mi-interp.c: Likewise.
	* mi/mi-main.c: Likewise.
	* mi/mi-parse.c: Likewise.
	* microblaze-rom.c: Likewise.
	* microblaze-tdep.c: Likewise.
	* mingw-hdep.c: Likewise.
	* minidebug.c: Likewise.
	* minsyms.c: Likewise.
	* mips-irix-tdep.c: Likewise.
	* mips-linux-tdep.c: Likewise.
	* mips-tdep.c: Likewise.
	* mips64obsd-tdep.c: Likewise.
	* mipsnbsd-tdep.c: Likewise.
	* mipsread.c: Likewise.
	* mn10300-linux-tdep.c: Likewise.
	* mn10300-tdep.c: Likewise.
	* monitor.c: Likewise.
	* moxie-tdep.c: Likewise.
	* mt-tdep.c: Likewise.
	* nat/linux-btrace.c: Likewise.
	* nat/linux-osdata.c: Likewise.
	* nat/linux-procfs.c: Likewise.
	* nat/linux-ptrace.c: Likewise.
	* nat/linux-waitpid.c: Likewise.
	* nbsd-tdep.c: Likewise.
	* nios2-linux-tdep.c: Likewise.
	* nto-procfs.c: Likewise.
	* nto-tdep.c: Likewise.
	* objc-lang.c: Likewise.
	* objfiles.c: Likewise.
	* opencl-lang.c: Likewise.
	* osabi.c: Likewise.
	* osdata.c: Likewise.
	* p-exp.y: Likewise.
	* p-lang.c: Likewise.
	* p-typeprint.c: Likewise.
	* parse.c: Likewise.
	* posix-hdep.c: Likewise.
	* ppc-linux-nat.c: Likewise.
	* ppc-sysv-tdep.c: Likewise.
	* ppcfbsd-tdep.c: Likewise.
	* ppcnbsd-tdep.c: Likewise.
	* ppcobsd-tdep.c: Likewise.
	* printcmd.c: Likewise.
	* procfs.c: Likewise.
	* prologue-value.c: Likewise.
	* python/py-auto-load.c: Likewise.
	* python/py-gdb-readline.c: Likewise.
	* ravenscar-thread.c: Likewise.
	* regcache.c: Likewise.
	* registry.c: Likewise.
	* remote-fileio.c: Likewise.
	* remote-m32r-sdi.c: Likewise.
	* remote-mips.c: Likewise.
	* remote-notif.c: Likewise.
	* remote-sim.c: Likewise.
	* remote.c: Likewise.
	* reverse.c: Likewise.
	* rs6000-aix-tdep.c: Likewise.
	* ser-base.c: Likewise.
	* ser-go32.c: Likewise.
	* ser-mingw.c: Likewise.
	* ser-pipe.c: Likewise.
	* ser-tcp.c: Likewise.
	* ser-unix.c: Likewise.
	* serial.c: Likewise.
	* sh-tdep.c: Likewise.
	* sh64-tdep.c: Likewise.
	* shnbsd-tdep.c: Likewise.
	* skip.c: Likewise.
	* sol-thread.c: Likewise.
	* solib-dsbt.c: Likewise.
	* solib-frv.c: Likewise.
	* solib-osf.c: Likewise.
	* solib-som.c: Likewise.
	* solib-spu.c: Likewise.
	* solib-target.c: Likewise.
	* solib.c: Likewise.
	* somread.c: Likewise.
	* source.c: Likewise.
	* sparc-nat.c: Likewise.
	* sparc-sol2-tdep.c: Likewise.
	* sparc-tdep.c: Likewise.
	* sparc64-tdep.c: Likewise.
	* sparc64fbsd-tdep.c: Likewise.
	* sparc64nbsd-tdep.c: Likewise.
	* sparcnbsd-tdep.c: Likewise.
	* spu-linux-nat.c: Likewise.
	* spu-multiarch.c: Likewise.
	* spu-tdep.c: Likewise.
	* stabsread.c: Likewise.
	* stack.c: Likewise.
	* std-regs.c: Likewise.
	* symfile.c: Likewise.
	* symmisc.c: Likewise.
	* symtab.c: Likewise.
	* target.c: Likewise.
	* thread.c: Likewise.
	* tilegx-linux-nat.c: Likewise.
	* tilegx-tdep.c: Likewise.
	* top.c: Likewise.
	* tracepoint.c: Likewise.
	* tui/tui-command.c: Likewise.
	* tui/tui-data.c: Likewise.
	* tui/tui-disasm.c: Likewise.
	* tui/tui-file.c: Likewise.
	* tui/tui-layout.c: Likewise.
	* tui/tui-out.c: Likewise.
	* tui/tui-regs.c: Likewise.
	* tui/tui-source.c: Likewise.
	* tui/tui-stack.c: Likewise.
	* tui/tui-win.c: Likewise.
	* tui/tui-windata.c: Likewise.
	* tui/tui-winsource.c: Likewise.
	* typeprint.c: Likewise.
	* ui-file.c: Likewise.
	* ui-out.c: Likewise.
	* user-regs.c: Likewise.
	* utils.c: Likewise.
	* v850-tdep.c: Likewise.
	* valarith.c: Likewise.
	* valops.c: Likewise.
	* valprint.c: Likewise.
	* value.c: Likewise.
	* varobj.c: Likewise.
	* vax-tdep.c: Likewise.
	* vaxnbsd-tdep.c: Likewise.
	* vaxobsd-tdep.c: Likewise.
	* windows-nat.c: Likewise.
	* xcoffread.c: Likewise.
	* xml-support.c: Likewise.
	* xstormy16-tdep.c: Likewise.
	* xtensa-linux-nat.c: Likewise.

gdb/gdbserver/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* server.h: Do not include string.h.
	* event-loop.c: Likewise.
	* linux-low.c: Likewise.
	* regcache.c: Likewise.
	* remote-utils.c: Likewise.
	* spu-low.c: Likewise.
	* utils.c: Likewise.
2014-08-07 09:06:47 +01:00
Gary Benson dccbb60975 Include gdb_assert.h in common-defs.h
This commit includes gdb_assert.h in common-defs.h and removes all
other inclusions.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* common/common-defs.h: Include gdb_assert.h.
	* aarch64-tdep.c: Do not include gdb_assert.h.
	* addrmap.c: Likewise.
	* aix-thread.c: Likewise.
	* alpha-linux-tdep.c: Likewise.
	* alpha-mdebug-tdep.c: Likewise.
	* alphanbsd-tdep.c: Likewise.
	* amd64-nat.c: Likewise.
	* amd64-tdep.c: Likewise.
	* amd64bsd-nat.c: Likewise.
	* amd64fbsd-nat.c: Likewise.
	* amd64fbsd-tdep.c: Likewise.
	* amd64nbsd-nat.c: Likewise.
	* amd64nbsd-tdep.c: Likewise.
	* amd64obsd-nat.c: Likewise.
	* amd64obsd-tdep.c: Likewise.
	* arch-utils.c: Likewise.
	* arm-tdep.c: Likewise.
	* armbsd-tdep.c: Likewise.
	* auxv.c: Likewise.
	* bcache.c: Likewise.
	* bfin-tdep.c: Likewise.
	* blockframe.c: Likewise.
	* breakpoint.c: Likewise.
	* bsd-kvm.c: Likewise.
	* bsd-uthread.c: Likewise.
	* buildsym.c: Likewise.
	* c-exp.y: Likewise.
	* c-lang.c: Likewise.
	* charset.c: Likewise.
	* cleanups.c: Likewise.
	* cli-out.c: Likewise.
	* cli/cli-decode.c: Likewise.
	* cli/cli-dump.c: Likewise.
	* cli/cli-logging.c: Likewise.
	* cli/cli-script.c: Likewise.
	* cli/cli-utils.c: Likewise.
	* coffread.c: Likewise.
	* common/common-utils.c: Likewise.
	* common/queue.h: Likewise.
	* common/signals.c: Likewise.
	* common/vec.h: Likewise.
	* complaints.c: Likewise.
	* completer.c: Likewise.
	* corelow.c: Likewise.
	* cp-abi.c: Likewise.
	* cp-name-parser.y: Likewise.
	* cp-namespace.c: Likewise.
	* cp-support.c: Likewise.
	* cris-tdep.c: Likewise.
	* dbxread.c: Likewise.
	* dictionary.c: Likewise.
	* doublest.c: Likewise.
	* dsrec.c: Likewise.
	* dummy-frame.c: Likewise.
	* dwarf2-frame-tailcall.c: Likewise.
	* dwarf2-frame.c: Likewise.
	* dwarf2expr.c: Likewise.
	* dwarf2loc.c: Likewise.
	* dwarf2read.c: Likewise.
	* eval.c: Likewise.
	* event-loop.c: Likewise.
	* exceptions.c: Likewise.
	* expprint.c: Likewise.
	* f-valprint.c: Likewise.
	* fbsd-nat.c: Likewise.
	* findvar.c: Likewise.
	* frame-unwind.c: Likewise.
	* frame.c: Likewise.
	* frv-tdep.c: Likewise.
	* gcore.c: Likewise.
	* gdb-dlfcn.c: Likewise.
	* gdb_bfd.c: Likewise.
	* gdbarch.c: Likewise.
	* gdbarch.sh: Likewise.
	* gdbtypes.c: Likewise.
	* gnu-nat.c: Likewise.
	* gnu-v3-abi.c: Likewise.
	* go-lang.c: Likewise.
	* guile/scm-exception.c: Likewise.
	* guile/scm-gsmob.c: Likewise.
	* guile/scm-lazy-string.c: Likewise.
	* guile/scm-math.c: Likewise.
	* guile/scm-pretty-print.c: Likewise.
	* guile/scm-safe-call.c: Likewise.
	* guile/scm-utils.c: Likewise.
	* guile/scm-value.c: Likewise.
	* h8300-tdep.c: Likewise.
	* hppa-hpux-nat.c: Likewise.
	* hppa-tdep.c: Likewise.
	* hppanbsd-tdep.c: Likewise.
	* hppaobsd-tdep.c: Likewise.
	* i386-darwin-nat.c: Likewise.
	* i386-darwin-tdep.c: Likewise.
	* i386-nto-tdep.c: Likewise.
	* i386-tdep.c: Likewise.
	* i386bsd-nat.c: Likewise.
	* i386fbsd-tdep.c: Likewise.
	* i386gnu-nat.c: Likewise.
	* i386nbsd-tdep.c: Likewise.
	* i386obsd-tdep.c: Likewise.
	* i387-tdep.c: Likewise.
	* ia64-libunwind-tdep.c: Likewise.
	* ia64-tdep.c: Likewise.
	* inf-ptrace.c: Likewise.
	* inf-ttrace.c: Likewise.
	* infcall.c: Likewise.
	* infcmd.c: Likewise.
	* infrun.c: Likewise.
	* inline-frame.c: Likewise.
	* interps.c: Likewise.
	* jv-lang.c: Likewise.
	* jv-typeprint.c: Likewise.
	* linux-fork.c: Likewise.
	* linux-nat.c: Likewise.
	* linux-thread-db.c: Likewise.
	* m32c-tdep.c: Likewise.
	* m32r-linux-nat.c: Likewise.
	* m32r-tdep.c: Likewise.
	* m68k-tdep.c: Likewise.
	* m68kbsd-nat.c: Likewise.
	* m68kbsd-tdep.c: Likewise.
	* m88k-tdep.c: Likewise.
	* machoread.c: Likewise.
	* macroexp.c: Likewise.
	* macrotab.c: Likewise.
	* maint.c: Likewise.
	* mdebugread.c: Likewise.
	* memory-map.c: Likewise.
	* mep-tdep.c: Likewise.
	* mi/mi-common.c: Likewise.
	* microblaze-tdep.c: Likewise.
	* mingw-hdep.c: Likewise.
	* mips-linux-nat.c: Likewise.
	* mips-linux-tdep.c: Likewise.
	* mips-tdep.c: Likewise.
	* mips64obsd-tdep.c: Likewise.
	* mipsnbsd-tdep.c: Likewise.
	* mn10300-linux-tdep.c: Likewise.
	* mn10300-tdep.c: Likewise.
	* moxie-tdep.c: Likewise.
	* mt-tdep.c: Likewise.
	* nat/linux-btrace.c: Likewise.
	* nat/linux-osdata.c: Likewise.
	* nat/linux-ptrace.c: Likewise.
	* nat/mips-linux-watch.c: Likewise.
	* nios2-linux-tdep.c: Likewise.
	* nios2-tdep.c: Likewise.
	* objc-lang.c: Likewise.
	* objfiles.c: Likewise.
	* obsd-nat.c: Likewise.
	* opencl-lang.c: Likewise.
	* osabi.c: Likewise.
	* parse.c: Likewise.
	* ppc-linux-nat.c: Likewise.
	* ppc-sysv-tdep.c: Likewise.
	* ppcfbsd-nat.c: Likewise.
	* ppcfbsd-tdep.c: Likewise.
	* ppcnbsd-nat.c: Likewise.
	* ppcnbsd-tdep.c: Likewise.
	* ppcobsd-nat.c: Likewise.
	* ppcobsd-tdep.c: Likewise.
	* printcmd.c: Likewise.
	* procfs.c: Likewise.
	* prologue-value.c: Likewise.
	* psymtab.c: Likewise.
	* python/py-lazy-string.c: Likewise.
	* python/py-value.c: Likewise.
	* regcache.c: Likewise.
	* reggroups.c: Likewise.
	* registry.c: Likewise.
	* remote-sim.c: Likewise.
	* remote.c: Likewise.
	* rs6000-aix-tdep.c: Likewise.
	* rs6000-tdep.c: Likewise.
	* s390-linux-tdep.c: Likewise.
	* score-tdep.c: Likewise.
	* ser-base.c: Likewise.
	* ser-mingw.c: Likewise.
	* sh-tdep.c: Likewise.
	* sh64-tdep.c: Likewise.
	* solib-darwin.c: Likewise.
	* solib-spu.c: Likewise.
	* solib-svr4.c: Likewise.
	* source.c: Likewise.
	* sparc-nat.c: Likewise.
	* sparc-sol2-tdep.c: Likewise.
	* sparc-tdep.c: Likewise.
	* sparc64-sol2-tdep.c: Likewise.
	* sparc64-tdep.c: Likewise.
	* sparc64fbsd-tdep.c: Likewise.
	* sparc64nbsd-tdep.c: Likewise.
	* sparc64obsd-tdep.c: Likewise.
	* sparcnbsd-tdep.c: Likewise.
	* sparcobsd-tdep.c: Likewise.
	* spu-multiarch.c: Likewise.
	* spu-tdep.c: Likewise.
	* stabsread.c: Likewise.
	* stack.c: Likewise.
	* symfile.c: Likewise.
	* symtab.c: Likewise.
	* target-descriptions.c: Likewise.
	* target-memory.c: Likewise.
	* target.c: Likewise.
	* tic6x-linux-tdep.c: Likewise.
	* tic6x-tdep.c: Likewise.
	* tilegx-linux-nat.c: Likewise.
	* tilegx-tdep.c: Likewise.
	* top.c: Likewise.
	* tramp-frame.c: Likewise.
	* tui/tui-out.c: Likewise.
	* tui/tui-winsource.c: Likewise.
	* ui-out.c: Likewise.
	* user-regs.c: Likewise.
	* utils.c: Likewise.
	* v850-tdep.c: Likewise.
	* valops.c: Likewise.
	* value.c: Likewise.
	* varobj.c: Likewise.
	* vax-nat.c: Likewise.
	* xml-syscall.c: Likewise.
	* xml-tdesc.c: Likewise.
	* xstormy16-tdep.c: Likewise.
	* xtensa-linux-nat.c: Likewise.
	* xtensa-tdep.c: Likewise.

gdb/gdbserver/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* server.h: Do not include gdb_assert.h.
2014-08-07 09:06:45 +01:00
Tom Tromey 77e371c079 start change to progspace independence
This patch starts changing minimal symbols to be independent of the
program space.

Specifically, it adds a new objfile parameter to MSYMBOL_VALUE_ADDRESS
and changes all the code to use it.  This is needed so we can change
gdb to apply the section offset when a minsym's address is computed,
as opposed to baking the offsets into the symbol itself.

A few spots still need the unrelocated address.  For these, we
introduce MSYMBOL_VALUE_RAW_ADDRESS.

As a convenience, we also add the new macro BMSYMBOL_VALUE_ADDRESS,
which computes the address of a bound minimal symbol.  This just does
the obvious thing with the fields.

Note that this change does not actually enable program space
independence.  That requires more changes to gdb.  However, to ensure
that these changes compile properly, this patch does add the needed
section lookup code to MSYMBOL_VALUE_ADDRESS -- it just ensures it has
no effect at runtime by multiplying the offset by 0.

2014-02-26  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (ada_main_name): Update.
	(ada_add_standard_exceptions): Update.
	* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
	* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
	* arm-tdep.c (skip_prologue_function, arm_skip_stub): Update.
	* auxv.c (ld_so_xfer_auxv): Update.
	* avr-tdep.c (avr_scan_prologue): Update.
	* ax-gdb.c (gen_var_ref): Update.
	* blockframe.c (get_pc_function_start)
	(find_pc_partial_function_gnu_ifunc): Update.
	* breakpoint.c (create_overlay_event_breakpoint)
	(create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint): Update.
	* bsd-uthread.c (bsd_uthread_lookup_address): Update.
	* c-valprint.c (c_val_print): Update.
	* coff-pe-read.c (add_pe_forwarded_sym): Update.
	* common/agent.c (agent_look_up_symbols): Update.
	* dbxread.c (find_stab_function_addr, end_psymtab): Update.
	* dwarf2loc.c (call_site_to_target_addr): Update.
	* dwarf2read.c (dw2_find_pc_sect_symtab): Update.
	* elfread.c (elf_gnu_ifunc_record_cache)
	(elf_gnu_ifunc_resolve_by_got): Update.
	* findvar.c (default_read_var_value): Update.
	* frame.c (inside_main_func): Update.
	* frv-tdep.c (frv_frame_this_id): Update.
	* glibc-tdep.c (glibc_skip_solib_resolver): Update.
	* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
	Update.
	* hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence)
	(hppa_hpux_find_dummy_bpaddr): Update.
	* hppa-tdep.c (hppa_symbol_address): Update.
	* infcmd.c (until_next_command): Update.
	* jit.c (jit_read_descriptor, jit_breakpoint_re_set_internal):
	Update.
	* linespec.c (minsym_found, add_minsym): Update.
	* linux-nat.c (get_signo): Update.
	* linux-thread-db.c (inferior_has_bug): Update.
	* m32c-tdep.c (m32c_return_value)
	(m32c_m16c_address_to_pointer): Update.
	* m32r-tdep.c (m32r_frame_this_id): Update.
	* m68hc11-tdep.c (m68hc11_get_register_info): Update.
	* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
	* maint.c (maintenance_translate_address): Update.
	* minsyms.c (lookup_minimal_symbol_by_pc_name): Update.
	(frob_address): New function.
	(lookup_minimal_symbol_by_pc_section_1): Use raw addresses,
	frob_address.  Rename parameter to "pc_in".
	(compare_minimal_symbols, compact_minimal_symbols): Use raw
	addresses.
	(find_solib_trampoline_target, minimal_symbol_upper_bound):
	Update.
	* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
	* mips-tdep.c (mips_skip_pic_trampoline_code): Update.
	* objc-lang.c (find_objc_msgsend): Update.
	* objfiles.c (objfile_relocate1): Update.
	* obsd-tdep.c (obsd_skip_solib_resolver): Update.
	* p-valprint.c (pascal_val_print): Update.
	* parse.c (write_exp_msymbol): Update.
	* ppc-linux-tdep.c (ppc_linux_spe_context_lookup)
	(ppc_elfv2_skip_entrypoint): Update.
	* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
	* printcmd.c (build_address_symbolic, msym_info)
	(address_info): Update.
	* proc-service.c (ps_pglobal_lookup): Update.
	* psymtab.c (find_pc_sect_psymtab_closer)
	(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial):
	Change msymbol parameter to bound_minimal_symbol.
	* ravenscar-thread.c (get_running_thread_id): Update.
	* remote.c (remote_check_symbols): Update.
	* sh64-tdep.c (sh64_elf_make_msymbol_special): Use raw
	address.
	* sol2-tdep.c (sol2_skip_solib_resolver): Update.
	* solib-dsbt.c (lm_base): Update.
	* solib-frv.c (lm_base, main_got): Update.
	* solib-irix.c (locate_base): Update.
	* solib-som.c (som_solib_create_inferior_hook)
	(link_map_start): Update.
	* solib-spu.c (spu_enable_break, ocl_enable_break): Update.
	* solib-svr4.c (elf_locate_base, enable_break): Update.
	* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
	(flush_ea_cache): Update.
	* stabsread.c (define_symbol, scan_file_globals): Update.
	* stack.c (find_frame_funname): Update.
	* symfile-debug.c (debug_qf_expand_symtabs_matching)
	(debug_qf_find_pc_sect_symtab): Update.
	* symfile.c (simple_read_overlay_table)
	(simple_overlay_update): Update.
	* symfile.h (struct quick_symbol_functions)
	<find_pc_sect_symtab>: Change type of msymbol to
	bound_minimal_symbol.
	* symmisc.c (dump_msymbols): Update.
	* symtab.c (find_pc_sect_symtab_via_partial)
	(find_pc_sect_psymtab, find_pc_sect_line, skip_prologue_sal)
	(search_symbols, print_msymbol_info): Update.
	* symtab.h (MSYMBOL_VALUE_RAW_ADDRESS): New macro.
	(MSYMBOL_VALUE_ADDRESS): Redefine.
	(BMSYMBOL_VALUE_ADDRESS): New macro.
	* tracepoint.c (scope_info): Update.
	* tui/tui-disasm.c (tui_find_disassembly_address)
	(tui_get_begin_asm_address): Update.
	* valops.c (find_function_in_inferior): Update.
	* value.c (value_static_field, value_fn_field): Update.
2014-02-26 12:11:17 -07:00
Tom Tromey 3b7344d5ab use bound_minsym as result for lookup_minimal_symbol et al
This patch changes a few minimal symbol lookup functions to return a
bound_minimal_symbol rather than a pointer to the minsym.  This change
helps prepare gdb for computing a minimal symbol's address at the
point of use.

Note that this changes even those functions that ostensibly search a
single objfile.  That was necessary because, in fact, those functions
can search an objfile and its separate debug objfiles; and it is
important for the caller to know in which objfile the minimal symbol
was actually found.

The bulk of this patch is mechanical.

2014-02-26  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (ada_update_initial_language): Update.
	(ada_main_name, ada_has_this_exception_support): Update.
	* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
	* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
	* arm-tdep.c (arm_skip_stub): Update.
	* auxv.c (ld_so_xfer_auxv): Update.
	* avr-tdep.c (avr_scan_prologue): Update.
	* ax-gdb.c (gen_var_ref): Update.
	* breakpoint.c (struct breakpoint_objfile_data)
	<overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change
	type to bound_minimal_symbol.
	(create_overlay_event_breakpoint)
	(create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint): Update.
	* bsd-uthread.c (bsd_uthread_lookup_address): Update.
	* c-exp.y (classify_name): Update.
	* coffread.c (coff_symfile_read): Update.
	* common/agent.c (agent_look_up_symbols): Update.
	* d-lang.c (d_main_name): Update.
	* dbxread.c (find_stab_function_addr, end_psymtab): Update.
	* dec-thread.c (enable_dec_thread): Update.
	* dwarf2loc.c (call_site_to_target_addr): Update.
	* elfread.c (elf_gnu_ifunc_resolve_by_got): Update.
	* eval.c (evaluate_subexp_standard): Update.
	* findvar.c (struct minsym_lookup_data) <result>: Change type
	to bound_minimal_symbol.
	<objfile>: Remove.
	(minsym_lookup_iterator_cb, default_read_var_value): Update.
	* frame.c (inside_main_func): Update.
	* frv-tdep.c (frv_frame_this_id): Update.
	* gcore.c (call_target_sbrk): Update.
	* glibc-tdep.c (glibc_skip_solib_resolver): Update.
	* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
	Update.
	* go-lang.c (go_main_name): Update.
	* hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code)
	(hppa_hpux_find_import_stub_for_addr): Update.
	* hppa-tdep.c (hppa_extract_17,	hppa_lookup_stub_minimal_symbol):
	Update.  Change return type.
	* hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return
	type.
	* jit.c (jit_breakpoint_re_set_internal): Update.
	* linux-fork.c (inferior_call_waitpid, checkpoint_command):
	Update.
	* linux-nat.c (get_signo): Update.
	* linux-thread-db.c (inferior_has_bug): Update
	* m32c-tdep.c (m32c_return_value)
	(m32c_m16c_address_to_pointer): Update.
	* m32r-tdep.c (m32r_frame_this_id): Update.
	* m68hc11-tdep.c (m68hc11_get_register_info): Update.
	* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
	* minsyms.c (lookup_minimal_symbol_internal): Rename to
	lookup_minimal_symbol.  Change return type.
	(lookup_minimal_symbol): Remove.
	(lookup_bound_minimal_symbol): Update.
	(lookup_minimal_symbol_text): Change return type.
	(lookup_minimal_symbol_solib_trampoline): Change return type.
	* minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text)
	(lookup_minimal_symbol_solib_trampoline): Change return type.
	* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
	* objc-lang.c (lookup_objc_class, lookup_child_selector)
	(value_nsstring, find_imps): Update.
	* obsd-tdep.c (obsd_skip_solib_resolver): Update.
	* p-lang.c (pascal_main_name): Update.
	* ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update.
	* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
	* proc-service.c (ps_pglobal_lookup): Update.
	* ravenscar-thread.c (get_running_thread_msymbol): Change
	return type.
	(has_ravenscar_runtime, get_running_thread_id): Update.
	* remote.c (remote_check_symbols): Update.
	* sol-thread.c (ps_pglobal_lookup): Update.
	* sol2-tdep.c (sol2_skip_solib_resolver): Update.
	* solib-dsbt.c (lm_base): Update.
	* solib-frv.c (lm_base, frv_relocate_section_addresses):
	Update.
	* solib-irix.c (locate_base): Update.
	* solib-som.c (som_solib_create_inferior_hook)
	(som_solib_desire_dynamic_linker_symbols, link_map_start):
	Update.
	* solib-spu.c (spu_enable_break): Update.
	* solib-svr4.c (elf_locate_base, enable_break): Update.
	* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
	(flush_ea_cache): Update.
	* stabsread.c (define_symbol): Update.
	* symfile.c (simple_read_overlay_table): Update.
	* symtab.c (find_pc_sect_line): Update.
	* tracepoint.c (scope_info): Update.
	* tui-disasm.c (tui_get_begin_asm_address): Update.
	* value.c (value_static_field): Update.
2014-02-26 12:11:17 -07:00
Tom Tromey efd66ac669 change minsym representation
In a later patch we're going to change the minimal symbol address
calculation to apply section offsets at the point of use.  To make it
simpler to catch potential problem spots, this patch changes the
representation of minimal symbols and introduces new
minimal-symbol-specific variants of the various accessors.  This is
necessary because it would be excessively ambitious to try to convert
all the symbol types at once.

The core of this change is just renaming a field in minimal_symbol;
the rest is just a fairly mechanical rewording.

2014-02-26  Tom Tromey  <tromey@redhat.com>

	* symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo.
	(MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES)
	(MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE)
	(MSYMBOL_SECTION, MSYMBOL_OBJ_SECTION, MSYMBOL_NATURAL_NAME)
	(MSYMBOL_LINKAGE_NAME, MSYMBOL_PRINT_NAME, MSYMBOL_DEMANGLED_NAME)
	(MSYMBOL_SET_LANGUAGE, MSYMBOL_SEARCH_NAME)
	(MSYMBOL_MATCHES_SEARCH_NAME, MSYMBOL_SET_NAMES): New macros.
	* ada-lang.c (ada_main_name): Update.
	(ada_lookup_simple_minsym): Update.
	(ada_make_symbol_completion_list): Update.
	(ada_add_standard_exceptions): Update.
	* ada-tasks.c (read_atcb, ada_tasks_inferior_data_sniffer): Update.
	* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
	* amd64-windows-tdep.c (amd64_skip_main_prologue): Update.
	* arm-tdep.c (skip_prologue_function): Update.
	(arm_skip_stack_protector, arm_skip_stub): Update.
	* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
	(arm_wince_skip_main_prologue): Update.
	* auxv.c (ld_so_xfer_auxv): Update.
	* avr-tdep.c (avr_scan_prologue): Update.
	* ax-gdb.c (gen_var_ref): Update.
	* block.c (call_site_for_pc): Update.
	* blockframe.c (get_pc_function_start): Update.
	(find_pc_partial_function_gnu_ifunc): Update.
	* breakpoint.c (create_overlay_event_breakpoint): Update.
	(create_longjmp_master_breakpoint): Update.
	(create_std_terminate_master_breakpoint): Update.
	(create_exception_master_breakpoint): Update.
	(resolve_sal_pc): Update.
	* bsd-uthread.c (bsd_uthread_lookup_address): Update.
	* btrace.c (ftrace_print_function_name, ftrace_function_switched):
	Update.
	* c-valprint.c (c_val_print): Update.
	* coff-pe-read.c (add_pe_forwarded_sym): Update.
	* coffread.c (coff_symfile_read): Update.
	* common/agent.c (agent_look_up_symbols): Update.
	* dbxread.c (find_stab_function_addr): Update.
	(end_psymtab): Update.
	* dwarf2loc.c (call_site_to_target_addr): Update.
	(func_verify_no_selftailcall): Update.
	(tailcall_dump): Update.
	(call_site_find_chain_1): Update.
	(dwarf_expr_reg_to_entry_parameter): Update.
	* elfread.c (elf_gnu_ifunc_record_cache): Update.
	(elf_gnu_ifunc_resolve_by_got): Update.
	* f-valprint.c (info_common_command): Update.
	* findvar.c (read_var_value): Update.
	* frame.c (get_prev_frame_1): Update.
	(inside_main_func): Update.
	* frv-tdep.c (frv_skip_main_prologue): Update.
	(frv_frame_this_id): Update.
	* glibc-tdep.c (glibc_skip_solib_resolver): Update.
	* gnu-v2-abi.c (gnuv2_value_rtti_type): Update.
	* gnu-v3-abi.c (gnuv3_rtti_type): Update.
	(gnuv3_skip_trampoline): Update.
	* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline): Update.
	(hppa64_hpux_in_solib_call_trampoline): Update.
	(hppa_hpux_skip_trampoline_code): Update.
	(hppa64_hpux_search_dummy_call_sequence): Update.
	(hppa_hpux_find_import_stub_for_addr): Update.
	(hppa_hpux_find_dummy_bpaddr): Update.
	* hppa-tdep.c (hppa_symbol_address)
	(hppa_lookup_stub_minimal_symbol): Update.
	* i386-tdep.c (i386_skip_main_prologue): Update.
	(i386_pe_skip_trampoline_code): Update.
	* ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update.
	* infcall.c (get_function_name): Update.
	* infcmd.c (until_next_command): Update.
	* jit.c (jit_breakpoint_re_set_internal): Update.
	(jit_inferior_init): Update.
	* linespec.c (minsym_found): Update.
	(add_minsym): Update.
	* linux-fork.c (info_checkpoints_command): Update.
	* linux-nat.c (get_signo): Update.
	* linux-thread-db.c (inferior_has_bug): Update.
	* m32c-tdep.c (m32c_return_value): Update.
	(m32c_m16c_address_to_pointer): Update.
	(m32c_m16c_pointer_to_address): Update.
	* m32r-tdep.c (m32r_frame_this_id): Update.
	* m68hc11-tdep.c (m68hc11_get_register_info): Update.
	* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
	* maint.c (maintenance_translate_address): Update.
	* minsyms.c (add_minsym_to_hash_table): Update.
	(add_minsym_to_demangled_hash_table): Update.
	(msymbol_objfile): Update.
	(lookup_minimal_symbol): Update.
	(iterate_over_minimal_symbols): Update.
	(lookup_minimal_symbol_text): Update.
	(lookup_minimal_symbol_by_pc_name): Update.
	(lookup_minimal_symbol_solib_trampoline): Update.
	(lookup_minimal_symbol_by_pc_section_1): Update.
	(lookup_minimal_symbol_and_objfile): Update.
	(prim_record_minimal_symbol_full): Update.
	(compare_minimal_symbols): Update.
	(compact_minimal_symbols): Update.
	(build_minimal_symbol_hash_tables): Update.
	(install_minimal_symbols): Update.
	(terminate_minimal_symbol_table): Update.
	(find_solib_trampoline_target): Update.
	(minimal_symbol_upper_bound): Update.
	* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
	* mips-tdep.c (mips_stub_frame_sniffer): Update.
	(mips_skip_pic_trampoline_code): Update.
	* msp430-tdep.c (msp430_skip_trampoline_code): Update.
	* objc-lang.c (selectors_info): Update.
	(classes_info): Update.
	(find_methods): Update.
	(find_imps): Update.
	(find_objc_msgsend): Update.
	* objfiles.c (objfile_relocate1): Update.
	* objfiles.h (ALL_OBJFILE_MSYMBOLS): Update.
	* obsd-tdep.c (obsd_skip_solib_resolver): Update.
	* p-valprint.c (pascal_val_print): Update.
	* parse.c (write_exp_msymbol): Update.
	* ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code)
	(ppc_linux_spe_context_lookup, ppc_elfv2_skip_entrypoint): Update.
	* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
	* printcmd.c (build_address_symbolic): Update.
	(sym_info): Update.
	(address_info): Update.
	* proc-service.c (ps_pglobal_lookup): Update.
	* psymtab.c (find_pc_sect_psymtab_closer): Update.
	(find_pc_sect_psymtab): Update.
	* python/py-framefilter.c (py_print_frame): Update.
	* ravenscar-thread.c (get_running_thread_id): Update.
	* record-btrace.c (btrace_call_history, btrace_get_bfun_name):
	Update.
	* remote.c (remote_check_symbols): Update.
	* rs6000-tdep.c (rs6000_skip_main_prologue): Update.
	(rs6000_skip_trampoline_code): Update.
	* sh64-tdep.c (sh64_elf_make_msymbol_special): Update.
	* sol2-tdep.c (sol2_skip_solib_resolver): Update.
	* solib-dsbt.c (lm_base): Update.
	* solib-frv.c (lm_base): Update.
	(main_got): Update.
	* solib-irix.c (locate_base): Update.
	* solib-som.c (som_solib_create_inferior_hook): Update.
	(som_solib_desire_dynamic_linker_symbols): Update.
	(link_map_start): Update.
	* solib-spu.c (spu_enable_break): Update.
	(ocl_enable_break): Update.
	* solib-svr4.c (elf_locate_base): Update.
	(enable_break): Update.
	* spu-tdep.c (spu_get_overlay_table): Update.
	(spu_catch_start): Update.
	(flush_ea_cache): Update.
	* stabsread.c (define_symbol): Update.
	(scan_file_globals): Update.
	* stack.c (find_frame_funname): Update.
	(frame_info): Update.
	* symfile.c (simple_read_overlay_table): Update.
	(simple_overlay_update): Update.
	* symmisc.c (dump_msymbols): Update.
	* symtab.c (fixup_section): Update.
	(find_pc_sect_line): Update.
	(skip_prologue_sal): Update.
	(search_symbols): Update.
	(print_msymbol_info): Update.
	(rbreak_command): Update.
	(MCOMPLETION_LIST_ADD_SYMBOL): New macro.
	(completion_list_objc_symbol): Update.
	(default_make_symbol_completion_list_break_on): Update.
	* tracepoint.c (scope_info): Update.
	* tui/tui-disasm.c (tui_find_disassembly_address): Update.
	(tui_get_begin_asm_address): Update.
	* valops.c (find_function_in_inferior): Update.
	* value.c (value_static_field): Update.
	(value_fn_field): Update.
2014-02-26 12:11:16 -07:00
Ulrich Weigand cc0e89c519 PowerPC64 ELFv2 ABI: structure passing / return
Another significant difference in the ELFv2 ABI is that "homogeneous"
floating-point and vector aggregates, i.e. aggregates the consist
(recursively) only of members of the same floating-point or vector type,
are passed in a series of floating-point / vector registers, as if they
were seperate parameters.  (This is similar to the ARM ABI.)  This
applies to both calls and returns.

In addition when returning any aggregate of up to 16 bytes, ELFv2 now
used general-purpose registers.

This patch adds support for these aspects of the ABI, which is relatively
straightforward after the refactoring patch to ppc-sysv-tdep.c.

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_aggregate_candidate): New routine.
	(ppc64_elfv2_abi_homogeneous_aggregate): Likewise.
	(ppc64_sysv_abi_push_param): Handle ELFv2 homogeneous structs.
	(ppc64_sysv_abi_return_value): Likewise.  Also, handle small
	structures returned in GPRs.
2014-02-04 18:42:35 +01:00
Ulrich Weigand 52f548e41f PowerPC64 ELFv2 ABI: stack frame layout changes
This implementes another change in ELFv2: the stack frame no longer
contains the reserved double words for linker and compiler use
(which weren't really used for much of anything anyway).  This
affects placement of on-stack parameters in inferior calls.

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct
	offset to the stack parameter list for the ELFv2 ABI.
2014-02-04 18:41:36 +01:00
Ulrich Weigand d4094b6a88 PowerPC64 ELFv2 ABI: no function descriptors
This implements the most significant difference with the ELFv2 ABI:
we no longer use function descriptors.  The patch consists mostly
of switching off code to deal with descriptors :-)

In addition, when calling an inferior function, we no longer need
to provide its TOC in r2.  Instead, ELFv2 code expects to be called
with r12 pointing to the code address itself.

gdb/ChangeLog:

	* ppc-linux-tdep.c (ppc_linux_init_abi): Only call
	set_gdbarch_convert_from_func_ptr_addr and
	set_gdbarch_elf_make_msymbol_special for ELFv1.
	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_param): Only handle
	function descriptors on ELFv1.
	(ppc64_sysv_abi_push_dummy_call): Likewise.  On ELFv2,
	set up r12 at function entry.
2014-02-04 18:40:16 +01:00
Ulrich Weigand 0ff3e01fdc PowerPC64 little-endian fixes: 128-bit DFP parameters / registers
The powerpc64le-linux ABI specifies that when a 128-bit DFP value is
passed in a pair of floating-point registers, the first register holds
the most-significant part of the value.  This is as opposed to the
usual rule on little-endian systems, where the first register would
hold the least-significant part.

This affects two places in GDB, the read/write routines for the
128-bit DFP pseudo-registers, and the function call / return
sequence.  For the former, current code already distinguishes
between big- and little-endian targets, but gets the latter
wrong.  This is presumably because *GCC* also got it wrong,
and GDB matches the old GCC behavior.  But GCC is now fixed:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02145.html
so GDB needs to be fixed too.  (Old code shouldn't really be
an issue since there is no code "out there" so far that uses
dfp128 on little-endian ...)

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct order
	within a register pair holding a DFP 128-bit value on little-endian.
	(ppc64_sysv_abi_return_value_base): Likewise.
	* rs6000-tdep.c (dfp_pseudo_register_read): Likewise.
	(dfp_pseudo_register_write): Likewise.

gdb/testsuite/ChangeLog:

	* gdb.arch/powerpc-d128-regs.exp: Enable on powerpc64*-*.
2014-02-04 18:36:54 +01:00
Ulrich Weigand 5b757e5ddb PowerPC64 little-endian fixes: 32-bit DFP parameters
Passing a 32-bit DFP in register needs to use the least-significant part
of the register.  Like with a previous patch that addressed the same
issue for small structs, this patch makes sure the appropriate offset
is used on little-endian systems.

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
	offset on little-endian when passing _Decimal32.
	(ppc64_sysv_abi_return_value_base): Likewise for return values.
2014-02-04 18:36:47 +01:00
Ulrich Weigand d63167affc PowerPC64 little-endian fixes: structure passing
When passing a small structure in a GPR, the ABI specifies that it
should be passed in the least-significant bytes of the register
(or stack slot).  On big-endian systems, this means the value
needs to be stored at an offset, which is what current code does.

However, on little-endian systems, the least-significant bytes are
addresses with offset 0.  This patch fixes that.

gdb/ChangeLog:

	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct
	offset on little-endian when passing small structures.
2014-02-04 18:26:26 +01:00
Ulrich Weigand e765b44c38 Refactor ppc64 function call and return value handling
This patch refactors the ppc64 function call and return value handling code
in ppc-sysv-tdep.c.  The main problem to be addressed by this refactoring
is the code duplication caused by certain aggregate types:

According to the ABI, some types are to be decomposed into component types
for parameter and return value handling.  For example, complex types are
to be passed as if the real and imaginary component were separate arguments.
Similarly, certain OpenCL vector types are passed as if they were multiple
separate arguments of the vector element type.  With the new ELFv2 ABI,
there is another case: "homogeneous aggregates" (e.g. a struct containing
4 floats) are passed in multiple floating point registers as well.

Unfortunately, the current code is not structured to easily model these
ABI properties.  For example, code to pass complex values re-implements
code to pass the underlying (floating-point) type.  This has already
led to some unfortunate code duplication, and with the addition of
ELFv2 ABI support, I would have had to add yet more such duplication.

To avoid that, I've decided to refactor the code in order to re-use
subroutines that handle the "base" types when handling those aggregate
types.  This was not intended to cause any difference on current
(ELFv1) ABI code, but in fact it fixes a bug:

FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4)

This was caused by the old code in ppc64_sysv_abi_push_float incorrectly
handling floating-point arguments to vararg routines, which just happens
to work out correctly automatically in the refactored code ...

gdb/ChangeLog:

	* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
	(struct ppc64_sysv_argpos): New data structure.
	(ppc64_sysv_abi_push_float): Remove.
	(ppc64_sysv_abi_push_val): New function.
	(ppc64_sysv_abi_push_integer): Likewise.
	(ppc64_sysv_abi_push_freg): Likewise.
	(ppc64_sysv_abi_push_vreg): Likewise.
	(ppc64_sysv_abi_push_param): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
	(ppc64_sysv_abi_return_value_base): New function.
	(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Tom Tromey 0e9f083f4c remove gdb_string.h
This removes gdb_string.h.  This patch is purely mechanical.  I
created it by running the two commands:

    git rm common/gdb_string.h
    perl -pi -e's/"gdb_string.h"/<string.h>/;'  *.[chyl] */*.[chyl]

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* common/gdb_string.h: Remove.
	* aarch64-tdep.c: Use string.h, not gdb_string.h.
	* ada-exp.y: Use string.h, not gdb_string.h.
	* ada-lang.c: Use string.h, not gdb_string.h.
	* ada-lex.l: Use string.h, not gdb_string.h.
	* ada-typeprint.c: Use string.h, not gdb_string.h.
	* ada-valprint.c: Use string.h, not gdb_string.h.
	* aix-thread.c: Use string.h, not gdb_string.h.
	* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
	* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
	* alpha-nat.c: Use string.h, not gdb_string.h.
	* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
	* alpha-tdep.c: Use string.h, not gdb_string.h.
	* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
	* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
	* amd64-linux-nat.c: Use string.h, not gdb_string.h.
	* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
	* amd64-nat.c: Use string.h, not gdb_string.h.
	* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
	* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
	* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
	* arch-utils.c: Use string.h, not gdb_string.h.
	* arm-linux-nat.c: Use string.h, not gdb_string.h.
	* arm-linux-tdep.c: Use string.h, not gdb_string.h.
	* arm-tdep.c: Use string.h, not gdb_string.h.
	* arm-wince-tdep.c: Use string.h, not gdb_string.h.
	* armbsd-tdep.c: Use string.h, not gdb_string.h.
	* armnbsd-nat.c: Use string.h, not gdb_string.h.
	* armnbsd-tdep.c: Use string.h, not gdb_string.h.
	* armobsd-tdep.c: Use string.h, not gdb_string.h.
	* avr-tdep.c: Use string.h, not gdb_string.h.
	* ax-gdb.c: Use string.h, not gdb_string.h.
	* ax-general.c: Use string.h, not gdb_string.h.
	* bcache.c: Use string.h, not gdb_string.h.
	* bfin-tdep.c: Use string.h, not gdb_string.h.
	* breakpoint.c: Use string.h, not gdb_string.h.
	* build-id.c: Use string.h, not gdb_string.h.
	* buildsym.c: Use string.h, not gdb_string.h.
	* c-exp.y: Use string.h, not gdb_string.h.
	* c-lang.c: Use string.h, not gdb_string.h.
	* c-typeprint.c: Use string.h, not gdb_string.h.
	* c-valprint.c: Use string.h, not gdb_string.h.
	* charset.c: Use string.h, not gdb_string.h.
	* cli-out.c: Use string.h, not gdb_string.h.
	* cli/cli-cmds.c: Use string.h, not gdb_string.h.
	* cli/cli-decode.c: Use string.h, not gdb_string.h.
	* cli/cli-dump.c: Use string.h, not gdb_string.h.
	* cli/cli-interp.c: Use string.h, not gdb_string.h.
	* cli/cli-logging.c: Use string.h, not gdb_string.h.
	* cli/cli-script.c: Use string.h, not gdb_string.h.
	* cli/cli-setshow.c: Use string.h, not gdb_string.h.
	* cli/cli-utils.c: Use string.h, not gdb_string.h.
	* coffread.c: Use string.h, not gdb_string.h.
	* common/common-utils.c: Use string.h, not gdb_string.h.
	* common/filestuff.c: Use string.h, not gdb_string.h.
	* common/linux-procfs.c: Use string.h, not gdb_string.h.
	* common/linux-ptrace.c: Use string.h, not gdb_string.h.
	* common/signals.c: Use string.h, not gdb_string.h.
	* common/vec.h: Use string.h, not gdb_string.h.
	* core-regset.c: Use string.h, not gdb_string.h.
	* corefile.c: Use string.h, not gdb_string.h.
	* corelow.c: Use string.h, not gdb_string.h.
	* cp-abi.c: Use string.h, not gdb_string.h.
	* cp-support.c: Use string.h, not gdb_string.h.
	* cp-valprint.c: Use string.h, not gdb_string.h.
	* cris-tdep.c: Use string.h, not gdb_string.h.
	* d-lang.c: Use string.h, not gdb_string.h.
	* dbxread.c: Use string.h, not gdb_string.h.
	* dcache.c: Use string.h, not gdb_string.h.
	* demangle.c: Use string.h, not gdb_string.h.
	* dicos-tdep.c: Use string.h, not gdb_string.h.
	* disasm.c: Use string.h, not gdb_string.h.
	* doublest.c: Use string.h, not gdb_string.h.
	* dsrec.c: Use string.h, not gdb_string.h.
	* dummy-frame.c: Use string.h, not gdb_string.h.
	* dwarf2-frame.c: Use string.h, not gdb_string.h.
	* dwarf2loc.c: Use string.h, not gdb_string.h.
	* dwarf2read.c: Use string.h, not gdb_string.h.
	* elfread.c: Use string.h, not gdb_string.h.
	* environ.c: Use string.h, not gdb_string.h.
	* eval.c: Use string.h, not gdb_string.h.
	* event-loop.c: Use string.h, not gdb_string.h.
	* exceptions.c: Use string.h, not gdb_string.h.
	* exec.c: Use string.h, not gdb_string.h.
	* expprint.c: Use string.h, not gdb_string.h.
	* f-exp.y: Use string.h, not gdb_string.h.
	* f-lang.c: Use string.h, not gdb_string.h.
	* f-typeprint.c: Use string.h, not gdb_string.h.
	* f-valprint.c: Use string.h, not gdb_string.h.
	* fbsd-nat.c: Use string.h, not gdb_string.h.
	* findcmd.c: Use string.h, not gdb_string.h.
	* findvar.c: Use string.h, not gdb_string.h.
	* fork-child.c: Use string.h, not gdb_string.h.
	* frame.c: Use string.h, not gdb_string.h.
	* frv-linux-tdep.c: Use string.h, not gdb_string.h.
	* frv-tdep.c: Use string.h, not gdb_string.h.
	* gdb.c: Use string.h, not gdb_string.h.
	* gdb_bfd.c: Use string.h, not gdb_string.h.
	* gdbarch.c: Use string.h, not gdb_string.h.
	* gdbtypes.c: Use string.h, not gdb_string.h.
	* gnu-nat.c: Use string.h, not gdb_string.h.
	* gnu-v2-abi.c: Use string.h, not gdb_string.h.
	* gnu-v3-abi.c: Use string.h, not gdb_string.h.
	* go-exp.y: Use string.h, not gdb_string.h.
	* go-lang.c: Use string.h, not gdb_string.h.
	* go32-nat.c: Use string.h, not gdb_string.h.
	* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
	* hppa-linux-nat.c: Use string.h, not gdb_string.h.
	* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
	* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
	* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
	* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
	* i386-linux-nat.c: Use string.h, not gdb_string.h.
	* i386-linux-tdep.c: Use string.h, not gdb_string.h.
	* i386-nto-tdep.c: Use string.h, not gdb_string.h.
	* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
	* i386-tdep.c: Use string.h, not gdb_string.h.
	* i386bsd-tdep.c: Use string.h, not gdb_string.h.
	* i386gnu-nat.c: Use string.h, not gdb_string.h.
	* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
	* i386obsd-tdep.c: Use string.h, not gdb_string.h.
	* i387-tdep.c: Use string.h, not gdb_string.h.
	* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
	* ia64-linux-nat.c: Use string.h, not gdb_string.h.
	* inf-child.c: Use string.h, not gdb_string.h.
	* inf-ptrace.c: Use string.h, not gdb_string.h.
	* inf-ttrace.c: Use string.h, not gdb_string.h.
	* infcall.c: Use string.h, not gdb_string.h.
	* infcmd.c: Use string.h, not gdb_string.h.
	* inflow.c: Use string.h, not gdb_string.h.
	* infrun.c: Use string.h, not gdb_string.h.
	* interps.c: Use string.h, not gdb_string.h.
	* iq2000-tdep.c: Use string.h, not gdb_string.h.
	* irix5-nat.c: Use string.h, not gdb_string.h.
	* jv-exp.y: Use string.h, not gdb_string.h.
	* jv-lang.c: Use string.h, not gdb_string.h.
	* jv-typeprint.c: Use string.h, not gdb_string.h.
	* jv-valprint.c: Use string.h, not gdb_string.h.
	* language.c: Use string.h, not gdb_string.h.
	* linux-fork.c: Use string.h, not gdb_string.h.
	* linux-nat.c: Use string.h, not gdb_string.h.
	* lm32-tdep.c: Use string.h, not gdb_string.h.
	* m2-exp.y: Use string.h, not gdb_string.h.
	* m2-typeprint.c: Use string.h, not gdb_string.h.
	* m32c-tdep.c: Use string.h, not gdb_string.h.
	* m32r-linux-nat.c: Use string.h, not gdb_string.h.
	* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
	* m32r-rom.c: Use string.h, not gdb_string.h.
	* m32r-tdep.c: Use string.h, not gdb_string.h.
	* m68hc11-tdep.c: Use string.h, not gdb_string.h.
	* m68k-tdep.c: Use string.h, not gdb_string.h.
	* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
	* m68klinux-nat.c: Use string.h, not gdb_string.h.
	* m68klinux-tdep.c: Use string.h, not gdb_string.h.
	* m88k-tdep.c: Use string.h, not gdb_string.h.
	* macrocmd.c: Use string.h, not gdb_string.h.
	* main.c: Use string.h, not gdb_string.h.
	* mdebugread.c: Use string.h, not gdb_string.h.
	* mem-break.c: Use string.h, not gdb_string.h.
	* memattr.c: Use string.h, not gdb_string.h.
	* memory-map.c: Use string.h, not gdb_string.h.
	* mep-tdep.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
	* mi/mi-cmds.c: Use string.h, not gdb_string.h.
	* mi/mi-console.c: Use string.h, not gdb_string.h.
	* mi/mi-getopt.c: Use string.h, not gdb_string.h.
	* mi/mi-interp.c: Use string.h, not gdb_string.h.
	* mi/mi-main.c: Use string.h, not gdb_string.h.
	* mi/mi-parse.c: Use string.h, not gdb_string.h.
	* microblaze-rom.c: Use string.h, not gdb_string.h.
	* microblaze-tdep.c: Use string.h, not gdb_string.h.
	* mingw-hdep.c: Use string.h, not gdb_string.h.
	* minidebug.c: Use string.h, not gdb_string.h.
	* minsyms.c: Use string.h, not gdb_string.h.
	* mips-irix-tdep.c: Use string.h, not gdb_string.h.
	* mips-linux-tdep.c: Use string.h, not gdb_string.h.
	* mips-tdep.c: Use string.h, not gdb_string.h.
	* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
	* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
	* mipsread.c: Use string.h, not gdb_string.h.
	* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
	* mn10300-tdep.c: Use string.h, not gdb_string.h.
	* monitor.c: Use string.h, not gdb_string.h.
	* moxie-tdep.c: Use string.h, not gdb_string.h.
	* mt-tdep.c: Use string.h, not gdb_string.h.
	* nbsd-tdep.c: Use string.h, not gdb_string.h.
	* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
	* nto-procfs.c: Use string.h, not gdb_string.h.
	* nto-tdep.c: Use string.h, not gdb_string.h.
	* objc-lang.c: Use string.h, not gdb_string.h.
	* objfiles.c: Use string.h, not gdb_string.h.
	* opencl-lang.c: Use string.h, not gdb_string.h.
	* osabi.c: Use string.h, not gdb_string.h.
	* osdata.c: Use string.h, not gdb_string.h.
	* p-exp.y: Use string.h, not gdb_string.h.
	* p-lang.c: Use string.h, not gdb_string.h.
	* p-typeprint.c: Use string.h, not gdb_string.h.
	* parse.c: Use string.h, not gdb_string.h.
	* posix-hdep.c: Use string.h, not gdb_string.h.
	* ppc-linux-nat.c: Use string.h, not gdb_string.h.
	* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
	* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
	* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
	* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
	* printcmd.c: Use string.h, not gdb_string.h.
	* procfs.c: Use string.h, not gdb_string.h.
	* prologue-value.c: Use string.h, not gdb_string.h.
	* python/py-auto-load.c: Use string.h, not gdb_string.h.
	* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
	* ravenscar-thread.c: Use string.h, not gdb_string.h.
	* regcache.c: Use string.h, not gdb_string.h.
	* registry.c: Use string.h, not gdb_string.h.
	* remote-fileio.c: Use string.h, not gdb_string.h.
	* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
	* remote-mips.c: Use string.h, not gdb_string.h.
	* remote-sim.c: Use string.h, not gdb_string.h.
	* remote.c: Use string.h, not gdb_string.h.
	* reverse.c: Use string.h, not gdb_string.h.
	* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
	* ser-base.c: Use string.h, not gdb_string.h.
	* ser-go32.c: Use string.h, not gdb_string.h.
	* ser-mingw.c: Use string.h, not gdb_string.h.
	* ser-pipe.c: Use string.h, not gdb_string.h.
	* ser-tcp.c: Use string.h, not gdb_string.h.
	* ser-unix.c: Use string.h, not gdb_string.h.
	* serial.c: Use string.h, not gdb_string.h.
	* sh-tdep.c: Use string.h, not gdb_string.h.
	* sh64-tdep.c: Use string.h, not gdb_string.h.
	* shnbsd-tdep.c: Use string.h, not gdb_string.h.
	* skip.c: Use string.h, not gdb_string.h.
	* sol-thread.c: Use string.h, not gdb_string.h.
	* solib-dsbt.c: Use string.h, not gdb_string.h.
	* solib-frv.c: Use string.h, not gdb_string.h.
	* solib-osf.c: Use string.h, not gdb_string.h.
	* solib-spu.c: Use string.h, not gdb_string.h.
	* solib-target.c: Use string.h, not gdb_string.h.
	* solib.c: Use string.h, not gdb_string.h.
	* somread.c: Use string.h, not gdb_string.h.
	* source.c: Use string.h, not gdb_string.h.
	* sparc-nat.c: Use string.h, not gdb_string.h.
	* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
	* sparc-tdep.c: Use string.h, not gdb_string.h.
	* sparc64-tdep.c: Use string.h, not gdb_string.h.
	* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
	* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
	* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
	* spu-linux-nat.c: Use string.h, not gdb_string.h.
	* spu-multiarch.c: Use string.h, not gdb_string.h.
	* spu-tdep.c: Use string.h, not gdb_string.h.
	* stabsread.c: Use string.h, not gdb_string.h.
	* stack.c: Use string.h, not gdb_string.h.
	* std-regs.c: Use string.h, not gdb_string.h.
	* symfile.c: Use string.h, not gdb_string.h.
	* symmisc.c: Use string.h, not gdb_string.h.
	* symtab.c: Use string.h, not gdb_string.h.
	* target.c: Use string.h, not gdb_string.h.
	* thread.c: Use string.h, not gdb_string.h.
	* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
	* tilegx-tdep.c: Use string.h, not gdb_string.h.
	* top.c: Use string.h, not gdb_string.h.
	* tracepoint.c: Use string.h, not gdb_string.h.
	* tui/tui-command.c: Use string.h, not gdb_string.h.
	* tui/tui-data.c: Use string.h, not gdb_string.h.
	* tui/tui-disasm.c: Use string.h, not gdb_string.h.
	* tui/tui-file.c: Use string.h, not gdb_string.h.
	* tui/tui-layout.c: Use string.h, not gdb_string.h.
	* tui/tui-out.c: Use string.h, not gdb_string.h.
	* tui/tui-regs.c: Use string.h, not gdb_string.h.
	* tui/tui-source.c: Use string.h, not gdb_string.h.
	* tui/tui-stack.c: Use string.h, not gdb_string.h.
	* tui/tui-win.c: Use string.h, not gdb_string.h.
	* tui/tui-windata.c: Use string.h, not gdb_string.h.
	* tui/tui-winsource.c: Use string.h, not gdb_string.h.
	* typeprint.c: Use string.h, not gdb_string.h.
	* ui-file.c: Use string.h, not gdb_string.h.
	* ui-out.c: Use string.h, not gdb_string.h.
	* user-regs.c: Use string.h, not gdb_string.h.
	* utils.c: Use string.h, not gdb_string.h.
	* v850-tdep.c: Use string.h, not gdb_string.h.
	* valarith.c: Use string.h, not gdb_string.h.
	* valops.c: Use string.h, not gdb_string.h.
	* valprint.c: Use string.h, not gdb_string.h.
	* value.c: Use string.h, not gdb_string.h.
	* varobj.c: Use string.h, not gdb_string.h.
	* vax-tdep.c: Use string.h, not gdb_string.h.
	* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
	* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
	* windows-nat.c: Use string.h, not gdb_string.h.
	* xcoffread.c: Use string.h, not gdb_string.h.
	* xml-support.c: Use string.h, not gdb_string.h.
	* xstormy16-tdep.c: Use string.h, not gdb_string.h.
	* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
2013-11-18 13:29:00 -07:00
Tom Tromey 7cbd4a934e * minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove objfile argument.
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	* minsyms.c (lookup_minimal_symbol_by_pc_1)
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	(in_gnu_ifunc_stub): Update.
	(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove 'objfile_p' argument.
	(lookup_solib_trampoline_symbol_by_pc): Update.
	* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
	arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
	c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
	glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
	i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
	linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
	mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
	ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
	stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 19:59:09 +00:00
Tiago Daitx d81e75c075 gdb/ChangeLog
2013-03-01  Tiago Stürmer Daitx  <tdaitx@linux.vnet.ibm.com>

	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_float): New function.
	(ppc64_sysv_abi_push_dummy_call): Handle complex arguments.
2013-04-01 04:05:35 +00:00
Sergio Durigan Junior 55a7840102 2013-01-23 Tiago Stürmer Daitx <tdaitx@linux.vnet.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Set correct
	type on float conversion for complex type.
2013-01-23 20:03:18 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
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.
2013-01-01 06:33:28 +00:00
Sergio Durigan Junior 22e048c9dd 2012-05-18 Sergio Durigan Junior <sergiodj@redhat.com>
* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c:
	* avr-tdep.c:
	* ax-gdb.c:
	* bfin-linux-tdep.c:
	* breakpoint.c:
	* c-valprint.c:
	* cli/cli-cmds.c:
	* coffread.c:
	* cp-support.c:
	* cris-tdep.c:
	* dwarf2-frame-tailcall.c:
	* dwarf2-frame.c:
	* dwarf2expr.c:
	* dwarf2loc.c:
	* dwarf2read.c:
	* elfread.c:
	* eval.c:
	* expprint.c:
	* f-valprint.c:
	* frv-tdep.c:
	* h8300-tdep.c:
	* hppa-hpux-tdep.c:
	* hppa-tdep.c:
	* hppanbsd-tdep.c:
	* i386-nto-tdep.c:
	* i386-tdep.c:
	* i387-tdep.c:
	* ia64-tdep.c:
	* jit.c:
	* linespec.c:
	* linux-tdep.c:
	* lm32-tdep.c:
	* m2-valprint.c:
	* m32c-tdep.c:
	* m32r-rom.c:
	* m32r-tdep.c:
	* m68k-tdep.c:
	* m68klinux-tdep.c:
	* mi/mi-main.c:
	* microblaze-tdep.c:
	* mips-linux-tdep.c:
	* mips-tdep.c:
	* mn10300-tdep.c:
	* p-valprint.c:
	* parse.c:
	* ppc-linux-tdep.c:
	* ppc-sysv-tdep.c:
	* printcmd.c:
	* python/py-finishbreakpoint.c:
	* python/py-inferior.c:
	* python/py-infthread.c:
	* python/py-type.c:
	* python/python.c:
	* remote-fileio.c:
	* remote-m32r-sdi.c:
	* remote-mips.c:
	* reverse.c:
	* rl78-tdep.c:
	* rs6000-aix-tdep.c:
	* rs6000-tdep.c:
	* s390-tdep.c:
	* score-tdep.c:
	* sh64-tdep.c:
	* skip.c:
	* solib-darwin.c:
	* solib-dsbt.c:
	* solib-frv.c:
	* sparc-tdep.c:
	* spu-multiarch.c:
	* spu-tdep.c:
	* stack.c:
	* symfile.c:
	* symtab.c:
	* tic6x-tdep.c:
	* tracepoint.c:
	* v850-tdep.c:
	* valarith.c:
	* valprint.c:
	* value.c:
	* xcoffread.c:
	* xtensa-tdep.c:
	* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c: Delete unused variables.
2012-05-18 21:02:52 +00:00
Maciej W. Rozycki 6a3a010ba6 gdb/
* breakpoint.h (bp_location): Add related_address member.
	* inferior.h (get_return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	* value.h (using_struct_return): Likewise.
	* gdbarch.sh (return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	* breakpoint.c (set_breakpoint_location_function): Initialize
	related_address for bp_gnu_ifunc_resolver breakpoints.
	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Pass the
	requested function's address to gdbarch_return_value.
	* eval.c (evaluate_subexp_standard): Pass the requested
	function's address to using_struct_return.
	* infcall.c (call_function_by_hand): Pass the requested
	function's address to using_struct_return and
	gdbarch_return_value.
	* infcmd.c (get_return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	(print_return_value): Update accordingly.
	(finish_command_continuation): Likewise.
	* stack.c (return_command): Pass the requested function's
	address to using_struct_return and gdbarch_return_value.
	* value.c (using_struct_return): Take a pointer to struct value
	instead of struct type for the function requested.  Pass the
	requested function's address to gdbarch_return_value.
	* python/py-finishbreakpoint.c (finish_breakpoint_object):
	New function_value member, replacing function_type.
	(bpfinishpy_dealloc): Update accordingly.
	(bpfinishpy_pre_stop_hook): Likewise.
	(bpfinishpy_init): Likewise.  Record the requested function's
	address.
	* mips-tdep.c (mips_fval_reg): New enum.
	(mips_o32_push_dummy_call): For MIPS16 FP doubles do not swap
	words put in GP registers.
	(mips_o64_push_dummy_call): Update a comment.
	(mips_o32_return_value): Take a pointer to struct value instead
	of struct type for the function requested and use it to check if
	using the MIPS16 calling convention.  Return the designated
	general purpose registers for floating-point values returned in
	MIPS16 mode.
	(mips_o64_return_value): Likewise.
	* ppc-tdep.h (ppc_sysv_abi_return_value): Update prototype.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
	* alpha-tdep.c (alpha_return_value): Take a pointer to struct
	value instead of struct type for the function requested.
	* amd64-tdep.c (amd64_return_value): Likewise.
	* amd64-windows-tdep.c (amd64_windows_return_value): Likewise.
	* arm-tdep.c (arm_return_value): Likewise.
	* avr-tdep.c (avr_return_value): Likewise.
	* bfin-tdep.c (bfin_return_value): Likewise.
	* cris-tdep.c (cris_return_value): Likewise.
	* frv-tdep.c (frv_return_value): Likewise.
	* h8300-tdep.c (h8300_return_value): Likewise.
	(h8300h_return_value): Likewise.
	* hppa-tdep.c (hppa32_return_value): Likewise.
	(hppa64_return_value): Likewise.
	* i386-tdep.c (i386_return_value): Likewise.
	* ia64-tdep.c (ia64_return_value): Likewise.
	* iq2000-tdep.c (iq2000_return_value): Likewise.
	* lm32-tdep.c (lm32_return_value): Likewise.
	* m32c-tdep.c (m32c_return_value): Likewise.
	* m32r-tdep.c (m32r_return_value): Likewise.
	* m68hc11-tdep.c (m68hc11_return_value): Likewise.
	* m68k-tdep.c (m68k_return_value): Likewise.
	(m68k_svr4_return_value): Likewise.
	* m88k-tdep.c (m88k_return_value): Likewise.
	* mep-tdep.c (mep_return_value): Likewise.
	* microblaze-tdep.c (microblaze_return_value): Likewise.
	* mn10300-tdep.c (mn10300_return_value): Likewise.
	* moxie-tdep.c (moxie_return_value): Likewise.
	* mt-tdep.c (mt_return_value): Likewise.
	* ppc-linux-tdep.c (ppc_linux_return_value): Likewise.
	* ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Likewise.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
	* ppcnbsd-tdep.c (ppcnbsd_return_value): Likewise.
	* rl78-tdep.c (rl78_return_value): Likewise.
	* rs6000-aix-tdep.c (rs6000_return_value): Likewise.
	* rx-tdep.c (rx_return_value): Likewise.
	* s390-tdep.c (s390_return_value): Likewise.
	* score-tdep.c (score_return_value): Likewise.
	* sh-tdep.c (sh_return_value_nofpu): Likewise.
	(sh_return_value_fpu): Likewise.
	* sh64-tdep.c (sh64_return_value): Likewise.
	* sparc-tdep.c (sparc32_return_value): Likewise.
	* sparc64-tdep.c (sparc64_return_value): Likewise.
	* spu-tdep.c (spu_return_value): Likewise.
	* tic6x-tdep.c (tic6x_return_value): Likewise.
	* v850-tdep.c (v850_return_value): Likewise.
	* vax-tdep.c (vax_return_value): Likewise.
	* xstormy16-tdep.c (xstormy16_return_value): Likewise.
	* xtensa-tdep.c (xtensa_return_value): Likewise.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.

	gdb/testsuite/
	* gdb.base/return-nodebug.exp: Also test float and double types.
2012-05-16 14:35:09 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Ulrich Weigand 88aed45eb4 * ppc-sysv-tdep.c (ppc_sysv_use_opencl_abi): New function.
(ppc_sysv_abi_push_dummy_call): Use it.
	(do_ppc_sysv_return_value): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
2011-10-26 17:21:53 +00:00
Joel Brobecker 2b5b9d09ed [powerpc] crash trying to allocate memory in inferior
Our testsuite noticed a crash when trying to call a function which
requires GDB to allocate memory in the inferior. Typically, this
happens when one of the parameters is a string.  For instance, our
testcase tries:

    (gdb) call debug.trace (me, "You")
    [1]    32737 segmentation fault /path/to/gdb

What happens is that GDB sees the string, and thus tries to allocate
memory for it in the inferior:

> /* Allocate NBYTES of space in the inferior using the inferior's
>    malloc and return a value that is a pointer to the allocated
>    space.  */
>
> struct value *
> value_allocate_space_in_inferior (int len)
> {
>   struct objfile *objf;
>   struct value *val = find_function_in_inferior ("malloc", &objf);

And find_function_in_inferior first searches the symtab in case
we have debug info.  But, in our case (bareboard powerpc), we don't,
so it gets "malloc"'s address from the minimal symbols, and builds
a value whose type is a TYPE_CODE_PTR, not a TYPE_CODE_FUNC.

As a result, when we later try to make the call to malloc, we end up
inside the powerpc tdep code that has:

> do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
[...]
>   if (func_type
>       && TYPE_CALLING_CONVENTION (func_type) == DW_CC_GDB_IBM_OpenCL)

The problem is that func_type is not a TYPE_CODE_FUNC, and thus
the type-specific kind is not TYPE_SPECIFIC_FUNC, and so we do
TYPE_CALLING_CONVENTION is an invalid access.

Interestingly, the other call to TYPE_CALLING_CONVENTION is correctly
preceded by a check of the type's TYPE_CODE (making sure that it is
TYPE_CODE_FUNC).

gdb/ChangeLog:

        * ppc-sysv-tdep.c (do_ppc_sysv_return_value): Do not check
        FUNC_TYPE's calling convention if FUNC_TYPE is not a function.
2011-10-24 16:51:36 +00:00
Ulrich Weigand 24e9cda068 gdb/
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Add support
	for the "generic" vector ABI used with GCC 4.3 and later.
	(ppc64_sysv_abi_return_value): Likewise.

gdb/testsuite:
	* gdb.arch/altivec-abi.exp: Skip "generic" tests on 64-bit when
	using a GCC 4.1 or 4.2 compiler.  Add an additional test variant
	"generic ABI, auto".
	(altivec_abi_tests): Accept vectors returned by reference.
2011-03-15 14:42:34 +00:00
Ulrich Weigand 54fcddd0ac include/ChangeLog:
* dwarf2.h (enum dwarf_calling_convention): Add DW_CC_GDB_IBM_OpenCL.

gdb/ChangeLog:

	* dwarf2read.c (read_subroutine_type): Set special calling
	convention flag for functions compiled by IBM XL C for OpenCL.
	* ppc-sysv-tdep.c: Include "dwarf2.h"
	(ppc_sysv_abi_push_dummy_call): Implement IBM OpenCL vector types
	calling convention.
	(do_ppc_sysv_return_value): Add FUNC_TYPE argument.  Implement
	IBM OpenCL vector types calling convention.
	(ppc_sysv_abi_return_value): Pass through FUNC_TYPE.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Implement IBM OpenCL vector
	types calling convention.
	(ppc64_sysv_abi_return_value): Likewise.
	* spu-tdep.c: Include "dwarf2.h"
	(spu_return_value): Implement IBM OpenCL vector types calling
	convention.

gdb/testsuite/ChangeLog:

	* gdb.opencl/callfuncs.cl: New file.
	* gdb.opencl/callfuncs.exp: New test.
	* gdb.opencl/Makefile.in (EXECUTABLES): Add callfuncs.
2011-02-08 13:30:10 +00:00
Ulrich Weigand d6dafb7c8e ChangeLog:
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Implement
	correct ABI for AltiVec vector arguments.

testsuite/ChangeLog:

	* gdb.arch/altivec-abi.c (vec_func): Make use of intv_on_stack_f
	when computing result.
	* gdb.arch/altivec-abi.exp: Update expected results.
2011-02-08 13:25:01 +00:00