i386_store_return_value): Add gdbarch argument. Use it instead of
determining it from REGCACHE. Remove recursive call for
structures with a single member.
(i386_use_struct_convention): Remove.
(i386_reg_struct_return_p): New function.
(i386_return_value): New function.
(i386_gdbarch_init): Set return_value, don't set
extract_return_value, store_return_value and
use_struct_convention.
* x86-64-tdep.c (x86_64_init_abi): Set return_value to NULL.
gregset_reg_offset, gregset_num_regs, sizeof_gregset, fpregset,
sizeof_fpregset.
* i386-tdep.c: Include "regset.h".
(i386_supply_gregset): New function.
(i386_supply_fpregset): New function.
(i386_gdbarch_init): Initialze register set-related members of
TDEP.
* x86-64-tdep.c (x86_64_supply_fpregset): New function.
(x86_64_init_abi): Initialize TDEP->sizeof_fpregset.
order. Remove spurious whitespace.
(struct gdbarch_tdep): add st0_regnum and mm0_regnum members.
(i386_sse_regnum_p, i386_mxcsr_regnum_p): Remove prototypes.
* i386-tdep.c (MM0_REGNUM): Remove define.
(i386_mmx_regnum_p): Add gdbarch argument.
(i386_sse_regnum_p, i386_mxcsr_regnum_p): Add gdbarch argument.
Rewrite using new macro definitions for FPU/SSE registers.
(i386_fp_regnum_p, i386_fpc_regnum_p): Rewrite using new macro
definitions from i387-tdep.h.
(i386_register_name): Update.
(i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Update to use
new macro definitions for FPU/SSE registers.
(i386_extract_return_value): Determine whether floating-point
registers are present by examining REGCACHE's architecture.
(i386_store_return_value): Likewise. Use I386_MAX_REGISTER_SIZE
instead of FPU_REG_RAW_SIZE. Use new macro definitions for
FPU/SSE registers.
(i386_register_type): Update.
(i386_mmx_regnum_to_fp_regnum): Rewrite using new macro
definitions for FPU registers. Use REGCACHE's architecture to
determine the appropriate register numbers.
(i386_pseudo_register_read, i386_pseudo_register_write,
i386_register_reggroup_p): Update.
(i386_gdbarch_init): Initialize TDEP->st0_regnum and
TDEP->mm0_regnum.
* i387-tdep.h (I387_FCTRL_REGNUM, I387_FSTAT_REGNUM,
I387_FTAG_REGNUM, I387_FISEG_REGNUM, I387_FIOFF_REGNUM,
I387_FOSEG_REGNUM, I387_FOOFF_REGNUM, I387_FOP_REGNUM,
I387_XMM0_REGNUM, I387_MXCSR_REGNUM): New defines.
(i387_supply_fsave, i387_fill_fsave, i387_supply_fxsave,
i387_fill_fxsave): Change type of fsave/fxsave argument from `char
*' to `void *'.
* i387-tdep.c (i387_print_float_info, fsave_offset, FSAVE_ADDR,
i387_supply_fsave, i387_fill_fsave, fxsave_offset, FXSAVE_ADDR,
i387_supply_fxsave, i387_fill_fxsave): Update to use new macro
definitions for FPU/SSE registers.
(FXSAVE_MXCSR_ADDR): New define.
* x86-64-tdep.c (x86_64_init_abi): Override TDEP->st0_regnum and
TDEP->mm0_regnum.
(I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Remove defines.
(I387_ST0_REGNUM): Define.
instead of frame_read_register.
(i386_fetch_pointer_argument): Use get_frame_register_unsigned
instead of frame_read_register. Use I386_ESP_REGNUM instead of
SP_REGNUM.
(i386_frame_prev_register): Use frame_unwind_register_unsigned
instead of frame_unwind_unsigned_register. Use
I386_EFLAGS_REGISTER instead of PS_REGNUM.
(i386_get_longjmp_target): Use regcache_read_unsigned_register
instead of read_register. Use builtin_type_void_data_ptr instead
of builtin_type_void_func_ptr when extracting the address of the
jmp_buf.
(i386_extract_return_value, i386_store_return_value,
i386_pseudo_register_read, i386_pseudo_register_write): Use
register_size instead REGISTER_RAW_SIZE.
(i387_print_float_info): Use get_frame_register and
get_frame_register_unsigned instead of frame_register_read.
* gdbarch.sh (DWARF2_BUILD_FRAME_INFO): Delete method.
* gdbarch.h, gdbarch.c: Re-generate.
* i386-tdep.c (i386_gdbarch_init): Do not set
DWARF2_BUILD_FRAME_INFO.
* elfread.c (elf_symfile_read): Call dwarf2_build_frame_info
unconditionally.
* alpha-tdep.c (alpha_dwarf2_init_abi): Do not set
DWARF2_BUILD_FRAME_INFO.
* trad-frame.h: Update comments, a -1 .addr is reserved.
(trad_frame_value_p, trad_frame_addr_p): Declare.
(trad_frame_reg_p): Declare.
(trad_frame_set_value): Rename trad_frame_register_value.
(trad_frame_set_unknown): Declare.
* trad-frame.c (trad_frame_realreg_p): New function.
(trad_frame_addr_p, trad_frame_value_p): New function.
(trad_frame_set_unknown): New function.
(trad_frame_alloc_saved_regs): Initialize .addr to -1, not zero.
(trad_frame_prev_register): Use trad_frame_realreg_p,
trad_frame_addr_p and trad_frame_value_p.
(trad_frame_set_value): Rename trad_frame_register_value.
* d10v-tdep.c (d10v_frame_unwind_cache): Use trad_frame_addr_p
and trad_frame_set_value.
Move floating-point code to new function in i387-tdep.c.
* i387-tdep.c (i387_register_to_value, i387_value_to_register):
New functions containing code moved here from i386-tdep.c.
* i387-tdep.h: Add opaque declaration for `struct type'.
(i387_register_to_value, i387_value_to_register): New prototypes.
* x86-64-tdep.c (x86_64_convert_register_p): New function.
(x86_64_init_abi): Set convert_register_p, register_to_value and
value_to_register here.
Mark Kettenis <kettenis@gnu.org>
* gdbarch.sh (CONVERT_REGISTER_P): Add "type" parameter.
(REGISTER_TO_VALUE, VALUE_TO_REGISTER): Replace raw buffer
parameter with "frame".
* gdbarch.h, gdbarch.c: Re-generate.
* frame.h (put_frame_register): Declare.
* frame.c (put_frame_register): New function.
* arch-utils.c (legacy_convert_register_p): Add "type" parameter.
(legacy_register_to_value): Rewrite, use "frame" to get the
register value.
(legacy_value_to_register): Rewrite, use "frame" to find the
register's location before storing.
* arch-utils.h (legacy_convert_register_p): Update.
(legacy_register_to_value, legacy_value_to_register): Update.
* findvar.c (value_from_register): Rewrite, eliminate use of
REGISTER_CONVERT_TO_TYPE, pass "type" to CONVERT_REGISTER_P, pass
"frame" to REGISTER_TO_VALUE.
* valops.c (value_assign): Move the CONVERT_REGISTER code to the
lval_reg_frame_relative + lval_register branch of the switch. Do
not use REGISTER_CONVERT_FROM_TYPE. Use put_frame_register.
* i386-tdep.c (I386_EBX_REGNUM, I386_ECX_REGNUM, I386_ESI_REGNUM,
I386_EDI_REGNUM): New defines.
(i386_next_regnum, i386_convert_register_p,
i386_register_to_value, i386_value_to_register): New functions.
(i386_register_convertible, i386_register_convert_to_virtual,
i386_convert_to_raw): Remove functions.
(i386_gdbarch_init): Set convert_register_p, register_to_value and
value_to_register instead of register_convertible,
register_convert_to_virtual and register_convert_to_raw.
* mips-tdep.c (mips_convert_register_p): New function.
(mips_value_to_register): Replace mips_register_convert_from_type.
(mips_register_to_value): Replace mips_register_convert_to_type.
(mips_gdbarch_init): Set conver_register_p, value_to_register and
register_to_value.
* alpha-tdep.c (alpha_convert_register_p): Update.
(alpha_value_to_register): Update, store the register.
(alpha_register_to_value): Update, fetch the register.
* infcall.c (call_function_by_hand): When UNWIND_DUMMY_ID is
available, do not use the FP register, and always save the TOS.
* dummy-frame.c (dummy_frame_this_id): Do not assert
SAVE_DUMMY_FRAME_TOS.
* i386-tdep.c (i386_save_dummy_frame_tos): Delete function.
(i386_gdbarch_init): Do not set save_dummy_frame_tos.
(i386_push_dummy_call): Add 8 to the returned SP.
* frame.c (legacy_frame_p): Do not require SAVE_DUMMY_FRAME_TOS.
* d10v-tdep.c (d10v_unwind_dummy_id): Use d10v_unwind_sp.
(d10v_gdbarch_init): Do not set save_dummy_frame_tos.
* x86-64-tdep.c (x86_64_save_dummy_frame_tos): Delete function.
(x86_64_push_dummy_call): Return "sp + 16".
(x86_64_init_abi): Do not set save_dummy_frame_tos.
* alpha-tdep.c (alpha_gdbarch_init): Do not set
save_dummy_frame_tos.
* gdbarch.[ch]: Regenerate.
* hppa-tdep.c (hppa_fetch_pointer_argument): New function.
(hppa_gdbarch_init): Set it in the gdbarch vector.
* i386-tdep.c (i386_fetch_pointer_argument): New
(i386_gdbarch_init): Set it into gdbarch.
* rs6000-tdep.c (rs6000_fetch_pointer_argument): New.
(rs6000_gdbarch_init): Set it in gdbarch.
* sparc-tdep.c (sparc_fetch_pointer_argument): New
(sparc_gdbarch_init): Set it in gdbarch.
* i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset'
and `sc_num_regs'.
(I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM,
I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM,
I386_ST0_REGNUM): Move here from...
* i386-tdep.c: ... here.
(I386_NUM_SAVED_REGS): Define to I386_NUM_REGS.
(i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved
registers if possible.
(i386_gdbarch_init): Initialize TDEP->sc_reg_offset.
* i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset):
Remove variables.
(i386bsd_sc_reg_offset): New variable.
(i386bsd_init_abi): Initialize TDEP->sc_reg_offset and
TDEP->sc_num_regs instead of TDEP->sc_pc_offset and
TDEP->sc_sp_offset.
(i386fbsd_sc_reg_offset): New variable.
(i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and
TDEP->sc_num_regs.
(i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove
variables.
(i386fbsd4_sc_reg_offset): New variable.
(i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and
TDEP->sc_num_regs instead of TDEP->sc_pc_offset and
TDEP->sc_sp_offset.
* i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable.
(i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs.
* i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset):
Remove variables.
(i386nbsd_sc_reg_offset): New variable.
(i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and
TDEP->sc_num_regs instead of TDEP->sc_pc_offset and
TDEP->sc_sp_offset.
* i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset):
Remove variables.
(i386obsd_sc_reg_offset): New variable.
(i386obsd_init_abi): Initialize TDEP->sc_reg_offset and
TDEP->sc_num_regs instead of TDEP->sc_pc_offset and
TDEP->sc_sp_offset.
* i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in
i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check
for frame pointer offset in `struct sigcontext'.
(I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove
defenitions.
(IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions.
* i386-tdep.c: Mark functions that are 64-bit safe as such.
(I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM,
I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM,
I386_ST0_REGNUM): New defines.
(CODESTREAM_BUFSIZ, codestream_tell, codestream_peek,
codestream_get): Remove define.
(codestream_next_addr, condestream_addr, condestream_buf,
codestream_off, codestream_cnt): Remove variables.
(codestream_fill, codestream_seek, codestream_read): Remove
functions.
(i386_follow_jump): Rewrite to avoid usage of removed codestream
functionality.
(i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain,
i386_sigtramp_saved_pc, i386_sigtramp_saved_sp,
i386_frame_saved_pc, i386_saved_pc_after_call,
i386_frame_num_args, i386_frame_init_saved_regs,
i386_push_return_address, i386_do_pop_frame, i386_pop_frame,
i386_push_arguments): Remove functions.
(i386_skip_prologue): Rewrite to avoid usage of removed codestream
functionality. Use i386_analyze_prologue instead of
i386_get_frame_setup.
(I386_NUM_SAVED_REGS): New define.
(struct i386_frame_cache): New structure.
(i386_alloc_frame_cache, i386_analyze_struct_return,
i386_skip_probe, i386_analyze_frame_setup,
i386_analyze_register_saves, i386_analyze_prologue,
i386_unwind_pc, i386_frame_cache, i386_frame_this_id,
i386_frame_prev_register, i386_sigtramp_frame_cache,
i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register,
i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address,
i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call):
New functions.
(i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base):
New variables.
(LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of
I386_EAX_REGNUM and I386_EDX_REGNUM.
(i386_extract_return_value, i386_store_return_value): Use
I386_ST0_REGNUM where appropriate.
(i386_extract_struct_value_address): Rewrite to use extract_address.
(i386_svr4_pc_in_sigtramp): Add comment.
(i386_svr4_sigcontext_addr): Rewrite.
(i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and
TDEP->sc_sp_offset.
(i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set
sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms
of new defines. Set push_dummy_call, don't set
deprecated_push_arguments, deprecated_push_return_address,
deprecated_pop_frame. Don't set parm_boundary. Don't set
deprecated_frame_chain, deprecated_frame_saved_pc,
deprecated_saved_pc_after_call. Set unwind_dummy_id,
save_dummy_frame_tos, unwind_pc. Call
frame_unwind_append_predicate and frame_base_set_default. Don't
set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum.
Don't set frameless_function_invocation. Don't set
deprecated_register_bytes, deprecated_register_size,
deprecated_call_dummy_words and deprecated_sizeof_call_dummy.
* i386-linux-tdep.c: Fix formatting in some comments.
(LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0,
LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1,
LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2,
LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0,
LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop
redundant parentheses.
(I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define.
(i386_linux_sigcontext_addr): Use it. Rewrite.
(find_minsym_and_objfile): Change name of second argument.
(skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers
changed. Use frame_pc_unwind instead of
DEPRECATED_SAVED_PC_AFTER_CALL.
(i386_linux_init_abi): Don't set deprecated_register_bytes.
* i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame
unwinder.
* i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and
"dummy-frame.h".
(i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed.
(_initialize_i386_cygwin_tdep): New prototype.
(i386_cygwin_init_abi): Don't set deprecated_frame_chain and
deprecated_frame_chain_valid.
* i386-sol2-tdep.c (i386_sol2_init_abi): Don't set
TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset.
Rely on the SVR4 defaults.
* config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o.
* Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.