* xtensa-tdep.c (ARG_1ST): Replace ARGS_FIRST_REG by its expression.
(ARGS_FIRST_REG): Remove.
(areg_numer): New function.
(xtensa_pseudo_register_read, xtensa_frame_prev_register)
(xtensa_extract_return_value, xtensa_store_return_value)
(xtensa_frame_cache): Replace AREG_NUMBER by areg_number.
(AREG_NUMBER): Remove.
(XTENSA_IS_ENTRY, ARG_NOF, ARG_1ST): Add gdbarch as parameter.
(xtensa_frame_cache): Update use of XTENSA_IS_ENTRY.
(xtensa_push_dummy_call): Update use of ARG_NOF.
(extract_call_winsize): Add gdbarch as parameter. Replace
current_gdbarch by gdbarch.
(xtensa_extract_return_value, xtensa_store_return_value): Update call
of extract_call_winsize.
(print_frame_arguments): Likewise.
(print_this_frame_argument_p): New function.
(print_frame_args): Print the argument value only when appropriate.
(_initialize_task): Add new "set/show print frame-arguments" command.
Daniel Jacobowitz <dan@codesourcery.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Right-align
struct values smaller than one doubleword; left-align those
larger. Pass structs containing a single floating-point value in
registers.
* shnbsd-tdep.c (shnbsd_supply_gregset, shnbsd_collect_gregset): Use
get_regcache_arch to get at the current architecture by regcache.
* xstormy16-tdep.c (xstormy16_frame_prev_register): Use get_frame_arch
to get at the current architecture by frame_info.
* fbsd-nat.c (fbsd_make_corefile_notes): Use get_regcache_arch to get
at the current architecture by regcache.
* gnu-v3-abi.c (gnuv3_skip_trampoline): Use get_frame_arch to get at
the current architecture by frame_info.
(build_gdb_vtable_type): Replace current_gdbarch by gdbarch.
* aix-thread.c (special_register_p): Add gdbarch as parameter.
(fetch_regs_kernel_thread, store_regs_kernel_thread): Add gdbarch to
caller of special_register_p.
* s390-nat.c (supply_gregset, fill_gregset): Use get_regcache_arch to
get at the current architecture by regcache.
(SUBOFF): Add gdbarch to macro definition.
* frame.c (frame_id_inner): Add gdbarch parameter. Replace
current_gdbarch by gdbarch.
(frame_find_by_id, get_prev_frame_1): Use get_frame_arch to get at the
current architecture by frame_info.
* frame.h (frame_id_inner): Add gdbarch parameter.
* stack.c (return_command): Use get_frame_arch to get at the current
architecture by frame_info. Update call of frame_id_inner.
* infrun.c (handle_inferior_event): Likewise.
* dummy-frame.c (dummy_frame_push): Use get_regcache_arch to get at the
current architecture by regcache. Update call of frame_id_inner.
* libunwind-frame.c (libunwind_frame_sniffer)
libunwind_frame_prev_register, libunwind_sigtramp_frame_sniffer)
(libunwind_frame_cache): Use get_frame_arch to get at the current
architecture by frame_info.
(libunwind_get_reg_special): Replace current_gdbarch by gdbarch.
* inf-ptrace.c (inf_ptrace_fetch_registers)
(inf_ptrace_fetch_register, inf_ptrace_store_register)
(inf_ptrace_store_registers): Use get_regcache_arch to get at the
current architecture by regcache.
* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
(go32_store_registers): Use get_regcache_arch to get at the current
architecture by regcache.
* armnbsd-nat.c (arm_supply_gregset, fetch_register, store_register)
(store_regs): Use get_regcache_arch to get at the current architecture
by regcache.
* alphabsd-nat.c (alphabsd_fetch_inferior_registers)
(alphabsd_store_inferior_registers): Use get_regcache_arch to get at
the current architecture by regcache.
soft float and vector ABIs. Support the generic vector ABI for
AltiVec types.
(do_ppc_sysv_return_value): Likewise. Correct argument types and
casts.
(ppc64_sysv_abi_push_dummy_call): Assert that floating point is
supported.
* ppc-tdep.h (enum powerpc_vector_abi): New.
(struct gdbarch_tdep): Add soft_float and vector_abi.
* rs6000-tdep.c (setpowerpccmdlist, showpowerpccmdlist)
(powerpc_soft_float_global, powerpc_vector_strings)
(powerpc_vector_abi_global, powerpc_vector_abi_string): New.
(rs6000_gdbarch_init): Check for soft-float and vector ABI markings.
(set_powerpc_command, show_powerpc_command, powerpc_set_soft_float)
(powerpc_set_vector_abi): New.
(_initialize_rs6000_tdep): Register "set powerpc" and "show powerpc"
commands.
* Makefile.in (elf_ppc_h): New.
(rs6000-tdep.o): Update.
* gdb.texinfo (PowerPC): Document "set powerpc vector-abi" and "set
powerpc soft-float".
* gdb.arch/altivec-abi.exp: Run multiple times for GCC on GNU/Linux.
Test "set powerpc vector-abi". Skip auto-detection tests for old
toolchains.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* gdb.base/dfp-exprs.exp: new file adding tests for Decimal
Floating Point expressions.
* gdb.base/dfp-test.exp: new file adding tests for Decimal
Floating Point variables.
* gdb.base/dfp-test.c: new file containing program with Decimal
Floating variables, used by gdb.base/dfp-test.exp.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* c-exp.y (YYSTYPE): Add typed_val_decfloat for decimal
floating point in YYSTYPE union.
(DECFLOAT) Add token and expression element handling code.
(parse_number): Parse DFP constants, which end with suffix 'df',
'dd' or 'dl'. Return DECFLOAT.
* eval.c (evaluate_subexp_standard): Call value_from_decfloat to
handle OP_DECFLOAT.
* expression.h (enum exp_opcode): Add an opcode (OP_DECFLOAT)
for DFP constants.
(union exp_element): Add decfloatconst to represent DFP
elements, which is 16 bytes by default.
* parse.c (write_exp_elt_decfloatcst): New function to write a
decimal float const into the expression.
(operator_length_standard): Set operator length for OP_DECFLOAT
to 4.
* parser-defs.h (write_exp_elt_decfloatcst): Prototype.
* valarith.c (value_neg): Add code to handle the negation
operation of DFP values.
* value.c (value_from_decfloat): New function to get the value
from a decimal floating point.
* value.h (value_from_decfloat): Prototype.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* c-lang.c (c_create_fundamental_type): Create fundamental
types for DFP.
* c-typeprint.c (c_type_print_varspec_prefix): Add
TYPE_CODE_DECFLOAT to no prefix needed case.
(c_type_print_varspec_suffix): Add TYPE_CODE_DECFLOAT to no
suffix needed case.
* c-valprint.c (c_val_print): Call print_decimal_floating to
print DFP values.
* dwarf2read.c (read_base_type): Read DW_ATE_decimal_float
attribute code and return TYPE_CODE_DECFLOAT.
(dwarf_base_type): Set dwarf2_fundamental_type for DFP values.
* gdbtypes.c (gdbtypes_post_init): Initialize builtin_decfloat,
builtin_decdouble and builtin_declong.
* gdbtypes.h (enum type_code): Add TYPE_CODE_DECFLOAT as a
type code for DFP.
(FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT): New
types, for decimal floating point.
(FT_NUM_MEMBERS): Increment, new types added.
(struct builtin_type): Add builtin_decfloat, builtin_decdouble
and builtin_declong.
* valprint.c (print_decimal_floating): New function to print DFP
values.
* value.h (print_decimal_floating): Prototype.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* Makefile.in (LIBDECNUMBER_DIR, LIBDECNUMBER, LIBDECNUMBER_SRC
LIBDECNUMBER_CFLAGS): New macros for libdecnumber.
(INTERNAL_CFLAGS_BASE): Add LIBDECNUMBER_CFLAGS in.
(INSTALLED_LIBS): Add -ldecnumber in.
(CLIBS): Add LIBDECNUMBER in.
(decimal128_h, decimal64_h, decimal32_h): New macros for decimal
headers.
(dfp_h): New macros for decimal floating point.
(dfp.o): New target.
(COMMON_OBS): Add dfp.o in.
(c-exp.o): Add dfp_h as dependency.
(valprint.o): Add dfp_h as dependency.
(value.o): Add dfp_h as dependency.
* dfp.h: New header file for decimal floating point support in
GDB.
* dfp.c: New source file for decimal floating point support in
GDB. Implement decimal_from_string and decimal_to_string based
on libdecnumber API.
* configure.ac: Add AC_C_BIGENDIAN test.
* config.in, configure: Regenerate.
* infcmd.c (registers_info): Check for a user register before
calling target's gdbarch_print_registers_info(). If found to be
so, extract the implicit value of user register and call
print_scalar_formatted().
* Makefile.in: (infcmd.o): Add $(user_regs_h).
set_solib_ops to install SVR4 operations.
(_initialize_svr4_solib): Do not set current_target_so_ops.
* config/i386/i386gnu.mh (NATDEPFILES): Move solib.o, solib-svr4.o ...
* config/i386/i386gnu.mt (TDEPFILES): ... to here.
(arm_wince_init_abi): Call set_solib_ops.
* i386-cygwin-tdep.c: Include "solib.h" and "solib-target.h".
(i386_cygwin_init_abi): Call set_solib_ops.
* solib-target.c: Include "solib-target.h".
(solib_target_so_ops): Make global.
(_initialize_solib_target): Do not set current_target_so_ops.
* solib-target.h: New file.
* Makefile.in: Update dependencies.
(mips_irix_init_abi): Call set_solib_ops.
* solib-irix.c: Include "solib.h" and "solib-irix.h".
(irix_so_ops): Make global.
(_initialize_irix_solib): Do not set current_target_so_ops.
* solib-irix.h: New file.
* Makefile.in: Update dependencies.
requirement.
(Requirements for Building GDB): Expand the list of Expat
uses.
(Library List Format, Memory Map Format): Mention Expat.
(Target Descriptions): Update Expat wording.
(amd64_init_abi): Use i387_convert_register_p.
* alpha-tdep.c (alpha_convert_register_p): Return zero for
eight byte types.
(alpha_register_to_value, alpha_value_to_register): Do not handle
eight byte types.
* i386-tdep.c (i386_convert_register_p): Use i387_convert_register_p.
* i387-tdep.c (i387_convert_register_p): New.
(i387_register_to_value, i387_value_to_register): Update comments.
* i387-tdep.h (i387_convert_register_p): Declare.
* ia64-tdep.c (ia64_convert_register_p): Return zero for
builtin_type_ia64_ext.
(ia64_gdbarch_init): Do not initialize builtin_type_ia64_ext here.
(_initialize_ia64_tdep): Initialize builtin_type_ia64_ext here.
* m68k-tdep.c (m68k_convert_register_p): Return zero for
builtin_type_m68881_ext.
(m68k_register_to_value, m68k_value_to_register): Update comments.
* gdbint.texinfo (Register and Memory Data, Target Conditionals):
Document that gdbarch_convert_register_p should return zero for no-op
conversions.
(add_pid_to_list, pull_pid_from_list): New.
* linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
(PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
(PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
(PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
(PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
(PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
(stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
(using_threads): Always set to 1.
(handle_extended_wait): New.
(add_process): Do not set TID.
(linux_create_inferior): Set must_set_ptrace_flags.
(linux_attach_lwp): Remove TID argument. Do not check using_threads.
Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers.
(linux_thread_alive): Rename TID argument to LWPID.
(linux_wait_for_process): Handle unknown processes. Do not use TID.
(linux_wait_for_event): Do not use TID or check using_threads. Update
call to dead_thread_notify. Call handle_extended_wait.
(linux_create_inferior): Use PTRACE_SETOPTIONS.
(send_sigstop): Delete sigstop_sent.
(wait_for_sigstop): Avoid TID.
(linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
(linux_test_for_tracefork): New.
(linux_lookup_signals): Use thread_db_active and
linux_supports_tracefork_flag.
(initialize_low): Use thread_db_active and linux_test_for_tracefork.
* linux-low.h (get_process_thread): Avoid TID.
(struct process_ifo): Move thread_known and tid to the end. Remove
sigstop_sent.
(linux_attach_lwp, thread_db_init): Update prototypes.
* server.h (change_inferior_id): Delete prototype.
(add_pid_to_list, pull_pid_from_list): New prototypes.
* thread-db.c (thread_db_use_events): New.
(find_first_thread): Rename to...
(find_one_thread): ...this. Update callers and messages. Do not
call fatal. Check thread_db_use_events. Do not call
change_inferior_id or new_thread_notify.
(maybe_attach_thread): Update. Do not call new_thread_notify.
(thread_db_init): Set thread_db_use_events. Check use_events.
* utils.c (fatal, warning): Correct message prefix.
(cp_already_canonical): New function.
(cp_canonicalize_string): Use it. Return NULL for already canonical
strings.
(mangled_name_to_comp): Update call to cp_demangled_name_to_comp.
(cp_func_name, remove_params): Likewise.
(cp_find_first_component_aux): Use ISSPACE.
* cp-support.h (cp_demangled_name_to_comp): Correct comment. Remove
MEMORY_P argument.
* cp-name-parser.y (ALLOC_CHUNK): Define.
(struct demangle_info): Add PREV and NEXT. Increase the size of
COMPS.
(d_grab): Convert to a function.
(allocate_info): Rewrite.
(cp_demangled_name_to_comp): Remove MEMORY argument. Do not use
strlen. Update call to allocate_info. Do not free it on failure.
(main): Update calls to cp_demangled_name_to_comp.
* Makefile.in (cp-support.o): Update.
* std-regs.c (value_of_builtin_frame_fp_reg)
value_of_builtin_frame_pc_reg, value_of_builtin_frame_sp_reg)
value_of_builtin_frame_ps_reg): Use get_frame_arch to get at the
current architecture by frame_info.
* infcmd.c (default_print_registers_info, print_return_value)
(print_vector_info, print_float_info): Replace current_gdbarch by
gdbarch.
(registers_info): Use get_frame_arch to get at the current
architecture by frame_info.