binutils-gdb/gdb/amd64-tdep.c

3328 lines
94 KiB
C
Raw Normal View History

* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
/* Target-dependent code for AMD64.
2002-02-27 03:55:13 +01:00
Copyright (C) 2001-2017 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "opcode/i386.h"
#include "dis-asm.h"
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
#include "arch-utils.h"
#include "block.h"
#include "dummy-frame.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "inferior.h"
Add new infrun.h header. Move infrun.c declarations out of inferior.h to a new infrun.h file. Tested by building on: i686-w64-mingw32, enable-targets=all x86_64-linux, enable-targets=all i586-pc-msdosdjgpp And also grepped the whole tree for each symbol moved to find where infrun.h might be necessary. gdb/ 2014-05-22 Pedro Alves <palves@redhat.com> * inferior.h (debug_infrun, debug_displaced, stop_on_solib_events) (sync_execution, sched_multi, step_stop_if_no_debug, non_stop) (disable_randomization, enum exec_direction_kind) (execution_direction, stop_registers, start_remote) (clear_proceed_status, proceed, resume, user_visible_resume_ptid) (wait_for_inferior, normal_stop, get_last_target_status) (prepare_for_detach, fetch_inferior_event, init_wait_for_inferior) (insert_step_resume_breakpoint_at_sal) (follow_inferior_reset_breakpoints, stepping_past_instruction_at) (set_step_info, print_stop_event, signal_stop_state) (signal_print_state, signal_pass_state, signal_stop_update) (signal_print_update, signal_pass_update) (update_signals_program_target, clear_exit_convenience_vars) (displaced_step_dump_bytes, update_observer_mode) (signal_catch_update, gdb_signal_from_command): Move declarations ... * infrun.h: ... to this new file. * amd64-tdep.c: Include infrun.h. * annotate.c: Include infrun.h. * arch-utils.c: Include infrun.h. * arm-linux-tdep.c: Include infrun.h. * arm-tdep.c: Include infrun.h. * break-catch-sig.c: Include infrun.h. * breakpoint.c: Include infrun.h. * common/agent.c: Include infrun.h instead of inferior.h. * corelow.c: Include infrun.h. * event-top.c: Include infrun.h. * go32-nat.c: Include infrun.h. * i386-tdep.c: Include infrun.h. * inf-loop.c: Include infrun.h. * infcall.c: Include infrun.h. * infcmd.c: Include infrun.h. * infrun.c: Include infrun.h. * linux-fork.c: Include infrun.h. * linux-nat.c: Include infrun.h. * linux-thread-db.c: Include infrun.h. * monitor.c: Include infrun.h. * nto-tdep.c: Include infrun.h. * procfs.c: Include infrun.h. * record-btrace.c: Include infrun.h. * record-full.c: Include infrun.h. * remote-m32r-sdi.c: Include infrun.h. * remote-mips.c: Include infrun.h. * remote-notif.c: Include infrun.h. * remote-sim.c: Include infrun.h. * remote.c: Include infrun.h. * reverse.c: Include infrun.h. * rs6000-tdep.c: Include infrun.h. * s390-linux-tdep.c: Include infrun.h. * solib-irix.c: Include infrun.h. * solib-osf.c: Include infrun.h. * solib-svr4.c: Include infrun.h. * target.c: Include infrun.h. * top.c: Include infrun.h. * windows-nat.c: Include infrun.h. * mi/mi-interp.c: Include infrun.h. * mi/mi-main.c: Include infrun.h. * python/py-threadevent.c: Include infrun.h.
2014-05-22 13:29:11 +02:00
#include "infrun.h"
#include "gdbcmd.h"
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
#include "gdbcore.h"
#include "objfiles.h"
#include "regcache.h"
2003-10-06 00:02:49 +02:00
#include "regset.h"
#include "symfile.h"
#include "disasm.h"
* amd64-tdep.h: Renamed from x86-64-tdep.h. * amd64-tdep.c: Renamed from x86-64-tdep.c. Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64-linux-tdep.h: Renamed from x86-64-linux.h. * amd64-linux-tdep.c: Renamed from x86-64-linux-tdep.c. Include "amd64-tdep.h" and "amd64-linux-tdep.h" instead of "x86-64-tdep.h" and "x86-64-tdep.c". * amd64-linux-nat.c: Renamed from x86-64-linux-nat.c. Include "amd64-tdep.h" and "amd64-linux-tdep.h" instead of "x86-64-tdep.h" and "x86-64-tdep.c". * amd64bsd-nat.c: Update copyright year. Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64fbsd-tdep.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64fbsd-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64nbsd-tdep.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64nbsd-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64obsd-tdep.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * amd64obsd-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". * configure.host: (x86_64-*-linux*): Set gdb_target to linux64. * configure.tgt (x86_64-*-linux*): Set gdb_target to linux64. * Makefile.in (amd64_linux_tdep_h): Renamed from x86_64_linux_tdep_h. (amd64_tdep_h): Renamed from x86_64_tdep_h. (amd64bsd-nat.o, amd64fbsd-nat.o, amd64fbsd-tdep.o, amd64-nat.o) (amd64nbsd-nat.o, amd64nbsd-tdep.o, amd64obsd-nat.o) (amd64obsd-tdep.o): Update dependencies. (amd64-tdep.o, amd64-linux-nat.o, amd64-linux-tdep.o): New dependencies. (x86-64-linux-nat.o, x86-64-linux-tdep.o, x86-64-tdep.o): Remove dependencies. (ALLDEPFILES): Add amd64-tdep.c, amd64obsd-nat.c, amd64obsd-nat.c, amd64-linux-nat.c amd64-linux-tdep.c. * config/i386/tm-linux64.h: Renamed from tm-x86-64linux.h * config/i386/nm-linux64.h: Renamed from nm-x86-64linux.h. * config/i386/linux64.mt: Renamed from x86-64linux.mt. (TDEPFILES): Replace x86-64-tdep.o and x86-64-linux-tdep.o with amd64-tdep.o and amd64-linux-tdep.o. (TM_FILE): Set to tm-linux64.h. * config/i386/linux64.mh: Renamed from x86-64linux.mh. (NAT_FILE): Set to nm-linux64.h. (NATDEPFILES): Replace x86-64-linux-nat.o with amd64-linux-nat.o. * config/i386/fbsd64.mt (TDEPFILES): Replace x86-64-tdep.o with amd64-tdep.o. * config/i386/nbsd64.mt (TDEPFILES): Replace x86-64-tdep.o with amd64-tdep.o. * config/i386/obsd64.mt (TDEPFILES): Replace x86-64-tdep.o with amd64-tdep.o.
2004-02-25 21:45:31 +01:00
#include "amd64-tdep.h"
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
#include "i387-tdep.h"
Add support for the x86 XSAVE extended state on FreeBSD/x86. Recognize NT_X86_XSTATE notes in FreeBSD process cores. Recent FreeBSD versions include a note containing the XSAVE state for each thread in the process when XSAVE is in use. The note stores a copy of the current XSAVE mask in a reserved section of the machine-defined XSAVE state at the same offset as Linux's NT_X86_XSTATE note. For native processes, use the PT_GETXSTATE_INFO ptrace request to determine if XSAVE is enabled, and if so the active XSAVE state mask (that is, the value of %xcr0 for the target process) as well as the size of XSAVE state area. Use the PT_GETXSTATE and PT_SETXSTATE requests to fetch and store the XSAVE state, respectively, in the BSD x86 native targets. In addition, the FreeBSD amd64 and i386 native targets now include "read_description" target methods to determine the correct x86 target description for the current XSAVE mask. On FreeBSD amd64 this also properly returns an i386 target description for 32-bit binaries which allows the 64-bit GDB to run 32-bit binaries. Note that the ptrace changes are in the BSD native targets, not the FreeBSD-specific native targets since that is where the other ptrace register accesses occur. Of the other BSDs, NetBSD and DragonFly use XSAVE in the kernel but do not currently export the extended state via ptrace(2). OpenBSD does not currently support XSAVE. bfd/ChangeLog: * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on FreeBSD. (elfcore_write_xstatereg): Use correct note name on FreeBSD. gdb/ChangeLog: * amd64-tdep.c (amd64_target_description): New function. * amd64-tdep.h: Export amd64_target_description and tdesc_amd64. * amd64bsd-nat.c [PT_GETXSTATE_INFO]: New variable amd64bsd_xsave_len. (amd64bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (amd64bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * amd64bsd-nat.h: Export amd64bsd_xsave_len. * amd64fbsd-nat.c (amd64fbsd_read_description): New function. (_initialize_amd64fbsd_nat): Set "to_read_description" to "amd64fbsd_read_description". * amd64fbsd-tdep.c (amd64fbsd_core_read_description): New function. (amd64fbsd_supply_xstateregset): New function. (amd64fbsd_collect_xstateregset): New function. Add "amd64fbsd_xstateregset". (amd64fbsd_iterate_over_regset_sections): New function. (amd64fbsd_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386-tdep.c (i386_target_description): New function. * i386-tdep.h: Export i386_target_description and tdesc_i386. * i386bsd-nat.c [PT_GETXSTATE_INFO]: New variable i386bsd_xsave_len. (i386bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (i386bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * i386bsd-nat.h: Export i386bsd_xsave_len. * i386fbsd-nat.c (i386fbsd_read_description): New function. (_initialize_i386fbsd_nat): Set "to_read_description" to "i386fbsd_read_description". * i386fbsd-tdep.c (i386fbsd_core_read_xcr0): New function. (i386fbsd_core_read_description): New function. (i386fbsd_supply_xstateregset): New function. (i386fbsd_collect_xstateregset): New function. Add "i386fbsd_xstateregset". (i386fbsd_iterate_over_regset_sections): New function. (i386fbsd4_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386fbsd-tdep.h: New file.
2015-02-21 22:43:30 +01:00
#include "x86-xstate.h"
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 20:55:17 +02:00
#include <algorithm>
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
#include "features/i386/amd64.c"
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
#include "features/i386/amd64-avx.c"
#include "features/i386/amd64-mpx.c"
Add target descriptions for AVX + MPX The current MPX target descriptions assume that MPX is always combined with AVX, however that's not correct. We can have machines with MPX and without AVX; or machines with AVX and without MPX. This patch adds new target descriptions for machines that support both MPX and AVX, as duplicates of the existing MPX descriptions. The following commit will remove AVX from the MPX-only descriptions. 2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c): New include. (amd64_linux_core_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux. * amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition. * amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include. (amd64_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx. * common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits. (X86_XSTATE_AVX_MPX_MASK): New case. * features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux) (i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules. (i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite) (i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite): New expedites. * i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New include. (i386_linux_core_read_description): Add case X86_XSTATE_AVX_MPX_MASK. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_avx_mpx_linux. * i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include. * i386-tdep.c (features/i386/i386-avx-mpx.c): New include. (i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. * x86-linux-nat.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. * features/i386/amd64-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx-linux.c: Generated. * features/i386/amd64-avx-mpx.c: Generated. * features/i386/i386-avx-mpx-linux.c: Generated. * features/i386/i386-avx-mpx.c: Generated. * regformats/i386/amd64-avx-mpx-linux.dat: Generated. * regformats/i386/amd64-avx-mpx.dat: Generated. * regformats/i386/i386-avx-mpx-linux.dat: Generated. * regformats/i386/i386-avx-mpx.dat: Generated. gdb/gdbserver/ChangeLog: * Makefile.in (clean): Add removal for i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c. (i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c) (amd64-avx-mpx-linux.c): New rules. (amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule. * configure.srv (srv_i386_regobj): Add i386-avx-mpx.o. (srv_i386_linux_regobj): Add i386-avx-mpx-linux.o. (srv_amd64_regobj): Add amd64-avx-mpx.o. (srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o. (srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml. (ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o. * linux-x86-low.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (x86_get_ipa_tdesc_idx): Add cases for avx_mpx. (initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and init_registers_i386_avx_mpx_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_i386_avx_mpx_linux. * linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_amd64_avx_mpx_linux. * linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value. (init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux) (init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New declarations.
2016-04-19 15:44:32 +02:00
#include "features/i386/amd64-avx-mpx.c"
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
#include "features/i386/amd64-avx512.c"
#include "features/i386/x32.c"
#include "features/i386/x32-avx.c"
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
#include "features/i386/x32-avx512.c"
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
#include "ax.h"
#include "ax-gdb.h"
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
/* Note that the AMD64 architecture was previously known as x86-64.
The latter is (forever) engraved into the canonical system name as
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
returned by config.guess, and used as the name for the AMD64 port
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
of GNU/Linux. The BSD's have renamed their ports to amd64; they
don't like to shout. For GDB we prefer the amd64_-prefix over the
x86_64_-prefix since it's so much easier to type. */
/* Register information. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static const char *amd64_register_names[] =
{
"rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp",
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* %r8 is indeed register number 8. */
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"rip", "eflags", "cs", "ss", "ds", "es", "fs", "gs",
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* %st0 is register number 24. */
"st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7",
"fctrl", "fstat", "ftag", "fiseg", "fioff", "foseg", "fooff", "fop",
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* %xmm0 is register number 40. */
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
"mxcsr",
};
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
static const char *amd64_ymm_names[] =
{
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11",
"ymm12", "ymm13", "ymm14", "ymm15"
};
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
static const char *amd64_ymm_avx512_names[] =
{
"ymm16", "ymm17", "ymm18", "ymm19",
"ymm20", "ymm21", "ymm22", "ymm23",
"ymm24", "ymm25", "ymm26", "ymm27",
"ymm28", "ymm29", "ymm30", "ymm31"
};
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
static const char *amd64_ymmh_names[] =
{
"ymm0h", "ymm1h", "ymm2h", "ymm3h",
"ymm4h", "ymm5h", "ymm6h", "ymm7h",
"ymm8h", "ymm9h", "ymm10h", "ymm11h",
"ymm12h", "ymm13h", "ymm14h", "ymm15h"
};
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
static const char *amd64_ymmh_avx512_names[] =
{
"ymm16h", "ymm17h", "ymm18h", "ymm19h",
"ymm20h", "ymm21h", "ymm22h", "ymm23h",
"ymm24h", "ymm25h", "ymm26h", "ymm27h",
"ymm28h", "ymm29h", "ymm30h", "ymm31h"
};
static const char *amd64_mpx_names[] =
{
"bnd0raw", "bnd1raw", "bnd2raw", "bnd3raw", "bndcfgu", "bndstatus"
};
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
static const char *amd64_k_names[] =
{
"k0", "k1", "k2", "k3",
"k4", "k5", "k6", "k7"
};
static const char *amd64_zmmh_names[] =
{
"zmm0h", "zmm1h", "zmm2h", "zmm3h",
"zmm4h", "zmm5h", "zmm6h", "zmm7h",
"zmm8h", "zmm9h", "zmm10h", "zmm11h",
"zmm12h", "zmm13h", "zmm14h", "zmm15h",
"zmm16h", "zmm17h", "zmm18h", "zmm19h",
"zmm20h", "zmm21h", "zmm22h", "zmm23h",
"zmm24h", "zmm25h", "zmm26h", "zmm27h",
"zmm28h", "zmm29h", "zmm30h", "zmm31h"
};
static const char *amd64_zmm_names[] =
{
"zmm0", "zmm1", "zmm2", "zmm3",
"zmm4", "zmm5", "zmm6", "zmm7",
"zmm8", "zmm9", "zmm10", "zmm11",
"zmm12", "zmm13", "zmm14", "zmm15",
"zmm16", "zmm17", "zmm18", "zmm19",
"zmm20", "zmm21", "zmm22", "zmm23",
"zmm24", "zmm25", "zmm26", "zmm27",
"zmm28", "zmm29", "zmm30", "zmm31"
};
static const char *amd64_xmm_avx512_names[] = {
"xmm16", "xmm17", "xmm18", "xmm19",
"xmm20", "xmm21", "xmm22", "xmm23",
"xmm24", "xmm25", "xmm26", "xmm27",
"xmm28", "xmm29", "xmm30", "xmm31"
};
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* DWARF Register Number Mapping as defined in the System V psABI,
section 3.6. */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
static int amd64_dwarf_regmap[] =
{
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* General Purpose Registers RAX, RDX, RCX, RBX, RSI, RDI. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_RAX_REGNUM, AMD64_RDX_REGNUM,
AMD64_RCX_REGNUM, AMD64_RBX_REGNUM,
AMD64_RSI_REGNUM, AMD64_RDI_REGNUM,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Frame Pointer Register RBP. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_RBP_REGNUM,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Stack Pointer Register RSP. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_RSP_REGNUM,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Extended Integer Registers 8 - 15. */
AMD64_R8_REGNUM, /* %r8 */
AMD64_R9_REGNUM, /* %r9 */
AMD64_R10_REGNUM, /* %r10 */
AMD64_R11_REGNUM, /* %r11 */
AMD64_R12_REGNUM, /* %r12 */
AMD64_R13_REGNUM, /* %r13 */
AMD64_R14_REGNUM, /* %r14 */
AMD64_R15_REGNUM, /* %r15 */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Return Address RA. Mapped to RIP. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_RIP_REGNUM,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* SSE Registers 0 - 7. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM,
AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3,
AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Extended SSE Registers 8 - 15. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_XMM0_REGNUM + 8, AMD64_XMM0_REGNUM + 9,
AMD64_XMM0_REGNUM + 10, AMD64_XMM0_REGNUM + 11,
AMD64_XMM0_REGNUM + 12, AMD64_XMM0_REGNUM + 13,
AMD64_XMM0_REGNUM + 14, AMD64_XMM0_REGNUM + 15,
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Floating Point Registers 0-7. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_ST0_REGNUM + 0, AMD64_ST0_REGNUM + 1,
AMD64_ST0_REGNUM + 2, AMD64_ST0_REGNUM + 3,
AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5,
AMD64_ST0_REGNUM + 6, AMD64_ST0_REGNUM + 7,
/* MMX Registers 0 - 7.
We have to handle those registers specifically, as their register
number within GDB depends on the target (or they may even not be
available at all). */
-1, -1, -1, -1, -1, -1, -1, -1,
/* Control and Status Flags Register. */
AMD64_EFLAGS_REGNUM,
/* Selector Registers. */
AMD64_ES_REGNUM,
AMD64_CS_REGNUM,
AMD64_SS_REGNUM,
AMD64_DS_REGNUM,
AMD64_FS_REGNUM,
AMD64_GS_REGNUM,
-1,
-1,
/* Segment Base Address Registers. */
-1,
-1,
-1,
-1,
/* Special Selector Registers. */
-1,
-1,
/* Floating Point Control Registers. */
AMD64_MXCSR_REGNUM,
AMD64_FCTRL_REGNUM,
AMD64_FSTAT_REGNUM
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
};
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
static const int amd64_dwarf_regmap_len =
(sizeof (amd64_dwarf_regmap) / sizeof (amd64_dwarf_regmap[0]));
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Convert DWARF register number REG to the appropriate register
number used by GDB. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static int
amd64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int ymm0_regnum = tdep->ymm0_regnum;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
int regnum = -1;
if (reg >= 0 && reg < amd64_dwarf_regmap_len)
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
regnum = amd64_dwarf_regmap[reg];
PR symtab/17391 gdb internal error: assertion fails in regcache.c:178 gdb/ChangeLog: * dwarf2-frame.c (dwarf2_restore_rule): Call dwarf_reg_to_regnum instead of gdbarch_dwarf2_reg_to_regnum. (dwarf2_frame_cache): Ditto. (read_addr_from_reg): Call dwarf_reg_to_regnum_or_error instead of gdbarch_dwarf2_reg_to_regnum. (get_reg_value): Ditto. (dwarf2_fetch_cfa_info): Ditto. (dwarf2_frame_prev_register): Ditto. * dwarf2loc.c: #include "complaints.h". (dwarf_expr_read_addr_from_reg): Call dwarf_reg_to_regnum_or_error instead of gdbarch_dwarf2_reg_to_regnum. (dwarf_expr_get_reg_value): Ditto. (read_pieced_value): Ditto. (write_pieced_value): Ditto. (dwarf2_evaluate_loc_desc_full): Ditto. (dwarf_reg_to_regnum): New function. (throw_bad_regnum_error): New function. (dwarf_reg_to_regnum_or_error): Renamed from dwarf2_reg_to_regnum_or_errorChange to take a ULONGEST regnum. All callers updated. Call throw_bad_regnum_error. (locexpr_regname): Improve text of bad register number. * dwarf2loc.h (dwarf_reg_to_regnum): Declare. (dwarf_reg_to_regnum_or_error): Update prototype. * dwarf2expr.c: #include "dwarf2loc.h". (dwarf_block_to_sp_offset): Call dwarf_reg_to_regnum instead of gdbarch_dwarf2_reg_to_regnum. * gdbarch.sh (dwarf2_reg_to_regnum): Add comment. * gdbarch.h: Regenerate. * amd64-tdep.c (amd64_dwarf_reg_to_regnum): Remove warning for bad register. * avr-tdep.c (avr_dwarf_reg_to_regnum): Ditto. * cris-tdep.c (cris_dwarf2_reg_to_regnum): Ditto. * bfin-tdep.c (bfin_reg_to_regnum): Fix error checking. * hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum): Improve error checking. Remove warning for bad register. * hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Ditto. * i386-tdep.c (i386_svr4_dwarf_reg_to_regnum): Renamed from i386_svr4_reg_to_regnum. Return -1 for bad registers. (i386_svr4_reg_to_regnum): New function. (i386_gdbarch_init): Update call to set_gdbarch_dwarf2_reg_to_regnum. * microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Don't assert on bad registers, return -1. * msp430-tdep.c (msp430_dwarf2_reg_to_regnum): Improve error checking. Remove warning for bad register. * nios2-tdep.c: Add static assert for NIOS2_NUM_REGS. (nios2_dwarf_reg_to_regnum): Fix off-by-one error. Remove warning for bad register. Return -1 for bad register. * rl78-tdep.c (rl78_dwarf_reg_to_regnum): Don't flag an internal error for bad register, return -1. * rx-tdep.c (rx_dwarf_reg_to_regnum): Ditto. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Fix error result. * mep-tdep.c (mep_debug_reg_to_regnum): Ditto. * mips-tdep.c (mips_stab_reg_to_regnum): Ditto. (mips_dwarf_dwarf2_ecoff_reg_to_regnum): Ditto. * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Remove warning for bad regs. * xtensa-tdep.c (xtensa_reg_to_regnum): Remove internal error for bad regs. Fix error result. * stabsread.c (stab_reg_to_regnum): Watch for negative regno. (reg_value_complaint): Update complaint text. * mdebugread.c (reg_value_complaint): New function. (mdebug_reg_to_regnum): Rewrite to watch for bad reg numbers. gdb/testsuite/ChangeLog: * lib/dwarf.exp (_location): Add support for DW_OP_regx. * gdb.dwarf2/bad-regnum.c: New file. * gdb.dwarf2/bad-regnum.exp: New file.
2015-10-27 00:05:21 +01:00
if (ymm0_regnum >= 0
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
&& i386_xmm_regnum_p (gdbarch, regnum))
regnum += ymm0_regnum - I387_XMM0_REGNUM (tdep);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return regnum;
}
/* Map architectural register numbers to gdb register numbers. */
static const int amd64_arch_regmap[16] =
{
AMD64_RAX_REGNUM, /* %rax */
AMD64_RCX_REGNUM, /* %rcx */
AMD64_RDX_REGNUM, /* %rdx */
AMD64_RBX_REGNUM, /* %rbx */
AMD64_RSP_REGNUM, /* %rsp */
AMD64_RBP_REGNUM, /* %rbp */
AMD64_RSI_REGNUM, /* %rsi */
AMD64_RDI_REGNUM, /* %rdi */
AMD64_R8_REGNUM, /* %r8 */
AMD64_R9_REGNUM, /* %r9 */
AMD64_R10_REGNUM, /* %r10 */
AMD64_R11_REGNUM, /* %r11 */
AMD64_R12_REGNUM, /* %r12 */
AMD64_R13_REGNUM, /* %r13 */
AMD64_R14_REGNUM, /* %r14 */
AMD64_R15_REGNUM /* %r15 */
};
static const int amd64_arch_regmap_len =
(sizeof (amd64_arch_regmap) / sizeof (amd64_arch_regmap[0]));
/* Convert architectural register number REG to the appropriate register
number used by GDB. */
static int
amd64_arch_reg_to_regnum (int reg)
{
gdb_assert (reg >= 0 && reg < amd64_arch_regmap_len);
return amd64_arch_regmap[reg];
}
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
/* Register names for byte pseudo-registers. */
static const char *amd64_byte_names[] =
{
"al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl",
"r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l",
"ah", "bh", "ch", "dh"
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
};
/* Number of lower byte registers. */
#define AMD64_NUM_LOWER_BYTE_REGS 16
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
/* Register names for word pseudo-registers. */
static const char *amd64_word_names[] =
{
"ax", "bx", "cx", "dx", "si", "di", "bp", "",
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
};
/* Register names for dword pseudo-registers. */
static const char *amd64_dword_names[] =
{
"eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp",
"r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d",
"eip"
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
};
/* Return the name of register REGNUM. */
static const char *
amd64_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (i386_byte_regnum_p (gdbarch, regnum))
return amd64_byte_names[regnum - tdep->al_regnum];
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
else if (i386_zmm_regnum_p (gdbarch, regnum))
return amd64_zmm_names[regnum - tdep->zmm0_regnum];
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
else if (i386_ymm_regnum_p (gdbarch, regnum))
return amd64_ymm_names[regnum - tdep->ymm0_regnum];
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
else if (i386_ymm_avx512_regnum_p (gdbarch, regnum))
return amd64_ymm_avx512_names[regnum - tdep->ymm16_regnum];
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
else if (i386_word_regnum_p (gdbarch, regnum))
return amd64_word_names[regnum - tdep->ax_regnum];
else if (i386_dword_regnum_p (gdbarch, regnum))
return amd64_dword_names[regnum - tdep->eax_regnum];
else
return i386_pseudo_register_name (gdbarch, regnum);
}
static struct value *
amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
struct regcache *regcache,
int regnum)
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
{
gdb_byte *raw_buf = (gdb_byte *) alloca (register_size (gdbarch, regnum));
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
gdb/ * regcache.h (regcache_raw_read, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_part) (regcache_cooked_read, regcache_cooked_read_signed) (regcache_cooked_read_unsigned, regcache_cooked_read_part) (regcache_cooked_read_ftype): Change return to enum register_status. * regcache.c: Include exceptions.h (regcache_save): Adjust to handle REG_UNAVAILABLE registers. (do_cooked_read): Change return to enum register_status. Always forward to regcache_cooked_read. (regcache_raw_read): Change return to enum register_status. If the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_raw_read_signed): Handle non-REG_VALID registers and return the register's status. (regcache_raw_read_unsigned): Ditto. (regcache_cooked_read): Change return to enum register_status. Assert that with read-only regcaches, the register's status must be known. If the regcache is read-only, and the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_cooked_read_signed): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_cooked_read_unsigned): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_xfer_part, regcache_raw_read_part) (regcache_cooked_read_part): Change return to enum register_status. Return the register's status. (regcache_read_pc): Throw NOT_AVAILABLE_ERROR if the register is unavailable. (regcache_dump): Handle unavailable cooked registers. * frame.c (do_frame_register_read): Adjust interface to match regcache_cooked_read_ftype. * gdbarch.sh (pseudo_register_read): Change return to enum register_status. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.h (i386_pseudo_register_read): Change return to enum register_status. * i386-tdep.c (i386_pseudo_register_read): Change return to enum register_status. If reading a raw register indicates the raw register is not valid, return the raw register's status, otherwise, return REG_VALID. * amd64-tdep.c (amd64_pseudo_register_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * arm-tdep.c (arm_neon_quad_read) (arm_pseudo_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * avr-tdep.c (avr_pseudo_register_read): Ditto. * frv-tdep.c (frv_pseudo_register_read): Ditto. * h8300-tdep.c (h8300_pseudo_register_read): Ditto. * hppa-tdep.c (hppa_pseudo_register_read): Ditto. * m32c-tdep.c (m32c_move_reg_t): Change return to enum register_status. (m32c_raw_read, m32c_raw_write, m32c_banked_read) (m32c_banked_write, m32c_sb_read, m32c_sb_write, m32c_part_read) (m32c_part_write, m32c_cat_read, m32c_cat_write) (m32c_r3r2r1r0_read, m32c_r3r2r1r0_write) (m32c_pseudo_register_read): Change return to enum register_status. Adjust. * m68hc11-tdep.c (m68hc11_pseudo_register_read): Change return to enum register_status. Return the register's status. * mep-tdep.c (mep_pseudo_cr32_read): Change return to enum register_status. Return the register's status. (mep_pseudo_cr64_read, mep_pseudo_register_read): Ditto. * mips-tdep.c (mips_pseudo_register_read): Ditto. * mt-tdep.c (mt_pseudo_register_read): Ditto. * rs6000-tdep.c (move_ev_register_func): New typedef. (e500_move_ev_register): Use it. Change return to enum register_status. Return the register's status. (do_regcache_raw_read): New function. (do_regcache_raw_write): New function. (e500_pseudo_register_read): Change return to enum register_status. Return the register's status. Use do_regcache_raw_read. (e500_pseudo_register_write): Adjust. Use do_regcache_raw_write. (dfp_pseudo_register_read): Change return to enum register_status. Return the register's status. (vsx_pseudo_register_read): Ditto. (efpr_pseudo_register_read): Ditto. (rs6000_pseudo_register_read): Ditto. * s390-tdep.c (s390_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh64-tdep.c (pseudo_register_read_portions): New function. (sh64_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * ia64-tdep.c (ia64_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh-tdep.c (pseudo_register_read_portions): New function. (sh_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * sparc-tdep.c (sparc32_pseudo_register_read): Change return to enum register_status. Return the register's status. * sparc64-tdep.c (sparc64_pseudo_register_read): Ditto. * spu-tdep.c (spu_pseudo_register_read_spu) (spu_pseudo_register_read): Ditto. * xtensa-tdep.c (xtensa_register_read_masked) (xtensa_pseudo_register_read): Ditto. * bfin-tdep.c (bfin_pseudo_register_read): Ditto.
2011-03-18 19:38:44 +01:00
enum register_status status;
struct value *result_value;
gdb_byte *buf;
result_value = allocate_value (register_type (gdbarch, regnum));
VALUE_LVAL (result_value) = lval_register;
VALUE_REGNUM (result_value) = regnum;
buf = value_contents_raw (result_value);
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
if (i386_byte_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->al_regnum;
/* Extract (always little endian). */
if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
{
/* Special handling for AH, BH, CH, DH. */
gdb/ * regcache.h (regcache_raw_read, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_part) (regcache_cooked_read, regcache_cooked_read_signed) (regcache_cooked_read_unsigned, regcache_cooked_read_part) (regcache_cooked_read_ftype): Change return to enum register_status. * regcache.c: Include exceptions.h (regcache_save): Adjust to handle REG_UNAVAILABLE registers. (do_cooked_read): Change return to enum register_status. Always forward to regcache_cooked_read. (regcache_raw_read): Change return to enum register_status. If the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_raw_read_signed): Handle non-REG_VALID registers and return the register's status. (regcache_raw_read_unsigned): Ditto. (regcache_cooked_read): Change return to enum register_status. Assert that with read-only regcaches, the register's status must be known. If the regcache is read-only, and the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_cooked_read_signed): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_cooked_read_unsigned): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_xfer_part, regcache_raw_read_part) (regcache_cooked_read_part): Change return to enum register_status. Return the register's status. (regcache_read_pc): Throw NOT_AVAILABLE_ERROR if the register is unavailable. (regcache_dump): Handle unavailable cooked registers. * frame.c (do_frame_register_read): Adjust interface to match regcache_cooked_read_ftype. * gdbarch.sh (pseudo_register_read): Change return to enum register_status. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.h (i386_pseudo_register_read): Change return to enum register_status. * i386-tdep.c (i386_pseudo_register_read): Change return to enum register_status. If reading a raw register indicates the raw register is not valid, return the raw register's status, otherwise, return REG_VALID. * amd64-tdep.c (amd64_pseudo_register_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * arm-tdep.c (arm_neon_quad_read) (arm_pseudo_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * avr-tdep.c (avr_pseudo_register_read): Ditto. * frv-tdep.c (frv_pseudo_register_read): Ditto. * h8300-tdep.c (h8300_pseudo_register_read): Ditto. * hppa-tdep.c (hppa_pseudo_register_read): Ditto. * m32c-tdep.c (m32c_move_reg_t): Change return to enum register_status. (m32c_raw_read, m32c_raw_write, m32c_banked_read) (m32c_banked_write, m32c_sb_read, m32c_sb_write, m32c_part_read) (m32c_part_write, m32c_cat_read, m32c_cat_write) (m32c_r3r2r1r0_read, m32c_r3r2r1r0_write) (m32c_pseudo_register_read): Change return to enum register_status. Adjust. * m68hc11-tdep.c (m68hc11_pseudo_register_read): Change return to enum register_status. Return the register's status. * mep-tdep.c (mep_pseudo_cr32_read): Change return to enum register_status. Return the register's status. (mep_pseudo_cr64_read, mep_pseudo_register_read): Ditto. * mips-tdep.c (mips_pseudo_register_read): Ditto. * mt-tdep.c (mt_pseudo_register_read): Ditto. * rs6000-tdep.c (move_ev_register_func): New typedef. (e500_move_ev_register): Use it. Change return to enum register_status. Return the register's status. (do_regcache_raw_read): New function. (do_regcache_raw_write): New function. (e500_pseudo_register_read): Change return to enum register_status. Return the register's status. Use do_regcache_raw_read. (e500_pseudo_register_write): Adjust. Use do_regcache_raw_write. (dfp_pseudo_register_read): Change return to enum register_status. Return the register's status. (vsx_pseudo_register_read): Ditto. (efpr_pseudo_register_read): Ditto. (rs6000_pseudo_register_read): Ditto. * s390-tdep.c (s390_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh64-tdep.c (pseudo_register_read_portions): New function. (sh64_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * ia64-tdep.c (ia64_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh-tdep.c (pseudo_register_read_portions): New function. (sh_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * sparc-tdep.c (sparc32_pseudo_register_read): Change return to enum register_status. Return the register's status. * sparc64-tdep.c (sparc64_pseudo_register_read): Ditto. * spu-tdep.c (spu_pseudo_register_read_spu) (spu_pseudo_register_read): Ditto. * xtensa-tdep.c (xtensa_register_read_masked) (xtensa_pseudo_register_read): Ditto. * bfin-tdep.c (bfin_pseudo_register_read): Ditto.
2011-03-18 19:38:44 +01:00
status = regcache_raw_read (regcache,
gpnum - AMD64_NUM_LOWER_BYTE_REGS,
raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf + 1, 1);
else
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
}
else
{
gdb/ * regcache.h (regcache_raw_read, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_part) (regcache_cooked_read, regcache_cooked_read_signed) (regcache_cooked_read_unsigned, regcache_cooked_read_part) (regcache_cooked_read_ftype): Change return to enum register_status. * regcache.c: Include exceptions.h (regcache_save): Adjust to handle REG_UNAVAILABLE registers. (do_cooked_read): Change return to enum register_status. Always forward to regcache_cooked_read. (regcache_raw_read): Change return to enum register_status. If the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_raw_read_signed): Handle non-REG_VALID registers and return the register's status. (regcache_raw_read_unsigned): Ditto. (regcache_cooked_read): Change return to enum register_status. Assert that with read-only regcaches, the register's status must be known. If the regcache is read-only, and the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_cooked_read_signed): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_cooked_read_unsigned): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_xfer_part, regcache_raw_read_part) (regcache_cooked_read_part): Change return to enum register_status. Return the register's status. (regcache_read_pc): Throw NOT_AVAILABLE_ERROR if the register is unavailable. (regcache_dump): Handle unavailable cooked registers. * frame.c (do_frame_register_read): Adjust interface to match regcache_cooked_read_ftype. * gdbarch.sh (pseudo_register_read): Change return to enum register_status. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.h (i386_pseudo_register_read): Change return to enum register_status. * i386-tdep.c (i386_pseudo_register_read): Change return to enum register_status. If reading a raw register indicates the raw register is not valid, return the raw register's status, otherwise, return REG_VALID. * amd64-tdep.c (amd64_pseudo_register_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * arm-tdep.c (arm_neon_quad_read) (arm_pseudo_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * avr-tdep.c (avr_pseudo_register_read): Ditto. * frv-tdep.c (frv_pseudo_register_read): Ditto. * h8300-tdep.c (h8300_pseudo_register_read): Ditto. * hppa-tdep.c (hppa_pseudo_register_read): Ditto. * m32c-tdep.c (m32c_move_reg_t): Change return to enum register_status. (m32c_raw_read, m32c_raw_write, m32c_banked_read) (m32c_banked_write, m32c_sb_read, m32c_sb_write, m32c_part_read) (m32c_part_write, m32c_cat_read, m32c_cat_write) (m32c_r3r2r1r0_read, m32c_r3r2r1r0_write) (m32c_pseudo_register_read): Change return to enum register_status. Adjust. * m68hc11-tdep.c (m68hc11_pseudo_register_read): Change return to enum register_status. Return the register's status. * mep-tdep.c (mep_pseudo_cr32_read): Change return to enum register_status. Return the register's status. (mep_pseudo_cr64_read, mep_pseudo_register_read): Ditto. * mips-tdep.c (mips_pseudo_register_read): Ditto. * mt-tdep.c (mt_pseudo_register_read): Ditto. * rs6000-tdep.c (move_ev_register_func): New typedef. (e500_move_ev_register): Use it. Change return to enum register_status. Return the register's status. (do_regcache_raw_read): New function. (do_regcache_raw_write): New function. (e500_pseudo_register_read): Change return to enum register_status. Return the register's status. Use do_regcache_raw_read. (e500_pseudo_register_write): Adjust. Use do_regcache_raw_write. (dfp_pseudo_register_read): Change return to enum register_status. Return the register's status. (vsx_pseudo_register_read): Ditto. (efpr_pseudo_register_read): Ditto. (rs6000_pseudo_register_read): Ditto. * s390-tdep.c (s390_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh64-tdep.c (pseudo_register_read_portions): New function. (sh64_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * ia64-tdep.c (ia64_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh-tdep.c (pseudo_register_read_portions): New function. (sh_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * sparc-tdep.c (sparc32_pseudo_register_read): Change return to enum register_status. Return the register's status. * sparc64-tdep.c (sparc64_pseudo_register_read): Ditto. * spu-tdep.c (spu_pseudo_register_read_spu) (spu_pseudo_register_read): Ditto. * xtensa-tdep.c (xtensa_register_read_masked) (xtensa_pseudo_register_read): Ditto. * bfin-tdep.c (bfin_pseudo_register_read): Ditto.
2011-03-18 19:38:44 +01:00
status = regcache_raw_read (regcache, gpnum, raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf, 1);
else
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
}
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
}
else if (i386_dword_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->eax_regnum;
/* Extract (always little endian). */
gdb/ * regcache.h (regcache_raw_read, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_signed) (regcache_raw_read_unsigned, regcache_raw_read_part) (regcache_cooked_read, regcache_cooked_read_signed) (regcache_cooked_read_unsigned, regcache_cooked_read_part) (regcache_cooked_read_ftype): Change return to enum register_status. * regcache.c: Include exceptions.h (regcache_save): Adjust to handle REG_UNAVAILABLE registers. (do_cooked_read): Change return to enum register_status. Always forward to regcache_cooked_read. (regcache_raw_read): Change return to enum register_status. If the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_raw_read_signed): Handle non-REG_VALID registers and return the register's status. (regcache_raw_read_unsigned): Ditto. (regcache_cooked_read): Change return to enum register_status. Assert that with read-only regcaches, the register's status must be known. If the regcache is read-only, and the register is not REG_VALID, memset the buffer. Return the register's status. (regcache_cooked_read_signed): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_cooked_read_unsigned): Change return to enum register_status. Handle non-REG_VALID registers and return the register's status. (regcache_xfer_part, regcache_raw_read_part) (regcache_cooked_read_part): Change return to enum register_status. Return the register's status. (regcache_read_pc): Throw NOT_AVAILABLE_ERROR if the register is unavailable. (regcache_dump): Handle unavailable cooked registers. * frame.c (do_frame_register_read): Adjust interface to match regcache_cooked_read_ftype. * gdbarch.sh (pseudo_register_read): Change return to enum register_status. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.h (i386_pseudo_register_read): Change return to enum register_status. * i386-tdep.c (i386_pseudo_register_read): Change return to enum register_status. If reading a raw register indicates the raw register is not valid, return the raw register's status, otherwise, return REG_VALID. * amd64-tdep.c (amd64_pseudo_register_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * arm-tdep.c (arm_neon_quad_read) (arm_pseudo_read): Change return to enum register_status. Handle non-REG_VALID raw registers and return the register's status. * avr-tdep.c (avr_pseudo_register_read): Ditto. * frv-tdep.c (frv_pseudo_register_read): Ditto. * h8300-tdep.c (h8300_pseudo_register_read): Ditto. * hppa-tdep.c (hppa_pseudo_register_read): Ditto. * m32c-tdep.c (m32c_move_reg_t): Change return to enum register_status. (m32c_raw_read, m32c_raw_write, m32c_banked_read) (m32c_banked_write, m32c_sb_read, m32c_sb_write, m32c_part_read) (m32c_part_write, m32c_cat_read, m32c_cat_write) (m32c_r3r2r1r0_read, m32c_r3r2r1r0_write) (m32c_pseudo_register_read): Change return to enum register_status. Adjust. * m68hc11-tdep.c (m68hc11_pseudo_register_read): Change return to enum register_status. Return the register's status. * mep-tdep.c (mep_pseudo_cr32_read): Change return to enum register_status. Return the register's status. (mep_pseudo_cr64_read, mep_pseudo_register_read): Ditto. * mips-tdep.c (mips_pseudo_register_read): Ditto. * mt-tdep.c (mt_pseudo_register_read): Ditto. * rs6000-tdep.c (move_ev_register_func): New typedef. (e500_move_ev_register): Use it. Change return to enum register_status. Return the register's status. (do_regcache_raw_read): New function. (do_regcache_raw_write): New function. (e500_pseudo_register_read): Change return to enum register_status. Return the register's status. Use do_regcache_raw_read. (e500_pseudo_register_write): Adjust. Use do_regcache_raw_write. (dfp_pseudo_register_read): Change return to enum register_status. Return the register's status. (vsx_pseudo_register_read): Ditto. (efpr_pseudo_register_read): Ditto. (rs6000_pseudo_register_read): Ditto. * s390-tdep.c (s390_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh64-tdep.c (pseudo_register_read_portions): New function. (sh64_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * ia64-tdep.c (ia64_pseudo_register_read): Change return to enum register_status. Return the register's status. * sh-tdep.c (pseudo_register_read_portions): New function. (sh_pseudo_register_read): Change return to enum register_status. Use pseudo_register_read_portions. Return the register's status. * sparc-tdep.c (sparc32_pseudo_register_read): Change return to enum register_status. Return the register's status. * sparc64-tdep.c (sparc64_pseudo_register_read): Ditto. * spu-tdep.c (spu_pseudo_register_read_spu) (spu_pseudo_register_read): Ditto. * xtensa-tdep.c (xtensa_register_read_masked) (xtensa_pseudo_register_read): Ditto. * bfin-tdep.c (bfin_pseudo_register_read): Ditto.
2011-03-18 19:38:44 +01:00
status = regcache_raw_read (regcache, gpnum, raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf, 4);
else
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
}
else
i386_pseudo_register_read_into_value (gdbarch, regcache, regnum,
result_value);
return result_value;
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
}
static void
amd64_pseudo_register_write (struct gdbarch *gdbarch,
struct regcache *regcache,
int regnum, const gdb_byte *buf)
{
gdb_byte *raw_buf = (gdb_byte *) alloca (register_size (gdbarch, regnum));
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (i386_byte_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->al_regnum;
if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
{
/* Read ... AH, BH, CH, DH. */
regcache_raw_read (regcache,
gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf + 1, buf, 1);
/* ... Write. */
regcache_raw_write (regcache,
gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
}
else
{
/* Read ... */
regcache_raw_read (regcache, gpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 1);
/* ... Write. */
regcache_raw_write (regcache, gpnum, raw_buf);
}
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
}
else if (i386_dword_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->eax_regnum;
/* Read ... */
regcache_raw_read (regcache, gpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 4);
/* ... Write. */
regcache_raw_write (regcache, gpnum, raw_buf);
}
else
i386_pseudo_register_write (gdbarch, regcache, regnum, buf);
}
/* Implement the 'ax_pseudo_register_collect' gdbarch method. */
static int
amd64_ax_pseudo_register_collect (struct gdbarch *gdbarch,
struct agent_expr *ax, int regnum)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (i386_byte_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->al_regnum;
if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
ax_reg_mask (ax, gpnum - AMD64_NUM_LOWER_BYTE_REGS);
else
ax_reg_mask (ax, gpnum);
return 0;
}
else if (i386_dword_regnum_p (gdbarch, regnum))
{
int gpnum = regnum - tdep->eax_regnum;
ax_reg_mask (ax, gpnum);
return 0;
}
else
return i386_ax_pseudo_register_collect (gdbarch, ax, regnum);
}
/* Register classes as defined in the psABI. */
enum amd64_reg_class
{
AMD64_INTEGER,
AMD64_SSE,
AMD64_SSEUP,
AMD64_X87,
AMD64_X87UP,
AMD64_COMPLEX_X87,
AMD64_NO_CLASS,
AMD64_MEMORY
};
/* Return the union class of CLASS1 and CLASS2. See the psABI for
details. */
static enum amd64_reg_class
amd64_merge_classes (enum amd64_reg_class class1, enum amd64_reg_class class2)
{
/* Rule (a): If both classes are equal, this is the resulting class. */
if (class1 == class2)
return class1;
/* Rule (b): If one of the classes is NO_CLASS, the resulting class
is the other class. */
if (class1 == AMD64_NO_CLASS)
return class2;
if (class2 == AMD64_NO_CLASS)
return class1;
/* Rule (c): If one of the classes is MEMORY, the result is MEMORY. */
if (class1 == AMD64_MEMORY || class2 == AMD64_MEMORY)
return AMD64_MEMORY;
/* Rule (d): If one of the classes is INTEGER, the result is INTEGER. */
if (class1 == AMD64_INTEGER || class2 == AMD64_INTEGER)
return AMD64_INTEGER;
/* Rule (e): If one of the classes is X87, X87UP, COMPLEX_X87 class,
MEMORY is used as class. */
if (class1 == AMD64_X87 || class1 == AMD64_X87UP
|| class1 == AMD64_COMPLEX_X87 || class2 == AMD64_X87
|| class2 == AMD64_X87UP || class2 == AMD64_COMPLEX_X87)
return AMD64_MEMORY;
/* Rule (f): Otherwise class SSE is used. */
return AMD64_SSE;
}
static void amd64_classify (struct type *type, enum amd64_reg_class theclass[2]);
/* Return non-zero if TYPE is a non-POD structure or union type. */
static int
amd64_non_pod_p (struct type *type)
{
/* ??? A class with a base class certainly isn't POD, but does this
catch all non-POD structure types? */
if (TYPE_CODE (type) == TYPE_CODE_STRUCT && TYPE_N_BASECLASSES (type) > 0)
return 1;
return 0;
}
/* Classify TYPE according to the rules for aggregate (structures and
arrays) and union types, and store the result in CLASS. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static void
amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
{
/* 1. If the size of an object is larger than two eightbytes, or in
C++, is a non-POD structure or union type, or contains
unaligned fields, it has class memory. */
if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type))
{
theclass[0] = theclass[1] = AMD64_MEMORY;
return;
}
/* 2. Both eightbytes get initialized to class NO_CLASS. */
theclass[0] = theclass[1] = AMD64_NO_CLASS;
/* 3. Each field of an object is classified recursively so that
always two fields are considered. The resulting class is
calculated according to the classes of the fields in the
eightbyte: */
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
struct type *subtype = check_typedef (TYPE_TARGET_TYPE (type));
/* All fields in an array have the same type. */
amd64_classify (subtype, theclass);
if (TYPE_LENGTH (type) > 8 && theclass[1] == AMD64_NO_CLASS)
theclass[1] = theclass[0];
}
else
{
int i;
/* Structure or union. */
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
for (i = 0; i < TYPE_NFIELDS (type); i++)
{
struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
int pos = TYPE_FIELD_BITPOS (type, i) / 64;
enum amd64_reg_class subclass[2];
int bitsize = TYPE_FIELD_BITSIZE (type, i);
int endpos;
if (bitsize == 0)
bitsize = TYPE_LENGTH (subtype) * 8;
endpos = (TYPE_FIELD_BITPOS (type, i) + bitsize - 1) / 64;
/* Ignore static fields. */
if (field_is_static (&TYPE_FIELD (type, i)))
continue;
gdb_assert (pos == 0 || pos == 1);
amd64_classify (subtype, subclass);
theclass[pos] = amd64_merge_classes (theclass[pos], subclass[0]);
if (bitsize <= 64 && pos == 0 && endpos == 1)
/* This is a bit of an odd case: We have a field that would
normally fit in one of the two eightbytes, except that
it is placed in a way that this field straddles them.
This has been seen with a structure containing an array.
The ABI is a bit unclear in this case, but we assume that
this field's class (stored in subclass[0]) must also be merged
into class[1]. In other words, our field has a piece stored
in the second eight-byte, and thus its class applies to
the second eight-byte as well.
In the case where the field length exceeds 8 bytes,
it should not be necessary to merge the field class
into class[1]. As LEN > 8, subclass[1] is necessarily
different from AMD64_NO_CLASS. If subclass[1] is equal
to subclass[0], then the normal class[1]/subclass[1]
merging will take care of everything. For subclass[1]
to be different from subclass[0], I can only see the case
where we have a SSE/SSEUP or X87/X87UP pair, which both
use up all 16 bytes of the aggregate, and are already
handled just fine (because each portion sits on its own
8-byte). */
theclass[1] = amd64_merge_classes (theclass[1], subclass[0]);
if (pos == 0)
theclass[1] = amd64_merge_classes (theclass[1], subclass[1]);
}
}
/* 4. Then a post merger cleanup is done: */
/* Rule (a): If one of the classes is MEMORY, the whole argument is
passed in memory. */
if (theclass[0] == AMD64_MEMORY || theclass[1] == AMD64_MEMORY)
theclass[0] = theclass[1] = AMD64_MEMORY;
/* Rule (b): If SSEUP is not preceded by SSE, it is converted to
SSE. */
if (theclass[0] == AMD64_SSEUP)
theclass[0] = AMD64_SSE;
if (theclass[1] == AMD64_SSEUP && theclass[0] != AMD64_SSE)
theclass[1] = AMD64_SSE;
}
/* Classify TYPE, and store the result in CLASS. */
static void
amd64_classify (struct type *type, enum amd64_reg_class theclass[2])
{
enum type_code code = TYPE_CODE (type);
int len = TYPE_LENGTH (type);
theclass[0] = theclass[1] = AMD64_NO_CLASS;
/* Arguments of types (signed and unsigned) _Bool, char, short, int,
long, long long, and pointers are in the INTEGER class. Similarly,
range types, used by languages such as Ada, are also in the INTEGER
class. */
if ((code == TYPE_CODE_INT || code == TYPE_CODE_ENUM
|| code == TYPE_CODE_BOOL || code == TYPE_CODE_RANGE
|| code == TYPE_CODE_CHAR
|| code == TYPE_CODE_PTR || code == TYPE_CODE_REF)
&& (len == 1 || len == 2 || len == 4 || len == 8))
theclass[0] = AMD64_INTEGER;
/* Arguments of types float, double, _Decimal32, _Decimal64 and __m64
are in class SSE. */
else if ((code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
&& (len == 4 || len == 8))
/* FIXME: __m64 . */
theclass[0] = AMD64_SSE;
/* Arguments of types __float128, _Decimal128 and __m128 are split into
two halves. The least significant ones belong to class SSE, the most
significant one to class SSEUP. */
else if (code == TYPE_CODE_DECFLOAT && len == 16)
/* FIXME: __float128, __m128. */
theclass[0] = AMD64_SSE, theclass[1] = AMD64_SSEUP;
/* The 64-bit mantissa of arguments of type long double belongs to
class X87, the 16-bit exponent plus 6 bytes of padding belongs to
class X87UP. */
else if (code == TYPE_CODE_FLT && len == 16)
/* Class X87 and X87UP. */
theclass[0] = AMD64_X87, theclass[1] = AMD64_X87UP;
/* Arguments of complex T where T is one of the types float or
double get treated as if they are implemented as:
struct complexT {
T real;
T imag;
};
*/
else if (code == TYPE_CODE_COMPLEX && len == 8)
theclass[0] = AMD64_SSE;
else if (code == TYPE_CODE_COMPLEX && len == 16)
theclass[0] = theclass[1] = AMD64_SSE;
/* A variable of type complex long double is classified as type
COMPLEX_X87. */
else if (code == TYPE_CODE_COMPLEX && len == 32)
theclass[0] = AMD64_COMPLEX_X87;
/* Aggregates. */
else if (code == TYPE_CODE_ARRAY || code == TYPE_CODE_STRUCT
|| code == TYPE_CODE_UNION)
amd64_classify_aggregate (type, theclass);
}
static enum return_value_convention
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 16:35:09 +02:00
amd64_return_value (struct gdbarch *gdbarch, struct value *function,
doc/ChangeLog: -------------- * gdb.texinfo (Set SH Calling convention): New @item. (Show SH Calling convention): Ditto. ChangeLog: ---------- * NEWS: Add information on calling convention and new SH CLI options. * sh-tdep.c (sh_cc_gcc): New static string. (sh_cc_renesas): Ditto. (sh_cc_enum): New static string array. (sh_active_calling_convention): New static string pointer denoting active user chosen ABI. (sh_is_renesas_calling_convention): New function to return function specific ABI, or user choice if necessary. (sh_use_struct_convention): Rename first argument and turn around its meaning. Check for renesas ABI and return accordingly. (sh_use_struct_convention_nofpu): New function. (sh_next_flt_argreg): Get function type as third parameter. Check for renesas ABI and choose floating registers accordingly. (sh_push_dummy_call_fpu): Check for ABI and choose argument slot and struct return slot accordingly. (sh_push_dummy_call_nofpu): Ditto. (sh_return_value_nofpu): Call sh_use_struct_convention_nofpu from here. Evaluate ABI and give to sh_use_struct_convention_nofpu. (sh_return_value_fpu): Evaluate ABI and give to sh_use_struct_convention. (show_sh_command): New function. (set_sh_command): Ditto. (_initialize_sh_tdep): Initialize `set/show sh calling-convention CLI command. * gdbarch.sh (return_value): Add func_type argument. * gdbarch.c: Regenerate. * gdbarch.h: Ditto. * eval.c (evaluate_subexp_standard): Rename local variable value_type to val_type so as not to collide with value_type function. Call using_struct_return with additional function type argument. * infcall.c (call_function_by_hand): Call using_struct_return and gdbarch_return_value with additional function type argument. * infcmd.c (print_return_value): Take addition func_type argument. Call gdbarch_return_value with additional function type argument. (finish_command_continuation): Call print_return_value with additional function type argument. (finish_command): Ditto. * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with additional function type argument. * stack.c (return_command): Call using_struct_return and gdbarch_return_value with additional function type argument. * value.c (using_struct_return): Take additional function type argument. * value.h (using_struct_return): Accommodate declaration. * alpha-tdep.c (alpha_return_value): Add func_type argument. * amd64-tdep.c (amd64_return_value): Ditto. * arm-tdep.c (arm_return_value): Ditto. * avr-tdep.c (avr_return_value): Ditto. * cris-tdep.c (cris_return_value): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_return_value): Ditto. (h8300h_return_value): Ditto. * hppa-tdep.c (hppa32_return_value): Ditto. (hppa64_return_value): Ditto. * i386-tdep.c (i386_return_value): Ditto. * ia64-tdep.c (ia64_return_value): Ditto. * iq2000-tdep.c (iq2000_return_value): Ditto. * m32c-tdep.c (m32c_return_value): Ditto. * m32r-tdep.c (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_return_value): Ditto. * m68k-tdep.c (m68k_return_value): Ditto. (m68k_svr4_return_value): Ditto. * m88k-tdep.c (m88k_return_value): Ditto. * mep-tdep.c (mep_return_value): Ditto. * mips-tdep.c (mips_eabi_return_value): Ditto. (mips_n32n64_return_value): Ditto. (mips_o32_return_value): Ditto. (mips_o64_return_value): Ditto. * mn10300-tdep.c (mn10300_return_value): Ditto. * mt-tdep.c (mt_return_value): Ditto. * ppc-linux-tdep.c (ppc_linux_return_value): Ditto. * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto. (ppc_sysv_abi_broken_return_value): Ditto. (ppc64_sysv_abi_return_value): Ditto. * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto. * rs6000-tdep.c (rs6000_return_value): Ditto. * s390-tdep.c (s390_return_value): Ditto. * score-tdep.c (score_return_value): Ditto. * sh-tdep.c (sh_return_value_nofpu): Ditto. (sh_return_value_fpu): Ditto. * sh64-tdep.c (sh64_return_value): Ditto. * sparc-tdep.c (sparc32_return_value): Ditto. * sparc64-tdep.c (sparc64_return_value): Ditto. * spu-tdep.c (spu_return_value): Ditto. * v850-tdep.c (v850_return_value): Ditto. * vax-tdep.c (vax_return_value): Ditto. * xstormy16-tdep.c (xstormy16_return_value): Ditto. * xtensa-tdep.c (xtensa_return_value): Ditto. * gdbtypes.h (struct type): Add calling_convention member. * dwarf2read.c (read_subroutine_type): Add calling convention read from DW_AT_calling_convention attribute to function type.
2008-04-22 13:03:42 +02:00
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
enum amd64_reg_class theclass[2];
int len = TYPE_LENGTH (type);
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
int integer_reg = 0;
int sse_reg = 0;
int i;
gdb_assert (!(readbuf && writebuf));
/* 1. Classify the return type with the classification algorithm. */
amd64_classify (type, theclass);
/* 2. If the type has class MEMORY, then the caller provides space
for the return value and passes the address of this storage in
2011-01-07 Michael Snyder <msnyder@vmware.com> * ada-lang.c: Comment cleanup, mostly periods and spaces. * ada-lang.h: Ditto. * ada-tasks.c: Ditto. * ada-valprint.c: Ditto. * aix-threads.c: Ditto. * alpha-linux-nat.c: Ditto. * alpha-linux-tdep.c: Ditto. * alpha-mdebug-tdep.c: Ditto. * alpha-nat.c: Ditto. * alpha-osf1-tdep.c: Ditto. * alpha-tdep.c: Ditto. * alphabsd-nat.c: Ditto. * alphabsd-tdep.c: Ditto. * amd64-darwin-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * amd64-sol2-tdep.c: Ditto. * amd64-tdep.c: Ditto. * amd64-fbsd-tdep.c: Ditto. * amd64-nbsd-tdep.c: Ditto. * amd64-obsd-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * arm-tdep.c: Ditto. * arm-tdep.h: Ditto. * armnbsd-nat.c: Ditto. * avr-tdep.c: Ditto. * bfin-tdep.c: Ditto. * bsd-kvm.c: Ditto. * c-typeprintc: Ditto. * c-valprint.c: Ditto. * coff-pe-read.h: Ditto. * coffreead.c: Ditto. * cris-tdep.c: Ditto. * d-lang.c: Ditto. * darwin-nat-info.c: Ditto. * darwin-nat.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * dcache.c: Ditto. * dcache.h: Ditto. * dec-thread.c: Ditto. * defs.h: Ditto. * demangle.c: Ditto. * dicos-tdep.c: Ditto. * dictionary.c: Ditto. * dictionary.h: Ditto. * dink32-rom.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dsrec.c: Ditto. * dummy-frame.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * environ.c: Ditto. * eval.c: Ditto. * event-top.h: Ditto. * exceptions.c: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-exp.y: Ditto. * f-lang.c: Ditto. * f-lang.h: Ditto. * f-typeprint.c: Ditto. * f-valprint.c: Ditto. * fbsd-nat.c: Ditto. * findvar.c: Ditto. * fork-child.c: Ditto. * frame.c: Ditto. * frame.h: Ditto. * frv-linux-tdep.c: Ditto. * frv-tdep.c: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_string.h: Ditto. * gdb_thread_db.h: Ditto. * gdb_wait.h: Ditto. * gdbarch.sh: Ditto. * gdbcore.h: Ditto. * gdbthread.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * gnu-nat.c: Ditto. * gnu-nat.h: Ditto. * gnu-v2-abi.c: Ditto. * gnu-v3-abi.c: Ditto. * go32-nat.c: Ditto. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate.
2011-01-07 20:36:19 +01:00
%rdi as if it were the first argument to the function. In effect,
this address becomes a hidden first argument.
On return %rax will contain the address that has been passed in
by the caller in %rdi. */
if (theclass[0] == AMD64_MEMORY)
{
/* As indicated by the comment above, the ABI guarantees that we
can always find the return value just after the function has
returned. */
if (readbuf)
{
ULONGEST addr;
regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &addr);
read_memory (addr, readbuf, TYPE_LENGTH (type));
}
return RETURN_VALUE_ABI_RETURNS_ADDRESS;
}
/* 8. If the class is COMPLEX_X87, the real part of the value is
returned in %st0 and the imaginary part in %st1. */
if (theclass[0] == AMD64_COMPLEX_X87)
{
if (readbuf)
{
regcache_raw_read (regcache, AMD64_ST0_REGNUM, readbuf);
regcache_raw_read (regcache, AMD64_ST1_REGNUM, readbuf + 16);
}
if (writebuf)
{
i387_return_value (gdbarch, regcache);
regcache_raw_write (regcache, AMD64_ST0_REGNUM, writebuf);
regcache_raw_write (regcache, AMD64_ST1_REGNUM, writebuf + 16);
/* Fix up the tag word such that both %st(0) and %st(1) are
marked as valid. */
regcache_raw_write_unsigned (regcache, AMD64_FTAG_REGNUM, 0xfff);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
gdb_assert (theclass[1] != AMD64_MEMORY);
gdb_assert (len <= 16);
for (i = 0; len > 0; i++, len -= 8)
{
int regnum = -1;
int offset = 0;
switch (theclass[i])
{
case AMD64_INTEGER:
/* 3. If the class is INTEGER, the next available register
of the sequence %rax, %rdx is used. */
regnum = integer_regnum[integer_reg++];
break;
case AMD64_SSE:
/* 4. If the class is SSE, the next available SSE register
of the sequence %xmm0, %xmm1 is used. */
regnum = sse_regnum[sse_reg++];
break;
case AMD64_SSEUP:
/* 5. If the class is SSEUP, the eightbyte is passed in the
upper half of the last used SSE register. */
gdb_assert (sse_reg > 0);
regnum = sse_regnum[sse_reg - 1];
offset = 8;
break;
case AMD64_X87:
/* 6. If the class is X87, the value is returned on the X87
stack in %st0 as 80-bit x87 number. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
regnum = AMD64_ST0_REGNUM;
if (writebuf)
i387_return_value (gdbarch, regcache);
break;
case AMD64_X87UP:
/* 7. If the class is X87UP, the value is returned together
with the previous X87 value in %st0. */
gdb_assert (i > 0 && theclass[0] == AMD64_X87);
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
regnum = AMD64_ST0_REGNUM;
offset = 8;
len = 2;
break;
case AMD64_NO_CLASS:
continue;
default:
gdb_assert (!"Unexpected register class.");
}
gdb_assert (regnum != -1);
if (readbuf)
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 20:55:17 +02:00
regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
readbuf + i * 8);
if (writebuf)
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 20:55:17 +02:00
regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
writebuf + i * 8);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
static CORE_ADDR
amd64_push_arguments (struct regcache *regcache, int nargs,
struct value **args, CORE_ADDR sp, int struct_return)
{
static int integer_regnum[] =
{
AMD64_RDI_REGNUM, /* %rdi */
AMD64_RSI_REGNUM, /* %rsi */
AMD64_RDX_REGNUM, /* %rdx */
AMD64_RCX_REGNUM, /* %rcx */
AMD64_R8_REGNUM, /* %r8 */
AMD64_R9_REGNUM /* %r9 */
};
static int sse_regnum[] =
{
/* %xmm0 ... %xmm7 */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM,
AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3,
AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
};
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
struct value **stack_args = XALLOCAVEC (struct value *, nargs);
int num_stack_args = 0;
int num_elements = 0;
int element = 0;
int integer_reg = 0;
int sse_reg = 0;
int i;
/* Reserve a register for the "hidden" argument. */
if (struct_return)
integer_reg++;
for (i = 0; i < nargs; i++)
{
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
enum amd64_reg_class theclass[2];
int needed_integer_regs = 0;
int needed_sse_regs = 0;
int j;
/* Classify argument. */
amd64_classify (type, theclass);
/* Calculate the number of integer and SSE registers needed for
this argument. */
for (j = 0; j < 2; j++)
{
if (theclass[j] == AMD64_INTEGER)
needed_integer_regs++;
else if (theclass[j] == AMD64_SSE)
needed_sse_regs++;
}
/* Check whether enough registers are available, and if the
argument should be passed in registers at all. */
if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
|| sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
|| (needed_integer_regs == 0 && needed_sse_regs == 0))
{
/* The argument will be passed on the stack. */
num_elements += ((len + 7) / 8);
stack_args[num_stack_args++] = args[i];
}
else
{
/* The argument will be passed in registers. */
const gdb_byte *valbuf = value_contents (args[i]);
gdb_byte buf[8];
gdb_assert (len <= 16);
for (j = 0; len > 0; j++, len -= 8)
{
int regnum = -1;
int offset = 0;
switch (theclass[j])
{
case AMD64_INTEGER:
regnum = integer_regnum[integer_reg++];
break;
case AMD64_SSE:
regnum = sse_regnum[sse_reg++];
break;
case AMD64_SSEUP:
gdb_assert (sse_reg > 0);
regnum = sse_regnum[sse_reg - 1];
offset = 8;
break;
default:
gdb_assert (!"Unexpected register class.");
}
gdb_assert (regnum != -1);
memset (buf, 0, sizeof buf);
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 20:55:17 +02:00
memcpy (buf, valbuf + j * 8, std::min (len, 8));
regcache_raw_write_part (regcache, regnum, offset, 8, buf);
}
}
}
/* Allocate space for the arguments on the stack. */
sp -= num_elements * 8;
/* The psABI says that "The end of the input argument area shall be
aligned on a 16 byte boundary." */
sp &= ~0xf;
/* Write out the arguments to the stack. */
for (i = 0; i < num_stack_args; i++)
{
struct type *type = value_type (stack_args[i]);
const gdb_byte *valbuf = value_contents (stack_args[i]);
int len = TYPE_LENGTH (type);
write_memory (sp + element * 8, valbuf, len);
element += ((len + 7) / 8);
}
/* The psABI says that "For calls that may call functions that use
varargs or stdargs (prototype-less calls or calls to functions
containing ellipsis (...) in the declaration) %al is used as
hidden argument to specify the number of SSE registers used. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
regcache_raw_write_unsigned (regcache, AMD64_RAX_REGNUM, sse_reg);
return sp;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static CORE_ADDR
2004-06-06 Randolph Chung <tausq@debian.org> * gdbarch.sh (PUSH_DUMMY_CALL): Change CORE_ADDR func_addr argument to struct value *function. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * infcall.c (call_function_by_hand): Pass entire function value to push_dummy_call. * Makefile.in (alpha-tdep.o, frv-tdep.o, ia64-tdep.o, mips-tdep.o) (ppc-sysv-tdep.o, rs6000-tdep.o): Update dependencies. * alpha-tdep.c (alpha_push_dummy_call): Update call signature. * amd64-tdep.c (amd64_push_dummy_call): Likewise. * arm-tdep.c (arm_push_dummy_call): Likewise. * avr-tdep.c (avr_push_dummy_call): Likewise. * cris-tdep.c (cris_push_dummy_call): Likewise. * d10v-tdep.c (d10v_push_dummy_call): Likewise. * frv-tdep.c (frv_push_dummy_call): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (hppa32_push_dummy_call) (hppa64_push_dummy_call): Likewise. * i386-tdep.c (i386_push_dummy_call): Likewise. * ia64-tdep.c (ia64_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. * m88k-tdep.c (m88k_push_dummy_call): Likewise. * mips-tdep.c (mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call) (mips_o32_push_dummy_call, mips_o64_push_dummy_call): Likewise. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call) (ppc64_sysv_abi_push_dummy_call): Likewise. * ppc-tdep.h (ppc_sysv_abi_push_dummy_call) (ppc64_sysv_abi_push_dummy_call): Likewise. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * s390-tdep.c (s390_push_dummy_call): Likewise. * sh-tdep.c (sh_push_dummy_call_fpu) (sh_push_dummy_call_nofpu): Likewise. * sparc-tdep.c (sparc32_push_dummy_call): Likewise. * sparc64-tdep.c (sparc64_push_dummy_call): Likewise. * vax-tdep.c (vax_push_dummy_call): Likewise.
2004-06-07 04:02:55 +02:00
amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_byte buf[8];
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Pass arguments. */
sp = amd64_push_arguments (regcache, nargs, args, sp, struct_return);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Pass "hidden" argument". */
if (struct_return)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
store_unsigned_integer (buf, 8, byte_order, struct_addr);
regcache_cooked_write (regcache, AMD64_RDI_REGNUM, buf);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
/* Store return address. */
sp -= 8;
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
store_unsigned_integer (buf, 8, byte_order, bp_addr);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
write_memory (sp, buf, 8);
/* Finally, update the stack pointer... */
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
store_unsigned_integer (buf, 8, byte_order, sp);
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* ...and fake a frame pointer. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return sp + 16;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Displaced instruction handling. */
/* A partially decoded instruction.
This contains enough details for displaced stepping purposes. */
struct amd64_insn
{
/* The number of opcode bytes. */
int opcode_len;
/* The offset of the rex prefix or -1 if not present. */
int rex_offset;
/* The offset to the first opcode byte. */
int opcode_offset;
/* The offset to the modrm byte or -1 if not present. */
int modrm_offset;
/* The raw instruction. */
gdb_byte *raw_insn;
};
struct displaced_step_closure
{
/* For rip-relative insns, saved copy of the reg we use instead of %rip. */
int tmp_used;
int tmp_regno;
ULONGEST tmp_save;
/* Details of the instruction. */
struct amd64_insn insn_details;
/* Amount of space allocated to insn_buf. */
int max_len;
/* The possibly modified insn.
This is a variable-length field. */
gdb_byte insn_buf[1];
};
/* WARNING: Keep onebyte_has_modrm, twobyte_has_modrm in sync with
../opcodes/i386-dis.c (until libopcodes exports them, or an alternative,
at which point delete these in favor of libopcodes' versions). */
static const unsigned char onebyte_has_modrm[256] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
/* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
/* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
/* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
/* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
/* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
/* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
/* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
/* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
/* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
/* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
/* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
/* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
/* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
/* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
/* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
/* ------------------------------- */
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
};
static const unsigned char twobyte_has_modrm[256] = {
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* ------------------------------- */
/* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
/* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
/* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
/* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
/* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
/* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
/* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
/* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
/* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
/* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
/* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
/* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
/* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
/* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
/* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
/* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
/* ------------------------------- */
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
};
static int amd64_syscall_p (const struct amd64_insn *insn, int *lengthp);
static int
rex_prefix_p (gdb_byte pfx)
{
return REX_PREFIX_P (pfx);
}
/* Skip the legacy instruction prefixes in INSN.
We assume INSN is properly sentineled so we don't have to worry
about falling off the end of the buffer. */
static gdb_byte *
amd64_skip_prefixes (gdb_byte *insn)
{
while (1)
{
switch (*insn)
{
case DATA_PREFIX_OPCODE:
case ADDR_PREFIX_OPCODE:
case CS_PREFIX_OPCODE:
case DS_PREFIX_OPCODE:
case ES_PREFIX_OPCODE:
case FS_PREFIX_OPCODE:
case GS_PREFIX_OPCODE:
case SS_PREFIX_OPCODE:
case LOCK_PREFIX_OPCODE:
case REPE_PREFIX_OPCODE:
case REPNE_PREFIX_OPCODE:
++insn;
continue;
default:
break;
}
break;
}
return insn;
}
/* Return an integer register (other than RSP) that is unused as an input
operand in INSN.
In order to not require adding a rex prefix if the insn doesn't already
have one, the result is restricted to RAX ... RDI, sans RSP.
The register numbering of the result follows architecture ordering,
e.g. RDI = 7. */
static int
amd64_get_unused_input_int_reg (const struct amd64_insn *details)
{
/* 1 bit for each reg */
int used_regs_mask = 0;
/* There can be at most 3 int regs used as inputs in an insn, and we have
7 to choose from (RAX ... RDI, sans RSP).
This allows us to take a conservative approach and keep things simple.
E.g. By avoiding RAX, we don't have to specifically watch for opcodes
that implicitly specify RAX. */
/* Avoid RAX. */
used_regs_mask |= 1 << EAX_REG_NUM;
/* Similarily avoid RDX, implicit operand in divides. */
used_regs_mask |= 1 << EDX_REG_NUM;
/* Avoid RSP. */
used_regs_mask |= 1 << ESP_REG_NUM;
/* If the opcode is one byte long and there's no ModRM byte,
assume the opcode specifies a register. */
if (details->opcode_len == 1 && details->modrm_offset == -1)
used_regs_mask |= 1 << (details->raw_insn[details->opcode_offset] & 7);
/* Mark used regs in the modrm/sib bytes. */
if (details->modrm_offset != -1)
{
int modrm = details->raw_insn[details->modrm_offset];
int mod = MODRM_MOD_FIELD (modrm);
int reg = MODRM_REG_FIELD (modrm);
int rm = MODRM_RM_FIELD (modrm);
int have_sib = mod != 3 && rm == 4;
/* Assume the reg field of the modrm byte specifies a register. */
used_regs_mask |= 1 << reg;
if (have_sib)
{
int base = SIB_BASE_FIELD (details->raw_insn[details->modrm_offset + 1]);
int idx = SIB_INDEX_FIELD (details->raw_insn[details->modrm_offset + 1]);
used_regs_mask |= 1 << base;
used_regs_mask |= 1 << idx;
}
else
{
used_regs_mask |= 1 << rm;
}
}
gdb_assert (used_regs_mask < 256);
gdb_assert (used_regs_mask != 255);
/* Finally, find a free reg. */
{
int i;
for (i = 0; i < 8; ++i)
{
if (! (used_regs_mask & (1 << i)))
return i;
}
/* We shouldn't get here. */
internal_error (__FILE__, __LINE__, _("unable to find free reg"));
}
}
/* Extract the details of INSN that we need. */
static void
amd64_get_insn_details (gdb_byte *insn, struct amd64_insn *details)
{
gdb_byte *start = insn;
int need_modrm;
details->raw_insn = insn;
details->opcode_len = -1;
details->rex_offset = -1;
details->opcode_offset = -1;
details->modrm_offset = -1;
/* Skip legacy instruction prefixes. */
insn = amd64_skip_prefixes (insn);
/* Skip REX instruction prefix. */
if (rex_prefix_p (*insn))
{
details->rex_offset = insn - start;
++insn;
}
details->opcode_offset = insn - start;
if (*insn == TWO_BYTE_OPCODE_ESCAPE)
{
/* Two or three-byte opcode. */
++insn;
need_modrm = twobyte_has_modrm[*insn];
/* Check for three-byte opcode. */
switch (*insn)
{
case 0x24:
case 0x25:
case 0x38:
case 0x3a:
case 0x7a:
case 0x7b:
++insn;
details->opcode_len = 3;
break;
default:
details->opcode_len = 2;
break;
}
}
else
{
/* One-byte opcode. */
need_modrm = onebyte_has_modrm[*insn];
details->opcode_len = 1;
}
if (need_modrm)
{
++insn;
details->modrm_offset = insn - start;
}
}
/* Update %rip-relative addressing in INSN.
%rip-relative addressing only uses a 32-bit displacement.
32 bits is not enough to be guaranteed to cover the distance between where
the real instruction is and where its copy is.
Convert the insn to use base+disp addressing.
We set base = pc + insn_length so we can leave disp unchanged. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static void
fixup_riprel (struct gdbarch *gdbarch, struct displaced_step_closure *dsc,
CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
{
const struct amd64_insn *insn_details = &dsc->insn_details;
int modrm_offset = insn_details->modrm_offset;
gdb_byte *insn = insn_details->raw_insn + modrm_offset;
CORE_ADDR rip_base;
int insn_length;
int arch_tmp_regno, tmp_regno;
ULONGEST orig_value;
/* %rip+disp32 addressing mode, displacement follows ModRM byte. */
++insn;
/* Compute the rip-relative address. */
insn_length = gdb_buffered_insn_length (gdbarch, dsc->insn_buf,
dsc->max_len, from);
rip_base = from + insn_length;
/* We need a register to hold the address.
Pick one not used in the insn.
NOTE: arch_tmp_regno uses architecture ordering, e.g. RDI = 7. */
arch_tmp_regno = amd64_get_unused_input_int_reg (insn_details);
tmp_regno = amd64_arch_reg_to_regnum (arch_tmp_regno);
/* REX.B should be unset as we were using rip-relative addressing,
but ensure it's unset anyway, tmp_regno is not r8-r15. */
if (insn_details->rex_offset != -1)
dsc->insn_buf[insn_details->rex_offset] &= ~REX_B;
regcache_cooked_read_unsigned (regs, tmp_regno, &orig_value);
dsc->tmp_regno = tmp_regno;
dsc->tmp_save = orig_value;
dsc->tmp_used = 1;
/* Convert the ModRM field to be base+disp. */
dsc->insn_buf[modrm_offset] &= ~0xc7;
dsc->insn_buf[modrm_offset] |= 0x80 + arch_tmp_regno;
regcache_cooked_write_unsigned (regs, tmp_regno, rip_base);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog, "displaced: %%rip-relative addressing used.\n"
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
"displaced: using temp reg %d, old value %s, new value %s\n",
dsc->tmp_regno, paddress (gdbarch, dsc->tmp_save),
paddress (gdbarch, rip_base));
}
static void
fixup_displaced_copy (struct gdbarch *gdbarch,
struct displaced_step_closure *dsc,
CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
{
const struct amd64_insn *details = &dsc->insn_details;
if (details->modrm_offset != -1)
{
gdb_byte modrm = details->raw_insn[details->modrm_offset];
if ((modrm & 0xc7) == 0x05)
{
/* The insn uses rip-relative addressing.
Deal with it. */
fixup_riprel (gdbarch, dsc, from, to, regs);
}
}
}
struct displaced_step_closure *
amd64_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
int len = gdbarch_max_insn_length (gdbarch);
/* Extra space for sentinels so fixup_{riprel,displaced_copy} don't have to
continually watch for running off the end of the buffer. */
int fixup_sentinel_space = len;
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
struct displaced_step_closure *dsc
= ((struct displaced_step_closure *)
xmalloc (sizeof (*dsc) + len + fixup_sentinel_space));
gdb_byte *buf = &dsc->insn_buf[0];
struct amd64_insn *details = &dsc->insn_details;
dsc->tmp_used = 0;
dsc->max_len = len + fixup_sentinel_space;
read_memory (from, buf, len);
/* Set up the sentinel space so we don't have to worry about running
off the end of the buffer. An excessive number of leading prefixes
could otherwise cause this. */
memset (buf + len, 0, fixup_sentinel_space);
amd64_get_insn_details (buf, details);
/* GDB may get control back after the insn after the syscall.
Presumably this is a kernel bug.
If this is a syscall, make sure there's a nop afterwards. */
{
int syscall_length;
if (amd64_syscall_p (details, &syscall_length))
buf[details->opcode_offset + syscall_length] = NOP_OPCODE;
}
/* Modify the insn to cope with the address where it will be executed from.
In particular, handle any rip-relative addressing. */
fixup_displaced_copy (gdbarch, dsc, from, to, regs);
write_memory (to, buf, len);
if (debug_displaced)
{
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
fprintf_unfiltered (gdb_stdlog, "displaced: copy %s->%s: ",
paddress (gdbarch, from), paddress (gdbarch, to));
displaced_step_dump_bytes (gdb_stdlog, buf, len);
}
return dsc;
}
static int
amd64_absolute_jmp_p (const struct amd64_insn *details)
{
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
if (insn[0] == 0xff)
{
/* jump near, absolute indirect (/4) */
if ((insn[1] & 0x38) == 0x20)
return 1;
/* jump far, absolute indirect (/5) */
if ((insn[1] & 0x38) == 0x28)
return 1;
}
return 0;
}
/* Return non-zero if the instruction DETAILS is a jump, zero otherwise. */
static int
amd64_jmp_p (const struct amd64_insn *details)
{
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
/* jump short, relative. */
if (insn[0] == 0xeb)
return 1;
/* jump near, relative. */
if (insn[0] == 0xe9)
return 1;
return amd64_absolute_jmp_p (details);
}
static int
amd64_absolute_call_p (const struct amd64_insn *details)
{
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
if (insn[0] == 0xff)
{
/* Call near, absolute indirect (/2) */
if ((insn[1] & 0x38) == 0x10)
return 1;
/* Call far, absolute indirect (/3) */
if ((insn[1] & 0x38) == 0x18)
return 1;
}
return 0;
}
static int
amd64_ret_p (const struct amd64_insn *details)
{
/* NOTE: gcc can emit "repz ; ret". */
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
switch (insn[0])
{
case 0xc2: /* ret near, pop N bytes */
case 0xc3: /* ret near */
case 0xca: /* ret far, pop N bytes */
case 0xcb: /* ret far */
case 0xcf: /* iret */
return 1;
default:
return 0;
}
}
static int
amd64_call_p (const struct amd64_insn *details)
{
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
if (amd64_absolute_call_p (details))
return 1;
/* call near, relative */
if (insn[0] == 0xe8)
return 1;
return 0;
}
/* Return non-zero if INSN is a system call, and set *LENGTHP to its
length in bytes. Otherwise, return zero. */
static int
amd64_syscall_p (const struct amd64_insn *details, int *lengthp)
{
const gdb_byte *insn = &details->raw_insn[details->opcode_offset];
if (insn[0] == 0x0f && insn[1] == 0x05)
{
*lengthp = 2;
return 1;
}
return 0;
}
/* Classify the instruction at ADDR using PRED.
Throw an error if the memory can't be read. */
static int
amd64_classify_insn_at (struct gdbarch *gdbarch, CORE_ADDR addr,
int (*pred) (const struct amd64_insn *))
{
struct amd64_insn details;
gdb_byte *buf;
int len, classification;
len = gdbarch_max_insn_length (gdbarch);
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
buf = (gdb_byte *) alloca (len);
read_code (addr, buf, len);
amd64_get_insn_details (buf, &details);
classification = pred (&details);
return classification;
}
/* The gdbarch insn_is_call method. */
static int
amd64_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return amd64_classify_insn_at (gdbarch, addr, amd64_call_p);
}
/* The gdbarch insn_is_ret method. */
static int
amd64_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return amd64_classify_insn_at (gdbarch, addr, amd64_ret_p);
}
/* The gdbarch insn_is_jump method. */
static int
amd64_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return amd64_classify_insn_at (gdbarch, addr, amd64_jmp_p);
}
/* Fix up the state of registers and memory after having single-stepped
a displaced instruction. */
void
amd64_displaced_step_fixup (struct gdbarch *gdbarch,
struct displaced_step_closure *dsc,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* The offset we applied to the instruction's address. */
ULONGEST insn_offset = to - from;
gdb_byte *insn = dsc->insn_buf;
const struct amd64_insn *insn_details = &dsc->insn_details;
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
"displaced: fixup (%s, %s), "
"insn = 0x%02x 0x%02x ...\n",
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
paddress (gdbarch, from), paddress (gdbarch, to),
insn[0], insn[1]);
/* If we used a tmp reg, restore it. */
if (dsc->tmp_used)
{
if (debug_displaced)
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
fprintf_unfiltered (gdb_stdlog, "displaced: restoring reg %d to %s\n",
dsc->tmp_regno, paddress (gdbarch, dsc->tmp_save));
regcache_cooked_write_unsigned (regs, dsc->tmp_regno, dsc->tmp_save);
}
/* The list of issues to contend with here is taken from
resume_execution in arch/x86/kernel/kprobes.c, Linux 2.6.28.
Yay for Free Software! */
/* Relocate the %rip back to the program's instruction stream,
if necessary. */
/* Except in the case of absolute or indirect jump or call
instructions, or a return instruction, the new rip is relative to
the displaced instruction; make it relative to the original insn.
Well, signal handler returns don't need relocation either, but we use the
value of %rip to recognize those; see below. */
if (! amd64_absolute_jmp_p (insn_details)
&& ! amd64_absolute_call_p (insn_details)
&& ! amd64_ret_p (insn_details))
{
ULONGEST orig_rip;
int insn_len;
regcache_cooked_read_unsigned (regs, AMD64_RIP_REGNUM, &orig_rip);
/* A signal trampoline system call changes the %rip, resuming
execution of the main program after the signal handler has
returned. That makes them like 'return' instructions; we
shouldn't relocate %rip.
But most system calls don't, and we do need to relocate %rip.
Our heuristic for distinguishing these cases: if stepping
over the system call instruction left control directly after
the instruction, the we relocate --- control almost certainly
doesn't belong in the displaced copy. Otherwise, we assume
the instruction has put control where it belongs, and leave
it unrelocated. Goodness help us if there are PC-relative
system calls. */
if (amd64_syscall_p (insn_details, &insn_len)
&& orig_rip != to + insn_len
/* GDB can get control back after the insn after the syscall.
Presumably this is a kernel bug.
Fixup ensures its a nop, we add one to the length for it. */
&& orig_rip != to + insn_len + 1)
{
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"displaced: syscall changed %%rip; "
"not relocating\n");
}
else
{
ULONGEST rip = orig_rip - insn_offset;
/* If we just stepped over a breakpoint insn, we don't backup
the pc on purpose; this is to match behaviour without
stepping. */
regcache_cooked_write_unsigned (regs, AMD64_RIP_REGNUM, rip);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"displaced: "
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
"relocated %%rip from %s to %s\n",
paddress (gdbarch, orig_rip),
paddress (gdbarch, rip));
}
}
/* If the instruction was PUSHFL, then the TF bit will be set in the
pushed value, and should be cleared. We'll leave this for later,
since GDB already messes up the TF flag when stepping over a
pushfl. */
/* If the instruction was a call, the return address now atop the
stack is the address following the copied instruction. We need
to make it the address following the original instruction. */
if (amd64_call_p (insn_details))
{
ULONGEST rsp;
ULONGEST retaddr;
const ULONGEST retaddr_len = 8;
regcache_cooked_read_unsigned (regs, AMD64_RSP_REGNUM, &rsp);
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
retaddr = read_memory_unsigned_integer (rsp, retaddr_len, byte_order);
[amd64] Invalid return address after displaced stepping Making all-stop run on top of non-stop caused a small regression in behavior. This was observed on x86_64-linux. The attached testcase is in C whereas the investigation was done with an Ada program, but it's the same scenario, and using a C testcase allows wider testing. Basically: I am debugging a single-threaded program, and currently stopped inside a function provided by a shared-library, at a line calling a subprogram provided by a second shared library, and trying to "next" over that function call. Before we changed the default all-stop behavior, we had: 7 Impl_Initialize; -- Stop here and try "next" over this line (gdb) n 8 return 5; <<-- OK But now, "next" just stops much earlier: (gdb) n 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so What happens is that next stops at a call instruction, which calls the function's PLT, and GDB fails to notice that the inferior stepped into a subroutine, and so decides that we're done. We can see another symptom of the same issue by looking at the backtrace at the point GDB stopped: (gdb) bt #0 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so #1 0x00000000f7bd86f9 in ?? () #2 0x00007fffffffdf50 in ?? () #3 0x0000000000401893 in a () at /[...]/a.adb:7 Backtrace stopped: frame did not save the PC With a functioning GDB, the backtrace looks like the following instead: #0 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so #1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7 #2 0x0000000000401893 in a () at /[...]/a.adb:7 Note how, for frame #1, the address looks quite similar, except for the high-order bits not being set: #1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7 <<<-- OK #1 0x00000000f7bd86f9 in ?? () <<<-- WRONG ^^^^ |||| Wrong Investigating this further led me to displaced stepping. As we are "next"-ing from a location where a breakpoint is inserted, we need to step out of it, and since we're on non-stop mode, we need to do it using displaced stepping. And looking at amd64-tdep.c:amd64_displaced_step_fixup, I found the code that handles the return address: regcache_cooked_read_unsigned (regs, AMD64_RSP_REGNUM, &rsp); retaddr = read_memory_unsigned_integer (rsp, retaddr_len, byte_order); retaddr = (retaddr - insn_offset) & 0xffffffffUL; The mask used to compute retaddr looks wrong to me, keeping only 4 bytes instead of 8, and explains why the high order bits of the backtrace are unset. What happens is that, after the displaced stepping has completed, GDB restores that return address at the location where the program expects it. But because the top half bits of the address have been masked out, the return address is now invalid. The incorrect behavior of the "next" command and the backtrace at that location are the first symptoms of that. Another symptom is that this actually alters the behavior of the program, where a "cont" from there soon leads to a SEGV when the inferior tries to jump back to that incorrect return address: (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x00000000f7bd86f9 in ?? () ^^^^^^^^^^^^^^^^^^ This patch fixes the issue by using a mask that seems more appropriate for this architecture. gdb/ChangeLog: * amd64-tdep.c (amd64_displaced_step_fixup): Fix the mask used to compute RETADDR. gdb/testsuite/ChangeLog: * gdb.base/dso2dso-dso2.c, gdb.base/dso2dso-dso2.h, gdb.base/dso2dso-dso1.c, gdb.base/dso2dso-dso1.h, gdb.base/dso2dso.c, gdb.base/dso2dso.exp: New files. Tested on x86_64-linux, no regression.
2015-08-12 18:33:19 +02:00
retaddr = (retaddr - insn_offset) & 0xffffffffffffffffULL;
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
write_memory_unsigned_integer (rsp, retaddr_len, byte_order, retaddr);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
* defs.h (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter. * utils.c (strlen_paddr, paddr, paddr_nz): Remove. (paddress): Add GDBARCH parameter, use it instead of current_gdbarch. * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter. * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter, use it instead of current_gdbarch. Update calls to ui_out_field_core_addr to pass architecture: * ada-lang.c (print_one_exception): Update. * breakpoint.c (print_one_breakpoint_location, print_one_exception_catchpoint): Update. * disasm.c (dump_insns): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * mi/mi-main.c (mi_cmd_data_read_memory): Update. * mi/mi-symbol-cmds.c: Include "objfiles.h". (mi_cmd_symbol_list_lines): Update. * stack.c (print_frame_info, print_frame): Update. Update callers of paddress to pass architecture: * ada-tasks.c (info_task): Update. * ada-valprint.c (ada_val_print_1): Update. * annotate.c (annotate_source, annotate_frame_begin): Update. * breakpoint.c (insert_bp_location, describe_other_breakpoints, mention): Update. * cli/cli-cmds.c (edit_command, list_command, print_disassembly): Update. * corefile.c (memory_error): Update. * c-valprint.c (print_function_pointer_address, c_val_print): Update. * disasm.c (dis_asm_print_address): Update. * exec.c (print_section_info): Update. * f-valprint.c (f_val_print): Update. * infcmd.c: Include "arch-utils.h". (jump_command, program_info): Update. * linux-fork.c: Include "arch-utils.h". (info_forks_command): Update. * m2-valprint.c (print_function_pointer_address, print_unpacked_pointer, print_variable_at_address, m2_val_print): Update. * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command): Update. * printcmd.c (print_address, print_address_demangle, address_info): Update. * p-valprint.c (pascal_val_print): Update. * source.c: Include "arch-utils.h". (line_info): Update. * stack.c (frame_info, print_block_frame_labels): Update. * symfile.c (add_symbol_file_command, list_overlays_command): Update. * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1, print_symbol, print_partial_symbols, maintenance_info_psymtabs, maintenance_check_symtabs): Update. * symtab.c (find_pc_sect_symtab): Update. * target.c (deprecated_debug_xfer_memory): Update. * tracepoint.c (scope_info): Update. * tui/tui-stack.c (tui_make_status_line): Update. * valprint.c (val_print_string): Update. Update callers of paddr_nz to use paddress instead (keeping user-visible output identical): * alpha-tdep.c (alpha_heuristic_proc_start): Update. * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn, amd64_displaced_step_fixup): Update. * arch-utils.c (simple_displaced_step_copy_insn): Update. * auxv.c (fprint_target_auxv): Update. * breakpoint.c (insert_single_step_breakpoint): Update. * buildsym.c (finish_block): Update. * cli/cli-dump.c (restore_section_callback): Update. * fbsd-nat.c (fbsd_find_memory_regions): Update. * frame.c (frame_unwind_register_value): Update. * gcore.c (gcore_create_callback): Update. * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm, i386_record_lea_modrm_addr, i386_record_lea_modrm, i386_process_record): Update. * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id, ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id, ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update. * infrun.c (displaced_step_prepare, displaced_step_fixup, handle_inferior_event, insert_step_resume_breakpoint_at_sal, insert_longjmp_resume_breakpoint): Update. * linux-nat.c (linux_nat_find_memory_regions): Update. * linux-record.c (record_linux_system_call): Update. * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call): Update. * monitor.c (monitor_error, monitor_remove_breakpoint): Update. * record.c (record_arch_list_add_mem, record_wait, record_xfer_partial): Update. * remote-mips.c (mips_fetch_word, mips_check_lsi_error, mips_common_breakpoint): Update. * remote-sim.c (gdbsim_xfer_inferior_memory): Update. * rs6000-tdep.c (ppc_displaced_step_fixup): Update. * solib-som.c (som_current_sos): Update. * symfile.c (load_progress, generic_load): Update. * symfile-mem.c (add_vsyscall_page): Update. * valops.c (value_fetch_lazy): Update. * windows-tdep.c (windows_xfer_shared_library): Update. Update callers of paddr_nz to use paddress instead (changing user-visible output to make it more correct): * dwarf2loc.c (locexpr_describe_location): Update. * ia64-tdep.c (ia64_memory_insert_breakpoint, ia64_memory_remove_breakpoint): Update. * jv-valprint.c (java_value_print): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. * monitor.c (monitor_read_memory): Update. Update callers of paddr to use paddress instead (changing user-visible output to make it more correct): * arm-tdep.c (arm_push_dummy_call): Update. * breakpoint.c (insert_bp_location, create_thread_event_breakpoint, create_breakpoint): Update. * darwin-nat-info.c (darwin_debug_regions): Update. * dcache.c (dcache_info): Update. * dsrec.c (load_srec, make_srec): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program, dwarf2_frame_cache): Update. * gcore.c (gcore_copy_callback): Update. * gnu-nat.c (gnu_xfer_memory): Update. * mips-linux-nat.c (mips_show_dr): Update. * monitor.c (monitor_write_memory, monitor_insert_breakpoint, monitor_remove_breakpoint): Update. * remote.c (compare_sections_command): Update. * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint, m32r_remove_breakpoint, m32r_insert_watchpoint, m32r_remove_watchpoint): Update. * sol-thread.c (info_cb): Update. * symfile.c (load_progress): Update. Update callers of paddress or paddr_nz to use hex_string instead (changes output of internal/error/debug messages only): * dwarf2read.c (dump_die_shallow): Update. * frame.c (fprint_field, fprint_frame, frame_pc_unwind, get_frame_func, create_new_frame): Update. * hppa-tdep.c (find_unwind_entry, unwind_command): Update. * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x, ia64_get_dyn_info_list): Update. * maint.c (maintenance_translate_address): Update. * mi/mi-cmd-var.c (mi_cmd_var_create): Update. * target.c (target_flash_erase): Update. Update callers of paddr/paddr_nz to use phex/phex_nz instead, using an appropriate address size. Remove use of strlen_paddr. * exec.c (exec_files_info): Update. * i386-nat.c (i386_show_dr): Update. * remote.c (remote_flash_erase): Update. * m32r-rom.c (m32r_load_section): Update. * monitor.c (monitor_vsprintf, monitor_store_register): Update. * remote.c (remote_check_symbols, remote_search_memory): Update. * remote-mips.c (mips_request, mips_common_breakpoint): Update. * scm-valprint.c (scm_ipruk, scm_scmval_print): Update. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update. * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Update. * xcoffsolib.c (sharedlibrary_command): Update. * maint.c (maint_print_section_info): Add ADDR_SIZE parameter. Use hex_string_custom instead of paddr. (print_bfd_section_info): Pass address size. (print_objfile_section_info): Likewise. * annotate.h (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * annotate.c (annotate_source): Add GDBARCH parameter. (annotate_frame_begin): Likewise. * source.c (identify_source_line): Update call to annotate_source. * stack.c (print_frame_info, print_frame): Update call to annotate_frame_begin. * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter. (create_breakpoint, create_ada_exception_breakpoint): Update call. * stack.c (print_block_frame_labels): Add GDBARCH parameter. (print_frame_label_vars): Update call. * symmisc.c (print_partial_symbols): Add GDBARCH parameter. (dump_psymtab): Update call to print_partial_symbols. (struct print_symbol_args): Add GDBARCH member. (dump_symtab_1): Set print_symbol_args architecture member. (print_symbol): Use it. * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH parameter. * windows-tdep.c (windows_xfer_shared_library): Likewise. * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member. (core_process_module_section): Pass architecture from cpms_data to windows_xfer_shared_library. (windows_core_xfer_shared_libraries): Initialize cmps_data architecture member. * windows-nat.c (windows_xfer_shared_libraries): Pass architecture to windows_xfer_shared_library. * defs.h (print_address): Add GDBARCH parameter. * printcmd.c (print_address): Add GDBARCH parameter. (print_scalar_formatted, do_examine): Update call. * findcmd.c (find_command): Update call. * tracepoint.c: Include "arch-utils.h". (trace_find_line_command): Update call. * tui/tui-disasm.c (tui_disassemble): Update call. * value.h (print_address_demangle): Add GDBARCH parameter. * printcmd.c (print_address_demangle): Add GDBARCH parameter. * c-valprint.c (print_function_pointer_address, c_val_print): Update call. * f-valprint.c (f_val_print): Update call. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call. * jv-valprint.c (java_val_print): Update call. * m2-valprint.c (print_function_pointer_address, m2_val_print): Update call. * p-valprint.c (pascal_val_print): Update call. * disasm.c (gdb_disassemble_info): Install architecture into di.application_data field. testsuite/ChangeLog: * gdb.threads/tls-shared.exp: Update to locexpr_describe_location change to prefix TLS offset in hex with 0x. doc/ChangeLog: * gdbint.texinfo (Item Output Functions): Update signature for ui_out_field_core_addr.
2009-07-02 19:21:10 +02:00
"displaced: relocated return addr at %s "
"to %s\n",
paddress (gdbarch, rsp),
paddress (gdbarch, retaddr));
}
}
/* If the instruction INSN uses RIP-relative addressing, return the
offset into the raw INSN where the displacement to be adjusted is
found. Returns 0 if the instruction doesn't use RIP-relative
addressing. */
static int
rip_relative_offset (struct amd64_insn *insn)
{
if (insn->modrm_offset != -1)
{
gdb_byte modrm = insn->raw_insn[insn->modrm_offset];
if ((modrm & 0xc7) == 0x05)
{
/* The displacement is found right after the ModRM byte. */
return insn->modrm_offset + 1;
}
}
return 0;
}
static void
append_insns (CORE_ADDR *to, ULONGEST len, const gdb_byte *buf)
{
target_write_memory (*to, buf, len);
*to += len;
}
static void
amd64_relocate_instruction (struct gdbarch *gdbarch,
CORE_ADDR *to, CORE_ADDR oldloc)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int len = gdbarch_max_insn_length (gdbarch);
/* Extra space for sentinels. */
int fixup_sentinel_space = len;
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
gdb_byte *buf = (gdb_byte *) xmalloc (len + fixup_sentinel_space);
struct amd64_insn insn_details;
int offset = 0;
LONGEST rel32, newrel;
gdb_byte *insn;
int insn_length;
read_memory (oldloc, buf, len);
/* Set up the sentinel space so we don't have to worry about running
off the end of the buffer. An excessive number of leading prefixes
could otherwise cause this. */
memset (buf + len, 0, fixup_sentinel_space);
insn = buf;
amd64_get_insn_details (insn, &insn_details);
insn_length = gdb_buffered_insn_length (gdbarch, insn, len, oldloc);
/* Skip legacy instruction prefixes. */
insn = amd64_skip_prefixes (insn);
/* Adjust calls with 32-bit relative addresses as push/jump, with
the address pushed being the location where the original call in
the user program would return to. */
if (insn[0] == 0xe8)
{
gdb_byte push_buf[32];
CORE_ADDR ret_addr;
int i = 0;
/* Where "ret" in the original code will return to. */
ret_addr = oldloc + insn_length;
/* If pushing an address higher than or equal to 0x80000000,
avoid 'pushq', as that sign extends its 32-bit operand, which
would be incorrect. */
if (ret_addr <= 0x7fffffff)
{
push_buf[0] = 0x68; /* pushq $... */
store_unsigned_integer (&push_buf[1], 4, byte_order, ret_addr);
i = 5;
}
else
{
push_buf[i++] = 0x48; /* sub $0x8,%rsp */
push_buf[i++] = 0x83;
push_buf[i++] = 0xec;
push_buf[i++] = 0x08;
push_buf[i++] = 0xc7; /* movl $imm,(%rsp) */
push_buf[i++] = 0x04;
push_buf[i++] = 0x24;
store_unsigned_integer (&push_buf[i], 4, byte_order,
ret_addr & 0xffffffff);
i += 4;
push_buf[i++] = 0xc7; /* movl $imm,4(%rsp) */
push_buf[i++] = 0x44;
push_buf[i++] = 0x24;
push_buf[i++] = 0x04;
store_unsigned_integer (&push_buf[i], 4, byte_order,
ret_addr >> 32);
i += 4;
}
gdb_assert (i <= sizeof (push_buf));
/* Push the push. */
append_insns (to, i, push_buf);
/* Convert the relative call to a relative jump. */
insn[0] = 0xe9;
/* Adjust the destination offset. */
rel32 = extract_signed_integer (insn + 1, 4, byte_order);
newrel = (oldloc - *to) + rel32;
store_signed_integer (insn + 1, 4, byte_order, newrel);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"Adjusted insn rel32=%s at %s to"
" rel32=%s at %s\n",
hex_string (rel32), paddress (gdbarch, oldloc),
hex_string (newrel), paddress (gdbarch, *to));
/* Write the adjusted jump into its displaced location. */
append_insns (to, 5, insn);
return;
}
offset = rip_relative_offset (&insn_details);
if (!offset)
{
/* Adjust jumps with 32-bit relative addresses. Calls are
already handled above. */
if (insn[0] == 0xe9)
offset = 1;
/* Adjust conditional jumps. */
else if (insn[0] == 0x0f && (insn[1] & 0xf0) == 0x80)
offset = 2;
}
if (offset)
{
rel32 = extract_signed_integer (insn + offset, 4, byte_order);
newrel = (oldloc - *to) + rel32;
store_signed_integer (insn + offset, 4, byte_order, newrel);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"Adjusted insn rel32=%s at %s to"
" rel32=%s at %s\n",
hex_string (rel32), paddress (gdbarch, oldloc),
hex_string (newrel), paddress (gdbarch, *to));
}
/* Write the adjusted instruction into its displaced location. */
append_insns (to, insn_length, buf);
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* The maximum number of saved registers. This should include %rip. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
#define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
/* Base address. */
CORE_ADDR base;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
int base_p;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
CORE_ADDR sp_offset;
CORE_ADDR pc;
/* Saved registers. */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
CORE_ADDR saved_regs[AMD64_NUM_SAVED_REGS];
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
CORE_ADDR saved_sp;
int saved_sp_reg;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Do we have a frame? */
int frameless_p;
};
/* Initialize a frame cache. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static void
amd64_init_frame_cache (struct amd64_frame_cache *cache)
{
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
int i;
/* Base address. */
cache->base = 0;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
cache->base_p = 0;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
cache->sp_offset = -8;
cache->pc = 0;
/* Saved registers. We initialize these to -1 since zero is a valid
offset (that's where %rbp is supposed to be stored).
The values start out as being offsets, and are later converted to
addresses (at which point -1 is interpreted as an address, still meaning
"invalid"). */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
for (i = 0; i < AMD64_NUM_SAVED_REGS; i++)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
cache->saved_regs[i] = -1;
cache->saved_sp = 0;
cache->saved_sp_reg = -1;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Frameless until proven otherwise. */
cache->frameless_p = 1;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Allocate and initialize a frame cache. */
static struct amd64_frame_cache *
amd64_alloc_frame_cache (void)
{
struct amd64_frame_cache *cache;
cache = FRAME_OBSTACK_ZALLOC (struct amd64_frame_cache);
amd64_init_frame_cache (cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return cache;
}
/* GCC 4.4 and later, can put code in the prologue to realign the
stack pointer. Check whether PC points to such code, and update
CACHE accordingly. Return the first instruction after the code
sequence or CURRENT_PC, whichever is smaller. If we don't
recognize the code, return PC. */
static CORE_ADDR
amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc,
struct amd64_frame_cache *cache)
{
/* There are 2 code sequences to re-align stack before the frame
gets set up:
1. Use a caller-saved saved register:
leaq 8(%rsp), %reg
andq $-XXX, %rsp
pushq -8(%reg)
2. Use a callee-saved saved register:
pushq %reg
leaq 16(%rsp), %reg
andq $-XXX, %rsp
pushq -8(%reg)
"andq $-XXX, %rsp" can be either 4 bytes or 7 bytes:
0x48 0x83 0xe4 0xf0 andq $-16, %rsp
0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp
*/
gdb_byte buf[18];
int reg, r;
int offset, offset_and;
if (target_read_code (pc, buf, sizeof buf))
return pc;
/* Check caller-saved saved register. The first instruction has
to be "leaq 8(%rsp), %reg". */
if ((buf[0] & 0xfb) == 0x48
&& buf[1] == 0x8d
&& buf[3] == 0x24
&& buf[4] == 0x8)
{
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[2] & 0xc7) != 0x44)
return pc;
/* REG has register number. */
reg = (buf[2] >> 3) & 7;
/* Check the REX.R bit. */
if (buf[0] == 0x4c)
reg += 8;
offset = 5;
}
else
{
/* Check callee-saved saved register. The first instruction
has to be "pushq %reg". */
reg = 0;
if ((buf[0] & 0xf8) == 0x50)
offset = 0;
else if ((buf[0] & 0xf6) == 0x40
&& (buf[1] & 0xf8) == 0x50)
{
/* Check the REX.B bit. */
if ((buf[0] & 1) != 0)
reg = 8;
offset = 1;
}
else
return pc;
/* Get register. */
reg += buf[offset] & 0x7;
offset++;
/* The next instruction has to be "leaq 16(%rsp), %reg". */
if ((buf[offset] & 0xfb) != 0x48
|| buf[offset + 1] != 0x8d
|| buf[offset + 3] != 0x24
|| buf[offset + 4] != 0x10)
return pc;
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[offset + 2] & 0xc7) != 0x44)
return pc;
/* REG has register number. */
r = (buf[offset + 2] >> 3) & 7;
/* Check the REX.R bit. */
if (buf[offset] == 0x4c)
r += 8;
/* Registers in pushq and leaq have to be the same. */
if (reg != r)
return pc;
offset += 5;
}
/* Rigister can't be %rsp nor %rbp. */
if (reg == 4 || reg == 5)
return pc;
/* The next instruction has to be "andq $-XXX, %rsp". */
if (buf[offset] != 0x48
|| buf[offset + 2] != 0xe4
|| (buf[offset + 1] != 0x81 && buf[offset + 1] != 0x83))
return pc;
offset_and = offset;
offset += buf[offset + 1] == 0x81 ? 7 : 4;
/* The next instruction has to be "pushq -8(%reg)". */
r = 0;
if (buf[offset] == 0xff)
offset++;
else if ((buf[offset] & 0xf6) == 0x40
&& buf[offset + 1] == 0xff)
{
/* Check the REX.B bit. */
if ((buf[offset] & 0x1) != 0)
r = 8;
offset += 2;
}
else
return pc;
/* 8bit -8 is 0xf8. REG must be binary 110 and MOD must be binary
01. */
if (buf[offset + 1] != 0xf8
|| (buf[offset] & 0xf8) != 0x70)
return pc;
/* R/M has register. */
r += buf[offset] & 7;
/* Registers in leaq and pushq have to be the same. */
if (reg != r)
return pc;
if (current_pc > pc + offset_and)
cache->saved_sp_reg = amd64_arch_reg_to_regnum (reg);
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 20:55:17 +02:00
return std::min (pc + offset + 2, current_pc);
}
/* Similar to amd64_analyze_stack_align for x32. */
static CORE_ADDR
amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc,
struct amd64_frame_cache *cache)
{
/* There are 2 code sequences to re-align stack before the frame
gets set up:
1. Use a caller-saved saved register:
leaq 8(%rsp), %reg
andq $-XXX, %rsp
pushq -8(%reg)
or
[addr32] leal 8(%rsp), %reg
andl $-XXX, %esp
[addr32] pushq -8(%reg)
2. Use a callee-saved saved register:
pushq %reg
leaq 16(%rsp), %reg
andq $-XXX, %rsp
pushq -8(%reg)
or
pushq %reg
[addr32] leal 16(%rsp), %reg
andl $-XXX, %esp
[addr32] pushq -8(%reg)
"andq $-XXX, %rsp" can be either 4 bytes or 7 bytes:
0x48 0x83 0xe4 0xf0 andq $-16, %rsp
0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp
"andl $-XXX, %esp" can be either 3 bytes or 6 bytes:
0x83 0xe4 0xf0 andl $-16, %esp
0x81 0xe4 0x00 0xff 0xff 0xff andl $-256, %esp
*/
gdb_byte buf[19];
int reg, r;
int offset, offset_and;
if (target_read_memory (pc, buf, sizeof buf))
return pc;
/* Skip optional addr32 prefix. */
offset = buf[0] == 0x67 ? 1 : 0;
/* Check caller-saved saved register. The first instruction has
to be "leaq 8(%rsp), %reg" or "leal 8(%rsp), %reg". */
if (((buf[offset] & 0xfb) == 0x48 || (buf[offset] & 0xfb) == 0x40)
&& buf[offset + 1] == 0x8d
&& buf[offset + 3] == 0x24
&& buf[offset + 4] == 0x8)
{
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[offset + 2] & 0xc7) != 0x44)
return pc;
/* REG has register number. */
reg = (buf[offset + 2] >> 3) & 7;
/* Check the REX.R bit. */
if ((buf[offset] & 0x4) != 0)
reg += 8;
offset += 5;
}
else
{
/* Check callee-saved saved register. The first instruction
has to be "pushq %reg". */
reg = 0;
if ((buf[offset] & 0xf6) == 0x40
&& (buf[offset + 1] & 0xf8) == 0x50)
{
/* Check the REX.B bit. */
if ((buf[offset] & 1) != 0)
reg = 8;
offset += 1;
}
else if ((buf[offset] & 0xf8) != 0x50)
return pc;
/* Get register. */
reg += buf[offset] & 0x7;
offset++;
/* Skip optional addr32 prefix. */
if (buf[offset] == 0x67)
offset++;
/* The next instruction has to be "leaq 16(%rsp), %reg" or
"leal 16(%rsp), %reg". */
if (((buf[offset] & 0xfb) != 0x48 && (buf[offset] & 0xfb) != 0x40)
|| buf[offset + 1] != 0x8d
|| buf[offset + 3] != 0x24
|| buf[offset + 4] != 0x10)
return pc;
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[offset + 2] & 0xc7) != 0x44)
return pc;
/* REG has register number. */
r = (buf[offset + 2] >> 3) & 7;
/* Check the REX.R bit. */
if ((buf[offset] & 0x4) != 0)
r += 8;
/* Registers in pushq and leaq have to be the same. */
if (reg != r)
return pc;
offset += 5;
}
/* Rigister can't be %rsp nor %rbp. */
if (reg == 4 || reg == 5)
return pc;
/* The next instruction may be "andq $-XXX, %rsp" or
"andl $-XXX, %esp". */
if (buf[offset] != 0x48)
offset--;
if (buf[offset + 2] != 0xe4
|| (buf[offset + 1] != 0x81 && buf[offset + 1] != 0x83))
return pc;
offset_and = offset;
offset += buf[offset + 1] == 0x81 ? 7 : 4;
/* Skip optional addr32 prefix. */
if (buf[offset] == 0x67)
offset++;
/* The next instruction has to be "pushq -8(%reg)". */
r = 0;
if (buf[offset] == 0xff)
offset++;
else if ((buf[offset] & 0xf6) == 0x40
&& buf[offset + 1] == 0xff)
{
/* Check the REX.B bit. */
if ((buf[offset] & 0x1) != 0)
r = 8;
offset += 2;
}
else
return pc;
/* 8bit -8 is 0xf8. REG must be binary 110 and MOD must be binary
01. */
if (buf[offset + 1] != 0xf8
|| (buf[offset] & 0xf8) != 0x70)
return pc;
/* R/M has register. */
r += buf[offset] & 7;
/* Registers in leaq and pushq have to be the same. */
if (reg != r)
return pc;
if (current_pc > pc + offset_and)
cache->saved_sp_reg = amd64_arch_reg_to_regnum (reg);
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 20:55:17 +02:00
return std::min (pc + offset + 2, current_pc);
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Do a limited analysis of the prologue at PC and update CACHE
accordingly. Bail out early if CURRENT_PC is reached. Return the
address where the analysis stopped.
We will handle only functions beginning with:
pushq %rbp 0x55
movq %rsp, %rbp 0x48 0x89 0xe5 (or 0x48 0x8b 0xec)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
or (for the X32 ABI):
pushq %rbp 0x55
movl %esp, %ebp 0x89 0xe5 (or 0x8b 0xec)
Any function that doesn't start with one of these sequences will be
assumed to have no prologue and thus no valid frame pointer in
%rbp. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static CORE_ADDR
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
amd64_analyze_prologue (struct gdbarch *gdbarch,
CORE_ADDR pc, CORE_ADDR current_pc,
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* There are two variations of movq %rsp, %rbp. */
static const gdb_byte mov_rsp_rbp_1[3] = { 0x48, 0x89, 0xe5 };
static const gdb_byte mov_rsp_rbp_2[3] = { 0x48, 0x8b, 0xec };
/* Ditto for movl %esp, %ebp. */
static const gdb_byte mov_esp_ebp_1[2] = { 0x89, 0xe5 };
static const gdb_byte mov_esp_ebp_2[2] = { 0x8b, 0xec };
gdb_byte buf[3];
gdb_byte op;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (current_pc <= pc)
return current_pc;
if (gdbarch_ptr_bit (gdbarch) == 32)
pc = amd64_x32_analyze_stack_align (pc, current_pc, cache);
else
pc = amd64_analyze_stack_align (pc, current_pc, cache);
op = read_code_unsigned_integer (pc, 1, byte_order);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (op == 0x55) /* pushq %rbp */
{
/* Take into account that we've executed the `pushq %rbp' that
starts this instruction sequence. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
cache->saved_regs[AMD64_RBP_REGNUM] = 0;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
cache->sp_offset += 8;
/* If that's all, return now. */
if (current_pc <= pc + 1)
return current_pc;
read_code (pc + 1, buf, 3);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Check for `movq %rsp, %rbp'. */
if (memcmp (buf, mov_rsp_rbp_1, 3) == 0
|| memcmp (buf, mov_rsp_rbp_2, 3) == 0)
{
/* OK, we actually have a frame. */
cache->frameless_p = 0;
return pc + 4;
}
/* For X32, also check for `movq %esp, %ebp'. */
if (gdbarch_ptr_bit (gdbarch) == 32)
{
if (memcmp (buf, mov_esp_ebp_1, 2) == 0
|| memcmp (buf, mov_esp_ebp_2, 2) == 0)
{
/* OK, we actually have a frame. */
cache->frameless_p = 0;
return pc + 3;
}
}
return pc + 1;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
return pc;
}
/* Work around false termination of prologue - GCC PR debug/48827.
START_PC is the first instruction of a function, PC is its minimal already
determined advanced address. Function returns PC if it has nothing to do.
84 c0 test %al,%al
74 23 je after
<-- here is 0 lines advance - the false prologue end marker.
0f 29 85 70 ff ff ff movaps %xmm0,-0x90(%rbp)
0f 29 4d 80 movaps %xmm1,-0x80(%rbp)
0f 29 55 90 movaps %xmm2,-0x70(%rbp)
0f 29 5d a0 movaps %xmm3,-0x60(%rbp)
0f 29 65 b0 movaps %xmm4,-0x50(%rbp)
0f 29 6d c0 movaps %xmm5,-0x40(%rbp)
0f 29 75 d0 movaps %xmm6,-0x30(%rbp)
0f 29 7d e0 movaps %xmm7,-0x20(%rbp)
after: */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static CORE_ADDR
amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc)
{
struct symtab_and_line start_pc_sal, next_sal;
gdb_byte buf[4 + 8 * 7];
int offset, xmmreg;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (pc == start_pc)
return pc;
start_pc_sal = find_pc_sect_line (start_pc, NULL, 0);
if (start_pc_sal.symtab == NULL
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
|| producer_is_gcc_ge_4 (COMPUNIT_PRODUCER
(SYMTAB_COMPUNIT (start_pc_sal.symtab))) < 6
|| start_pc_sal.pc != start_pc || pc >= start_pc_sal.end)
return pc;
next_sal = find_pc_sect_line (start_pc_sal.end, NULL, 0);
if (next_sal.line != start_pc_sal.line)
return pc;
/* START_PC can be from overlayed memory, ignored here. */
if (target_read_code (next_sal.pc - 4, buf, sizeof (buf)) != 0)
return pc;
/* test %al,%al */
if (buf[0] != 0x84 || buf[1] != 0xc0)
return pc;
/* je AFTER */
if (buf[2] != 0x74)
return pc;
offset = 4;
for (xmmreg = 0; xmmreg < 8; xmmreg++)
{
/* 0x0f 0x29 0b??000101 movaps %xmmreg?,-0x??(%rbp) */
if (buf[offset] != 0x0f || buf[offset + 1] != 0x29
|| (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
return pc;
/* 0b01?????? */
if ((buf[offset + 2] & 0xc0) == 0x40)
{
/* 8-bit displacement. */
offset += 4;
}
/* 0b10?????? */
else if ((buf[offset + 2] & 0xc0) == 0x80)
{
/* 32-bit displacement. */
offset += 7;
}
else
return pc;
}
/* je AFTER */
if (offset - 4 != buf[3])
return pc;
return next_sal.end;
}
/* Return PC of first real instruction. */
static CORE_ADDR
amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
struct amd64_frame_cache cache;
CORE_ADDR pc;
CORE_ADDR func_addr;
if (find_pc_partial_function (start_pc, NULL, &func_addr, NULL))
{
CORE_ADDR post_prologue_pc
= skip_prologue_using_sal (gdbarch, func_addr);
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr);
/* Clang always emits a line note before the prologue and another
one after. We trust clang to emit usable line notes. */
if (post_prologue_pc
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
&& (cust != NULL
&& COMPUNIT_PRODUCER (cust) != NULL
&& startswith (COMPUNIT_PRODUCER (cust), "clang ")))
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 20:55:17 +02:00
return std::max (start_pc, post_prologue_pc);
}
amd64_init_frame_cache (&cache);
pc = amd64_analyze_prologue (gdbarch, start_pc, 0xffffffffffffffffLL,
&cache);
if (cache.frameless_p)
return start_pc;
return amd64_skip_xmm_prologue (pc, start_pc);
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Normal frames. */
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
static void
amd64_frame_cache_1 (struct frame_info *this_frame,
struct amd64_frame_cache *cache)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_byte buf[8];
int i;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
cache->pc = get_frame_func (this_frame);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (cache->pc != 0)
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
amd64_analyze_prologue (gdbarch, cache->pc, get_frame_pc (this_frame),
cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (cache->frameless_p)
{
/* We didn't find a valid frame. If we're at the start of a
function, or somewhere half-way its prologue, the function's
frame probably hasn't been fully setup yet. Try to
reconstruct the base address for the stack frame by looking
at the stack pointer. For truly "frameless" functions this
might work too. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (cache->saved_sp_reg != -1)
{
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
/* Stack pointer has been saved. */
get_frame_register (this_frame, cache->saved_sp_reg, buf);
cache->saved_sp = extract_unsigned_integer (buf, 8, byte_order);
/* We're halfway aligning the stack. */
cache->base = ((cache->saved_sp - 8) & 0xfffffffffffffff0LL) - 8;
cache->saved_regs[AMD64_RIP_REGNUM] = cache->saved_sp - 8;
/* This will be added back below. */
cache->saved_regs[AMD64_RIP_REGNUM] -= cache->base;
}
else
{
get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
cache->base = extract_unsigned_integer (buf, 8, byte_order)
+ cache->sp_offset;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
else
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
get_frame_register (this_frame, AMD64_RBP_REGNUM, buf);
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
cache->base = extract_unsigned_integer (buf, 8, byte_order);
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Now that we have the base address for the stack frame we can
calculate the value of %rsp in the calling frame. */
cache->saved_sp = cache->base + 16;
/* For normal frames, %rip is stored at 8(%rbp). If we don't have a
frame we find it at the same offset from the reconstructed base
address. If we're halfway aligning the stack, %rip is handled
differently (see above). */
if (!cache->frameless_p || cache->saved_sp_reg == -1)
cache->saved_regs[AMD64_RIP_REGNUM] = 8;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Adjust all the saved registers such that they contain addresses
instead of offsets. */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
for (i = 0; i < AMD64_NUM_SAVED_REGS; i++)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (cache->saved_regs[i] != -1)
cache->saved_regs[i] += cache->base;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
cache->base_p = 1;
}
static struct amd64_frame_cache *
amd64_frame_cache (struct frame_info *this_frame, void **this_cache)
{
struct amd64_frame_cache *cache;
if (*this_cache)
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
return (struct amd64_frame_cache *) *this_cache;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
cache = amd64_alloc_frame_cache ();
*this_cache = cache;
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
TRY
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
{
amd64_frame_cache_1 (this_frame, cache);
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
CATCH (ex, RETURN_MASK_ERROR)
Normalize TRY_CATCH exception handling block This normalizes some exception catch blocks that check for ex.reason to look like this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ALL) { ... } if (ex.reason < 0) { ... } ~~~ This is a preparation step for running a script that converts all TRY_CATCH uses to look like this instead: ~~~ TRY { ... } CATCH (ex, RETURN_MASK_ALL) { ... } END_CATCH ~~~ The motivation for that change is being able to reimplent TRY/CATCH in terms of C++ try/catch. This commit makes it so that: - no condition other than ex.reason < 0 is checked in the if predicate - there's no "else" block to check whether no exception was caught - there's no code between the TRY_CATCH (TRY) block and the 'if (ex.reason < 0)' block (CATCH). - the exception object is no longer referred to outside the if/catch block. Note the local volatile exception objects that are currently defined inside functions that use TRY_CATCH will disappear. In cases it's more convenient to still refer to the exception outside the catch block, a new non-volatile local is added and copy to that object is made within the catch block. The following patches should make this all clearer. gdb/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> * amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache) (amd64_epilogue_frame_cache): Normal exception handling code. * break-catch-throw.c (check_status_exception_catchpoint) (re_set_exception_catchpoint): Ditto. * cli/cli-interp.c (safe_execute_command): * cli/cli-script.c (script_from_file): Ditto. * compile/compile-c-symbols.c (generate_c_for_for_one_variable): Ditto. * compile/compile-object-run.c (compile_object_run): Ditto. * cp-abi.c (baseclass_offset): Ditto. * cp-valprint.c (cp_print_value): Ditto. * exceptions.c (catch_exceptions_with_msg): * frame-unwind.c (frame_unwind_try_unwinder): Ditto. * frame.c (get_frame_address_in_block_if_available): Ditto. * i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache) (i386_sigtramp_frame_cache): Ditto. * infcmd.c (post_create_inferior): Ditto. * linespec.c (parse_linespec, find_linespec_symbols): * p-valprint.c (pascal_object_print_value): Ditto. * parse.c (parse_expression_for_completion): Ditto. * python/py-finishbreakpoint.c (bpfinishpy_init): Ditto. * remote.c (remote_get_noisy_reply): Ditto. * s390-linux-tdep.c (s390_frame_unwind_cache): Ditto. * solib-svr4.c (solib_svr4_r_map): Ditto.
2015-03-07 15:50:04 +01:00
{
if (ex.error != NOT_AVAILABLE_ERROR)
throw_exception (ex);
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
END_CATCH
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return cache;
}
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
static enum unwind_stop_reason
amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
void **this_cache)
{
struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache);
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
/* This marks the outermost frame. */
if (cache->base == 0)
return UNWIND_OUTERMOST;
return UNWIND_NO_REASON;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static void
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_this_id (struct frame_info *this_frame, void **this_cache,
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct frame_id *this_id)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache =
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_cache (this_frame, this_cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
if (!cache->base_p)
"tfind" across unavailable-stack frames. Like when stepping, the current stack frame location is expected to be printed as result of tfind command, if that results in moving to a different function. In tfind_1 we see: if (from_tty && (has_stack_frames () || traceframe_number >= 0)) { enum print_what print_what; /* NOTE: in imitation of the step command, try to determine whether we have made a transition from one function to another. If so, we'll print the "stack frame" (ie. the new function and it's arguments) -- otherwise we'll just show the new source line. */ if (frame_id_eq (old_frame_id, get_frame_id (get_current_frame ()))) print_what = SRC_LINE; else print_what = SRC_AND_LOC; print_stack_frame (get_selected_frame (NULL), 1, print_what, 1); do_displays (); } However, when we haven't collected any registers in the tracepoint (collect $regs), that doesn't actually work: (gdb) tstart (gdb) info tracepoints Num Type Disp Enb Address What 1 tracepoint keep y 0x080483b7 in func0 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 collect testload installed on target 2 tracepoint keep y 0x080483bc in func1 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:32 collect testload installed on target (gdb) c Continuing. Breakpoint 3, end () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:72 72 } (gdb) tstop (gdb) tfind start Found trace frame 0, tracepoint 1 #0 func0 () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 28 } (gdb) tfind Found trace frame 1, tracepoint 2 32 } (gdb) When we don't have info about the stack available (UNWIND_UNAVAILABLE), frames end up with outer_frame_id as frame ID. And in the scenario above, the issue is that both frames before and after the second tfind (the frames for func0 an func1) have the same id (outer_frame_id), so the frame_id_eq check returns false, even though the frames were of different functions. GDB knows that, because the PC is inferred from the tracepoint's address, even if no registers were collected. To fix this, this patch adds support for frame ids with a valid code address, but <unavailable> stack address, and then makes the unwinders use that instead of the catch-all outer_frame_id for such frames. The frame_id_eq check in tfind_1 then automatically does the right thing as expected. I tested with --directory=gdb.trace/ , before/after the patch, and compared the resulting gdb.logs, then adjusted the tests to expect the extra output that came out. Turns out that was only circ.exp, the original test that actually brought this issue to light. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2013-12-17 Pedro Alves <palves@redhat.com> * frame.h (enum frame_id_stack_status): New enum. (struct frame_id) <stack_addr>: Adjust comment. <stack_addr_p>: Delete field, replaced with ... <stack_status>: ... this new field. (frame_id_build_unavailable_stack): Declare. * frame.c (frame_addr_hash, fprint_field, outer_frame_id) (frame_id_build_special): Adjust. (frame_id_build_unavailable_stack): New function. (frame_id_build, frame_id_build_wild): Adjust. (frame_id_p, frame_id_eq, frame_id_inner): Adjust to take into account frames with unavailable stack. * amd64-tdep.c (amd64_frame_this_id) (amd64_sigtramp_frame_this_id, amd64_epilogue_frame_this_id): Use frame_id_build_unavailable_stack. * dwarf2-frame.c (dwarf2_frame_this_id): Likewise. * i386-tdep.c (i386_frame_this_id, i386_epilogue_frame_this_id) (i386_sigtramp_frame_this_id): Likewise. gdb/testsuite/ 2013-12-17 Pedro Alves <palves@redhat.com> * gdb.trace/circ.exp: Expect frame info to be printed when switching between frames with unavailable stack, but different functions.
2013-12-17 21:47:36 +01:00
(*this_id) = frame_id_build_unavailable_stack (cache->pc);
else if (cache->base == 0)
{
/* This marks the outermost frame. */
return;
}
else
(*this_id) = frame_id_build (cache->base + 16, cache->pc);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
static struct value *
amd64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
int regnum)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
struct gdbarch *gdbarch = get_frame_arch (this_frame);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache =
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_cache (this_frame, this_cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
gdb_assert (regnum >= 0);
if (regnum == gdbarch_sp_regnum (gdbarch) && cache->saved_sp)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
if (regnum < AMD64_NUM_SAVED_REGS && cache->saved_regs[regnum] != -1)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return frame_unwind_got_memory (this_frame, regnum,
cache->saved_regs[regnum]);
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return frame_unwind_got_register (this_frame, regnum, regnum);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
static const struct frame_unwind amd64_frame_unwind =
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
NORMAL_FRAME,
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
amd64_frame_unwind_stop_reason,
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
amd64_frame_this_id,
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_prev_register,
NULL,
default_frame_sniffer
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
};
/* Generate a bytecode expression to get the value of the saved PC. */
static void
amd64_gen_return_address (struct gdbarch *gdbarch,
struct agent_expr *ax, struct axs_value *value,
CORE_ADDR scope)
{
/* The following sequence assumes the traditional use of the base
register. */
ax_reg (ax, AMD64_RBP_REGNUM);
ax_const_l (ax, 8);
ax_simple (ax, aop_add);
value->type = register_type (gdbarch, AMD64_RIP_REGNUM);
value->kind = axs_lvalue_memory;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Signal trampolines. */
/* FIXME: kettenis/20030419: Perhaps, we can unify the 32-bit and
64-bit variants. This would require using identical frame caches
on both platforms. */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
static struct amd64_frame_cache *
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
CORE_ADDR addr;
gdb_byte buf[8];
int i;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (*this_cache)
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
return (struct amd64_frame_cache *) *this_cache;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
cache = amd64_alloc_frame_cache ();
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
TRY
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
{
get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 8, byte_order) - 8;
addr = tdep->sigcontext_addr (this_frame);
gdb_assert (tdep->sc_reg_offset);
gdb_assert (tdep->sc_num_regs <= AMD64_NUM_SAVED_REGS);
for (i = 0; i < tdep->sc_num_regs; i++)
if (tdep->sc_reg_offset[i] != -1)
cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
cache->base_p = 1;
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
CATCH (ex, RETURN_MASK_ERROR)
Normalize TRY_CATCH exception handling block This normalizes some exception catch blocks that check for ex.reason to look like this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ALL) { ... } if (ex.reason < 0) { ... } ~~~ This is a preparation step for running a script that converts all TRY_CATCH uses to look like this instead: ~~~ TRY { ... } CATCH (ex, RETURN_MASK_ALL) { ... } END_CATCH ~~~ The motivation for that change is being able to reimplent TRY/CATCH in terms of C++ try/catch. This commit makes it so that: - no condition other than ex.reason < 0 is checked in the if predicate - there's no "else" block to check whether no exception was caught - there's no code between the TRY_CATCH (TRY) block and the 'if (ex.reason < 0)' block (CATCH). - the exception object is no longer referred to outside the if/catch block. Note the local volatile exception objects that are currently defined inside functions that use TRY_CATCH will disappear. In cases it's more convenient to still refer to the exception outside the catch block, a new non-volatile local is added and copy to that object is made within the catch block. The following patches should make this all clearer. gdb/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> * amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache) (amd64_epilogue_frame_cache): Normal exception handling code. * break-catch-throw.c (check_status_exception_catchpoint) (re_set_exception_catchpoint): Ditto. * cli/cli-interp.c (safe_execute_command): * cli/cli-script.c (script_from_file): Ditto. * compile/compile-c-symbols.c (generate_c_for_for_one_variable): Ditto. * compile/compile-object-run.c (compile_object_run): Ditto. * cp-abi.c (baseclass_offset): Ditto. * cp-valprint.c (cp_print_value): Ditto. * exceptions.c (catch_exceptions_with_msg): * frame-unwind.c (frame_unwind_try_unwinder): Ditto. * frame.c (get_frame_address_in_block_if_available): Ditto. * i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache) (i386_sigtramp_frame_cache): Ditto. * infcmd.c (post_create_inferior): Ditto. * linespec.c (parse_linespec, find_linespec_symbols): * p-valprint.c (pascal_object_print_value): Ditto. * parse.c (parse_expression_for_completion): Ditto. * python/py-finishbreakpoint.c (bpfinishpy_init): Ditto. * remote.c (remote_get_noisy_reply): Ditto. * s390-linux-tdep.c (s390_frame_unwind_cache): Ditto. * solib-svr4.c (solib_svr4_r_map): Ditto.
2015-03-07 15:50:04 +01:00
{
if (ex.error != NOT_AVAILABLE_ERROR)
throw_exception (ex);
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
END_CATCH
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
*this_cache = cache;
return cache;
}
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
static enum unwind_stop_reason
amd64_sigtramp_frame_unwind_stop_reason (struct frame_info *this_frame,
void **this_cache)
{
struct amd64_frame_cache *cache =
amd64_sigtramp_frame_cache (this_frame, this_cache);
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
return UNWIND_NO_REASON;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static void
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
void **this_cache, struct frame_id *this_id)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache =
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_sigtramp_frame_cache (this_frame, this_cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
if (!cache->base_p)
"tfind" across unavailable-stack frames. Like when stepping, the current stack frame location is expected to be printed as result of tfind command, if that results in moving to a different function. In tfind_1 we see: if (from_tty && (has_stack_frames () || traceframe_number >= 0)) { enum print_what print_what; /* NOTE: in imitation of the step command, try to determine whether we have made a transition from one function to another. If so, we'll print the "stack frame" (ie. the new function and it's arguments) -- otherwise we'll just show the new source line. */ if (frame_id_eq (old_frame_id, get_frame_id (get_current_frame ()))) print_what = SRC_LINE; else print_what = SRC_AND_LOC; print_stack_frame (get_selected_frame (NULL), 1, print_what, 1); do_displays (); } However, when we haven't collected any registers in the tracepoint (collect $regs), that doesn't actually work: (gdb) tstart (gdb) info tracepoints Num Type Disp Enb Address What 1 tracepoint keep y 0x080483b7 in func0 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 collect testload installed on target 2 tracepoint keep y 0x080483bc in func1 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:32 collect testload installed on target (gdb) c Continuing. Breakpoint 3, end () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:72 72 } (gdb) tstop (gdb) tfind start Found trace frame 0, tracepoint 1 #0 func0 () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 28 } (gdb) tfind Found trace frame 1, tracepoint 2 32 } (gdb) When we don't have info about the stack available (UNWIND_UNAVAILABLE), frames end up with outer_frame_id as frame ID. And in the scenario above, the issue is that both frames before and after the second tfind (the frames for func0 an func1) have the same id (outer_frame_id), so the frame_id_eq check returns false, even though the frames were of different functions. GDB knows that, because the PC is inferred from the tracepoint's address, even if no registers were collected. To fix this, this patch adds support for frame ids with a valid code address, but <unavailable> stack address, and then makes the unwinders use that instead of the catch-all outer_frame_id for such frames. The frame_id_eq check in tfind_1 then automatically does the right thing as expected. I tested with --directory=gdb.trace/ , before/after the patch, and compared the resulting gdb.logs, then adjusted the tests to expect the extra output that came out. Turns out that was only circ.exp, the original test that actually brought this issue to light. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2013-12-17 Pedro Alves <palves@redhat.com> * frame.h (enum frame_id_stack_status): New enum. (struct frame_id) <stack_addr>: Adjust comment. <stack_addr_p>: Delete field, replaced with ... <stack_status>: ... this new field. (frame_id_build_unavailable_stack): Declare. * frame.c (frame_addr_hash, fprint_field, outer_frame_id) (frame_id_build_special): Adjust. (frame_id_build_unavailable_stack): New function. (frame_id_build, frame_id_build_wild): Adjust. (frame_id_p, frame_id_eq, frame_id_inner): Adjust to take into account frames with unavailable stack. * amd64-tdep.c (amd64_frame_this_id) (amd64_sigtramp_frame_this_id, amd64_epilogue_frame_this_id): Use frame_id_build_unavailable_stack. * dwarf2-frame.c (dwarf2_frame_this_id): Likewise. * i386-tdep.c (i386_frame_this_id, i386_epilogue_frame_this_id) (i386_sigtramp_frame_this_id): Likewise. gdb/testsuite/ 2013-12-17 Pedro Alves <palves@redhat.com> * gdb.trace/circ.exp: Expect frame info to be printed when switching between frames with unavailable stack, but different functions.
2013-12-17 21:47:36 +01:00
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
else if (cache->base == 0)
{
/* This marks the outermost frame. */
return;
}
else
(*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
static struct value *
amd64_sigtramp_frame_prev_register (struct frame_info *this_frame,
void **this_cache, int regnum)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
/* Make sure we've initialized the cache. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_sigtramp_frame_cache (this_frame, this_cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return amd64_frame_prev_register (this_frame, this_cache, regnum);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
static int
amd64_sigtramp_frame_sniffer (const struct frame_unwind *self,
struct frame_info *this_frame,
void **this_cache)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
/* We shouldn't even bother if we don't have a sigcontext_addr
handler. */
if (tdep->sigcontext_addr == NULL)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return 0;
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
if (tdep->sigtramp_p != NULL)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (tdep->sigtramp_p (this_frame))
return 1;
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
if (tdep->sigtramp_start != 0)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
gdb_assert (tdep->sigtramp_end != 0);
if (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return 1;
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return 0;
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
static const struct frame_unwind amd64_sigtramp_frame_unwind =
{
SIGTRAMP_FRAME,
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
amd64_sigtramp_frame_unwind_stop_reason,
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_sigtramp_frame_this_id,
amd64_sigtramp_frame_prev_register,
NULL,
amd64_sigtramp_frame_sniffer
};
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_base_address (struct frame_info *this_frame, void **this_cache)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
struct amd64_frame_cache *cache =
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_frame_cache (this_frame, this_cache);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return cache->base;
}
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
static const struct frame_base amd64_frame_base =
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
&amd64_frame_unwind,
amd64_frame_base_address,
amd64_frame_base_address,
amd64_frame_base_address
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
};
/* Normal frames, but in a function epilogue. */
/* Implement the stack_frame_destroyed_p gdbarch method.
The epilogue is defined here as the 'ret' instruction, which will
follow any instruction such as 'leave' or 'pop %ebp' that destroys
the function's stack frame. */
static int
amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
gdb_byte insn;
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
struct compunit_symtab *cust;
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
cust = find_pc_compunit_symtab (pc);
if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust))
return 0;
if (target_read_memory (pc, &insn, 1))
return 0; /* Can't read memory at pc. */
if (insn != 0xc3) /* 'ret' instruction. */
return 0;
return 1;
}
static int
amd64_epilogue_frame_sniffer (const struct frame_unwind *self,
struct frame_info *this_frame,
void **this_prologue_cache)
{
if (frame_relative_level (this_frame) == 0)
return amd64_stack_frame_destroyed_p (get_frame_arch (this_frame),
get_frame_pc (this_frame));
else
return 0;
}
static struct amd64_frame_cache *
amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct amd64_frame_cache *cache;
gdb_byte buf[8];
if (*this_cache)
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
return (struct amd64_frame_cache *) *this_cache;
cache = amd64_alloc_frame_cache ();
*this_cache = cache;
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
TRY
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
{
/* Cache base will be %esp plus cache->sp_offset (-8). */
get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 8,
byte_order) + cache->sp_offset;
/* Cache pc will be the frame func. */
cache->pc = get_frame_pc (this_frame);
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
/* The saved %esp will be at cache->base plus 16. */
cache->saved_sp = cache->base + 16;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
/* The saved %eip will be at cache->base plus 8. */
cache->saved_regs[AMD64_RIP_REGNUM] = cache->base + 8;
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
cache->base_p = 1;
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
CATCH (ex, RETURN_MASK_ERROR)
Normalize TRY_CATCH exception handling block This normalizes some exception catch blocks that check for ex.reason to look like this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ALL) { ... } if (ex.reason < 0) { ... } ~~~ This is a preparation step for running a script that converts all TRY_CATCH uses to look like this instead: ~~~ TRY { ... } CATCH (ex, RETURN_MASK_ALL) { ... } END_CATCH ~~~ The motivation for that change is being able to reimplent TRY/CATCH in terms of C++ try/catch. This commit makes it so that: - no condition other than ex.reason < 0 is checked in the if predicate - there's no "else" block to check whether no exception was caught - there's no code between the TRY_CATCH (TRY) block and the 'if (ex.reason < 0)' block (CATCH). - the exception object is no longer referred to outside the if/catch block. Note the local volatile exception objects that are currently defined inside functions that use TRY_CATCH will disappear. In cases it's more convenient to still refer to the exception outside the catch block, a new non-volatile local is added and copy to that object is made within the catch block. The following patches should make this all clearer. gdb/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> * amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache) (amd64_epilogue_frame_cache): Normal exception handling code. * break-catch-throw.c (check_status_exception_catchpoint) (re_set_exception_catchpoint): Ditto. * cli/cli-interp.c (safe_execute_command): * cli/cli-script.c (script_from_file): Ditto. * compile/compile-c-symbols.c (generate_c_for_for_one_variable): Ditto. * compile/compile-object-run.c (compile_object_run): Ditto. * cp-abi.c (baseclass_offset): Ditto. * cp-valprint.c (cp_print_value): Ditto. * exceptions.c (catch_exceptions_with_msg): * frame-unwind.c (frame_unwind_try_unwinder): Ditto. * frame.c (get_frame_address_in_block_if_available): Ditto. * i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache) (i386_sigtramp_frame_cache): Ditto. * infcmd.c (post_create_inferior): Ditto. * linespec.c (parse_linespec, find_linespec_symbols): * p-valprint.c (pascal_object_print_value): Ditto. * parse.c (parse_expression_for_completion): Ditto. * python/py-finishbreakpoint.c (bpfinishpy_init): Ditto. * remote.c (remote_get_noisy_reply): Ditto. * s390-linux-tdep.c (s390_frame_unwind_cache): Ditto. * solib-svr4.c (solib_svr4_r_map): Ditto.
2015-03-07 15:50:04 +01:00
{
if (ex.error != NOT_AVAILABLE_ERROR)
throw_exception (ex);
}
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
END_CATCH
return cache;
}
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
static enum unwind_stop_reason
amd64_epilogue_frame_unwind_stop_reason (struct frame_info *this_frame,
void **this_cache)
{
struct amd64_frame_cache *cache
= amd64_epilogue_frame_cache (this_frame, this_cache);
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
return UNWIND_NO_REASON;
}
static void
amd64_epilogue_frame_this_id (struct frame_info *this_frame,
void **this_cache,
struct frame_id *this_id)
{
struct amd64_frame_cache *cache = amd64_epilogue_frame_cache (this_frame,
this_cache);
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
if (!cache->base_p)
"tfind" across unavailable-stack frames. Like when stepping, the current stack frame location is expected to be printed as result of tfind command, if that results in moving to a different function. In tfind_1 we see: if (from_tty && (has_stack_frames () || traceframe_number >= 0)) { enum print_what print_what; /* NOTE: in imitation of the step command, try to determine whether we have made a transition from one function to another. If so, we'll print the "stack frame" (ie. the new function and it's arguments) -- otherwise we'll just show the new source line. */ if (frame_id_eq (old_frame_id, get_frame_id (get_current_frame ()))) print_what = SRC_LINE; else print_what = SRC_AND_LOC; print_stack_frame (get_selected_frame (NULL), 1, print_what, 1); do_displays (); } However, when we haven't collected any registers in the tracepoint (collect $regs), that doesn't actually work: (gdb) tstart (gdb) info tracepoints Num Type Disp Enb Address What 1 tracepoint keep y 0x080483b7 in func0 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 collect testload installed on target 2 tracepoint keep y 0x080483bc in func1 at ../.././../git/gdb/testsuite/gdb.trace/circ.c:32 collect testload installed on target (gdb) c Continuing. Breakpoint 3, end () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:72 72 } (gdb) tstop (gdb) tfind start Found trace frame 0, tracepoint 1 #0 func0 () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28 28 } (gdb) tfind Found trace frame 1, tracepoint 2 32 } (gdb) When we don't have info about the stack available (UNWIND_UNAVAILABLE), frames end up with outer_frame_id as frame ID. And in the scenario above, the issue is that both frames before and after the second tfind (the frames for func0 an func1) have the same id (outer_frame_id), so the frame_id_eq check returns false, even though the frames were of different functions. GDB knows that, because the PC is inferred from the tracepoint's address, even if no registers were collected. To fix this, this patch adds support for frame ids with a valid code address, but <unavailable> stack address, and then makes the unwinders use that instead of the catch-all outer_frame_id for such frames. The frame_id_eq check in tfind_1 then automatically does the right thing as expected. I tested with --directory=gdb.trace/ , before/after the patch, and compared the resulting gdb.logs, then adjusted the tests to expect the extra output that came out. Turns out that was only circ.exp, the original test that actually brought this issue to light. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2013-12-17 Pedro Alves <palves@redhat.com> * frame.h (enum frame_id_stack_status): New enum. (struct frame_id) <stack_addr>: Adjust comment. <stack_addr_p>: Delete field, replaced with ... <stack_status>: ... this new field. (frame_id_build_unavailable_stack): Declare. * frame.c (frame_addr_hash, fprint_field, outer_frame_id) (frame_id_build_special): Adjust. (frame_id_build_unavailable_stack): New function. (frame_id_build, frame_id_build_wild): Adjust. (frame_id_p, frame_id_eq, frame_id_inner): Adjust to take into account frames with unavailable stack. * amd64-tdep.c (amd64_frame_this_id) (amd64_sigtramp_frame_this_id, amd64_epilogue_frame_this_id): Use frame_id_build_unavailable_stack. * dwarf2-frame.c (dwarf2_frame_this_id): Likewise. * i386-tdep.c (i386_frame_this_id, i386_epilogue_frame_this_id) (i386_sigtramp_frame_this_id): Likewise. gdb/testsuite/ 2013-12-17 Pedro Alves <palves@redhat.com> * gdb.trace/circ.exp: Expect frame info to be printed when switching between frames with unavailable stack, but different functions.
2013-12-17 21:47:36 +01:00
(*this_id) = frame_id_build_unavailable_stack (cache->pc);
else
(*this_id) = frame_id_build (cache->base + 8, cache->pc);
}
static const struct frame_unwind amd64_epilogue_frame_unwind =
{
NORMAL_FRAME,
gdb/ * frame.c (frame_unwind_register): Throw an error if unwinding the register failed. * get_prev_frame_1 (get_prev_frame_1): Ask the unwinder if there's an unwind stop reason. (frame_stop_reason_string): Handle UNWIND_UNAVAILABLE. * frame.h (enum unwind_stop_reason) <UNWIND_OUTERMOST, UNWIND_UNAVAILABLE>: New. * inline-frame.c (inline_frame_unwind): Install default_frame_unwind_stop_reason. * frame-unwind.c: Include "exceptions.h". (frame_unwind_find_by_frame): Swallow NOT_AVAILABLE_ERROR errors. (default_frame_unwind_stop_reason): New. * frame-unwind.h (frame_unwind_stop_reason_ftype): New typedef. (default_frame_unwind_stop_reason): Declare. (struct frame_unwind) <stop_reason>: New function pointer. * dummy-frame.c: Install default_frame_unwind_stop_reason. * dwarf2-frame.c: Include exceptions.h. (struct dwarf2_frame_cache) <unavailable_retaddr>: New field. (dwarf2_frame_cache): Swallow NOT_AVAILABLE_ERROR errors when computing the CFA. If such an error was thrown, set unavailable_retaddr. (dwarf2_frame_unwind_stop_reason): New. (dwarf2_frame_this_id): Don't build a frame id if the CFA was unavailable. (dwarf2_frame_unwind): Install dwarf2_frame_unwind_stop_reason. (dwarf2_signal_frame_unwind): Ditto. * amd64-tdep.c: Include "exceptions.h". (struct amd64_frame_cache): New field "base_p". (amd64_init_frame_cache): Clear it. (amd64_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (amd64_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (amd64_frame_unwind_stop_reason): New. (amd64_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_frame_unwind): Install amd64_frame_unwind_stop_reason. (amd64_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_sigtramp_frame_unwind_stop_reason): New. (amd64_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_sigtramp_frame_unwind): Install amd64_sigtramp_frame_unwind_stop_reason. (amd64_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (amd64_epilogue_frame_unwind_stop_reason): New. (amd64_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (amd64_epilogue_frame_unwind): Install amd64_epilogue_frame_unwind_stop_reason. * i386-tdep.c: Include "exceptions.h". (struct i386_frame_cache): New field "base_p". (i386_init_frame_cache): Clear it. (i386_frame_cache_1): New, factored out from amd64_frame_cache. Avoid reading registers with functions that throw if the register is not necessary to compute the frame base. (i386_frame_cache): Reimplement wrapping amd64_frame_cache_1, and swallowing NOT_AVAILABLE_ERROR. (i386_frame_unwind_stop_reason): New. (i386_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_frame_prev_register): Handle unavailable SP. (i386_frame_unwind): Install i386_frame_unwind_stop_reason. (i386_epilogue_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_epilogue_frame_unwind_stop_reason): New. (i386_epilogue_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_epilogue_frame_unwind): Install i386_epilogue_frame_unwind_stop_reason. (i386_sigtramp_frame_cache): Swallow NOT_AVAILABLE_ERROR, and set base_p if the frame base was computable. (i386_sigtramp_frame_unwind_stop_reason): New. (i386_sigtramp_frame_this_id): Don't build a frame id if the frame base was unavailable. (i386_sigtramp_frame_unwind): Install i386_sigtramp_frame_unwind_stop_reason. * sentinel-frame.c (sentinel_frame_prev_register): Use the value type's size, not the register's. (sentinel_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind): Install default_frame_unwind_stop_reason. * alpha-tdep.c (alpha_sigtramp_frame_unwind) (alpha_heuristic_frame_unwind): Ditto. * amd64obsd-tdep.c (amd64obsd_trapframe_unwind): Ditto. * arm-tdep.c (arm_prologue_unwind, arm_stub_unwind): Ditto. * avr-tdep.c (avr_frame_unwind): Ditto. * cris-tdep.c (cris_sigtramp_frame_unwind, cris_frame_unwind): Ditto. * frv-linux-tdep.c (frv_linux_sigtramp_frame_unwind): Ditto. * frv-tdep.c (frv_frame_unwind): Ditto. * h8300-tdep.c (h8300_frame_unwind): Ditto. * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind): Ditto. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind): Ditto. * hppa-tdep.c (hppa_frame_unwind, hppa_fallback_frame_unwind) (hppa_stub_frame_unwind): Ditto. * i386obsd-tdep.c (i386obsd_trapframe_unwind): Ditto. * ia64-tdep.c (ia64_frame_unwind, ia64_sigtramp_frame_unwind) (ia64_libunwind_frame_unwind) (ia64_libunwind_sigtramp_frame_unwind): Ditto. * iq2000-tdep.c (iq2000_frame_unwind): Ditto. * lm32-tdep.c (lm32_frame_unwind): Ditto. * m32c-tdep.c (m32c_unwind): Ditto. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_unwind): Ditto. * m32r-tdep.c (m32r_frame_unwind): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind): Ditto. * m68k-tdep.c (m68k_frame_unwind): Ditto. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_unwind): Ditto. * m88k-tdep.c (m88k_frame_unwind): Ditto. * mep-tdep.c (mep_frame_unwind): Ditto. * microblaze-tdep.c (microblaze_frame_unwind): Ditto. * mips-tdep.c (mips_insn16_frame_unwind, mips_insn32_frame_unwind) (mips_stub_frame_unwind): Ditto. * mn10300-tdep.c (mn10300_frame_unwind): Ditto. * moxie-tdep.c (moxie_frame_unwind): Ditto. * mt-tdep.c (mt_frame_unwind): Ditto. * ppc-linux-tdep.c (ppu2spu_unwind): Ditto. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_unwind): Ditto. * rs6000-tdep.c (rs6000_frame_unwind): Ditto. * s390-tdep.c (s390_frame_unwind, s390_stub_frame_unwind) (s390_sigtramp_frame_unwind): Ditto. * score-tdep.c (score_prologue_unwind): Ditto. * sh-tdep.c (sh_frame_unwind): Ditto. * sh64-tdep.c (sh64_frame_unwind): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_unwind): Ditto. * sparc-tdep.c (sparc32_frame_unwind): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_unwind): Ditto. * sparc64-tdep.c (sparc64_frame_unwind): Ditto. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_unwind): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_unwind): Ditto. * sparc64obsd-tdep.c (sparc64obsd_frame_unwind) (sparc64obsd_trapframe_unwind): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_unwind): Ditto. * sparcobsd-tdep.c (sparc32obsd_sigtramp_frame_unwind): Ditto. * spu-tdep.c (spu_frame_unwind, spu2ppu_unwind): Ditto. * v850-tdep.c (v850_frame_unwind): Ditto. * vax-tdep.c (vax_frame_unwind): Ditto. * vaxobsd-tdep.c (vaxobsd_sigtramp_frame_unwind): Ditto. * xstormy16-tdep.c (frame_unwind xstormy16_frame_unwind): Ditto. * xtensa-tdep.c (xtensa_unwind): Ditto.
2011-03-18 19:52:32 +01:00
amd64_epilogue_frame_unwind_stop_reason,
amd64_epilogue_frame_this_id,
amd64_frame_prev_register,
NULL,
amd64_epilogue_frame_sniffer
};
static struct frame_id
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
CORE_ADDR fp;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
fp = get_frame_register_unsigned (this_frame, AMD64_RBP_REGNUM);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return frame_id_build (fp + 16, get_frame_pc (this_frame));
}
/* 16 byte align the SP per frame requirements. */
static CORE_ADDR
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
amd64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
return sp & -(CORE_ADDR)16;
}
/* Supply register REGNUM from the buffer specified by FPREGS and LEN
in the floating-point register set REGSET to register cache
REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
static void
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Fix internal error when core file section is too big As reported in PR 17808, a test case with a forged (invalid) core file can crash GDB with an assertion failure. In that particular case the prstatus of an i386 core file looks like that from an AMD64 core file. Consequently the respective regset supply function i386_supply_gregset is invoked with a larger buffer than usual. But i386_supply_gregset asserts a specific buffer size, and this assertion fails. The patch relaxes all buffer size assertions in regset supply functions such that they merely check for a sufficiently large buffer. For consistency the regset collect functions are adjusted as well. gdb/ChangeLog: PR corefiles/17808: * gdbarch.sh (iterate_over_regset_sections_cb): Document this function type, particularly its SIZE parameter. * gdbarch.h: Regenerate. * amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare actual against required size using ">=" instead of "==". (amd64_collect_fpregset): Likewise. * i386-tdep.c (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise. (mips_fill_gregset_wrapper): Likewise. (mips_supply_fpregset_wrapper): Likewise. (mips_fill_fpregset_wrapper): Likewise. (mips64_supply_gregset_wrapper): Likewise. (mips64_fill_gregset_wrapper): Likewise. (mips64_supply_fpregset_wrapper): Likewise. (mips64_fill_fpregset_wrapper): Likewise. * mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise. (am33_supply_fpregset_method): Likewise. (am33_collect_gregset_method): Likewise. (am33_collect_fpregset_method): Likewise.
2015-01-14 13:01:38 +01:00
gdb_assert (len >= tdep->sizeof_fpregset);
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
amd64_supply_fxsave (regcache, regnum, fpregs);
}
/* Collect register REGNUM from the register cache REGCACHE and store
it in the buffer specified by FPREGS and LEN as described by the
floating-point register set REGSET. If REGNUM is -1, do this for
all registers in REGSET. */
static void
amd64_collect_fpregset (const struct regset *regset,
const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Fix internal error when core file section is too big As reported in PR 17808, a test case with a forged (invalid) core file can crash GDB with an assertion failure. In that particular case the prstatus of an i386 core file looks like that from an AMD64 core file. Consequently the respective regset supply function i386_supply_gregset is invoked with a larger buffer than usual. But i386_supply_gregset asserts a specific buffer size, and this assertion fails. The patch relaxes all buffer size assertions in regset supply functions such that they merely check for a sufficiently large buffer. For consistency the regset collect functions are adjusted as well. gdb/ChangeLog: PR corefiles/17808: * gdbarch.sh (iterate_over_regset_sections_cb): Document this function type, particularly its SIZE parameter. * gdbarch.h: Regenerate. * amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare actual against required size using ">=" instead of "==". (amd64_collect_fpregset): Likewise. * i386-tdep.c (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise. (mips_fill_gregset_wrapper): Likewise. (mips_supply_fpregset_wrapper): Likewise. (mips_fill_fpregset_wrapper): Likewise. (mips64_supply_gregset_wrapper): Likewise. (mips64_fill_gregset_wrapper): Likewise. (mips64_supply_fpregset_wrapper): Likewise. (mips64_fill_fpregset_wrapper): Likewise. * mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise. (am33_supply_fpregset_method): Likewise. (am33_collect_gregset_method): Likewise. (am33_collect_fpregset_method): Likewise.
2015-01-14 13:01:38 +01:00
gdb_assert (len >= tdep->sizeof_fpregset);
amd64_collect_fxsave (regcache, regnum, fpregs);
}
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
const struct regset amd64_fpregset =
{
NULL, amd64_supply_fpregset, amd64_collect_fpregset
};
/* Figure out where the longjmp will land. Slurp the jmp_buf out of
%rdi. We expect its value to be a pointer to the jmp_buf structure
from which we extract the address that we will land at. This
address is copied into PC. This routine returns non-zero on
success. */
static int
amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
gdb_byte buf[8];
CORE_ADDR jb_addr;
struct gdbarch *gdbarch = get_frame_arch (frame);
int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset;
* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch) instead of builtin_type_ macros. * amd64-tdep.c (amd64_register_type): Likewise. (amd64_get_longjmp_target): Likewise. * arm-tdep.c (arm_register_type): Likewise. * avr-tdep.c (avr_register_type): Likewise. * cris-tdep.c (cris_register_type, crisv32_register_type): Likewise. * frv-tdep.c (frv_register_type): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * hppa-tdep.c (hppa32_convert_from_func_ptr_addr, hppa_skip_trampoline_code): Likewise. * i386-tdep.c (i386_register_type): Likewise. (i386_unwind_pc, i386_sse_type): Likewise. * ia64-tdep.c (ia64_register_type): Likewise. * m32r-tdep.c (m32r_register_type): Likewise. * m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise. * m88k-tdep.c (m88k_register_type): Likewise. * mep-tdep.c (mep_register_type): Likewise. * mips-tdep.c (mips_pseudo_register_type): Likewise. * mn10300-tdep.c (mn10300_register_type): Likewise. * mt-tdep.c (mt_copro_register_type): Likewise. * rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise. (rs6000_convert_register_p, rs6000_register_to_value, rs6000_value_to_register): Likewise. * s390-tdep.c (s390_register_type): Likewise. * sh64-tdep.c (sh64_register_type): Likewise. (sh64_build_float_register_type, sh64_do_fp_register): Likewise. * sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_build_float_register_type, sh_sh4_register_type, sh_default_register_type): Likewise. * sparc64-tdep.c (sparc64_register_type): Likewise. * sparc-tdep.c (sparc32_register_type): Likewise. * spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise. * v850-tdep.c (v850_register_type): Likewise. * vax-tdep.c (vax_register_type): Likewise. * xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc, xtensa_push_dummy_call): Likewise. * std-regs.c (value_of_builtin_frame_fp_reg, value_of_builtin_frame_pc_reg): Likewise. * target-descriptions.c (tdesc_register_type): Likewise.
2008-09-11 16:23:15 +02:00
int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr);
/* If JB_PC_OFFSET is -1, we have no way to find out where the
longjmp will land. */
if (jb_pc_offset == -1)
return 0;
get_frame_register (frame, AMD64_RDI_REGNUM, buf);
* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch) instead of builtin_type_ macros. * amd64-tdep.c (amd64_register_type): Likewise. (amd64_get_longjmp_target): Likewise. * arm-tdep.c (arm_register_type): Likewise. * avr-tdep.c (avr_register_type): Likewise. * cris-tdep.c (cris_register_type, crisv32_register_type): Likewise. * frv-tdep.c (frv_register_type): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * hppa-tdep.c (hppa32_convert_from_func_ptr_addr, hppa_skip_trampoline_code): Likewise. * i386-tdep.c (i386_register_type): Likewise. (i386_unwind_pc, i386_sse_type): Likewise. * ia64-tdep.c (ia64_register_type): Likewise. * m32r-tdep.c (m32r_register_type): Likewise. * m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise. * m88k-tdep.c (m88k_register_type): Likewise. * mep-tdep.c (mep_register_type): Likewise. * mips-tdep.c (mips_pseudo_register_type): Likewise. * mn10300-tdep.c (mn10300_register_type): Likewise. * mt-tdep.c (mt_copro_register_type): Likewise. * rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise. (rs6000_convert_register_p, rs6000_register_to_value, rs6000_value_to_register): Likewise. * s390-tdep.c (s390_register_type): Likewise. * sh64-tdep.c (sh64_register_type): Likewise. (sh64_build_float_register_type, sh64_do_fp_register): Likewise. * sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_build_float_register_type, sh_sh4_register_type, sh_default_register_type): Likewise. * sparc64-tdep.c (sparc64_register_type): Likewise. * sparc-tdep.c (sparc32_register_type): Likewise. * spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise. * v850-tdep.c (v850_register_type): Likewise. * vax-tdep.c (vax_register_type): Likewise. * xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc, xtensa_push_dummy_call): Likewise. * std-regs.c (value_of_builtin_frame_fp_reg, value_of_builtin_frame_pc_reg): Likewise. * target-descriptions.c (tdesc_register_type): Likewise.
2008-09-11 16:23:15 +02:00
jb_addr= extract_typed_address
(buf, builtin_type (gdbarch)->builtin_data_ptr);
if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
return 0;
* alpha-tdep.c (alpha_register_type): Use builtin_type (gdbarch) instead of builtin_type_ macros. * amd64-tdep.c (amd64_register_type): Likewise. (amd64_get_longjmp_target): Likewise. * arm-tdep.c (arm_register_type): Likewise. * avr-tdep.c (avr_register_type): Likewise. * cris-tdep.c (cris_register_type, crisv32_register_type): Likewise. * frv-tdep.c (frv_register_type): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * hppa-tdep.c (hppa32_convert_from_func_ptr_addr, hppa_skip_trampoline_code): Likewise. * i386-tdep.c (i386_register_type): Likewise. (i386_unwind_pc, i386_sse_type): Likewise. * ia64-tdep.c (ia64_register_type): Likewise. * m32r-tdep.c (m32r_register_type): Likewise. * m68k-tdep.c (m68k_register_type, m68k_unwind_pc): Likewise. * m88k-tdep.c (m88k_register_type): Likewise. * mep-tdep.c (mep_register_type): Likewise. * mips-tdep.c (mips_pseudo_register_type): Likewise. * mn10300-tdep.c (mn10300_register_type): Likewise. * mt-tdep.c (mt_copro_register_type): Likewise. * rs6000-tdep.c (rs6000_builtin_type_vec64): Likewise. (rs6000_convert_register_p, rs6000_register_to_value, rs6000_value_to_register): Likewise. * s390-tdep.c (s390_register_type): Likewise. * sh64-tdep.c (sh64_register_type): Likewise. (sh64_build_float_register_type, sh64_do_fp_register): Likewise. * sh-tdep.c (sh_sh2a_register_type, sh_sh3e_register_type, sh_sh4_build_float_register_type, sh_sh4_register_type, sh_default_register_type): Likewise. * sparc64-tdep.c (sparc64_register_type): Likewise. * sparc-tdep.c (sparc32_register_type): Likewise. * spu-tdep.c (spu_builtin_type_vec128, spu_register_type): Likewise. * v850-tdep.c (v850_register_type): Likewise. * vax-tdep.c (vax_register_type): Likewise. * xtensa-tdep.c (xtensa_register_type, xtensa_unwind_pc, xtensa_push_dummy_call): Likewise. * std-regs.c (value_of_builtin_frame_fp_reg, value_of_builtin_frame_pc_reg): Likewise. * target-descriptions.c (tdesc_register_type): Likewise.
2008-09-11 16:23:15 +02:00
*pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
return 1;
}
static const int amd64_record_regmap[] =
{
AMD64_RAX_REGNUM, AMD64_RCX_REGNUM, AMD64_RDX_REGNUM, AMD64_RBX_REGNUM,
AMD64_RSP_REGNUM, AMD64_RBP_REGNUM, AMD64_RSI_REGNUM, AMD64_RDI_REGNUM,
AMD64_R8_REGNUM, AMD64_R9_REGNUM, AMD64_R10_REGNUM, AMD64_R11_REGNUM,
AMD64_R12_REGNUM, AMD64_R13_REGNUM, AMD64_R14_REGNUM, AMD64_R15_REGNUM,
AMD64_RIP_REGNUM, AMD64_EFLAGS_REGNUM, AMD64_CS_REGNUM, AMD64_SS_REGNUM,
AMD64_DS_REGNUM, AMD64_ES_REGNUM, AMD64_FS_REGNUM, AMD64_GS_REGNUM
};
void
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
const struct target_desc *tdesc = info.target_desc;
Extend SystemTap SDT probe argument parser This patch extends the current generic parser for SystemTap SDT probe arguments. It can be almost considered a cleanup, but the main point of it is actually to allow the generic parser to accept multiple prefixes and suffixes for the its operands (i.e., integers, register names, and register indirection). I have chosen to implement this as a list of const strings, and declare this list as "static" inside each target's method used to initialize gdbarch. This patch is actually a preparation for an upcoming patch for ARM, which implements the support for multiple integer prefixes (as defined by ARM's asm spec). And AArch64 will also need this, for the same reason. This patch was regtested on all architectures that it touches (i.e., i386, x86_64, ARM, PPC/PPC64, s390x and IA-64). No regressions were found. 2013-12-19 Sergio Durigan Junior <sergiodj@redhat.com> * amd64-tdep.c (amd64_init_abi): Declare SystemTap SDT probe argument prefixes and suffixes. Initialize gdbarch with them. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix, stap_integer_suffix) (stap_register_prefix, stap_register_suffix) (stap_register_indirection_prefix) (stap_register_indirection_suffix): Declare as "const char *const *" instead of "const char *". Adjust printing function. Rename all of the variables to the plural. (pstring_list): New function. * i386-tdep.c (i386_elf_init_abi): Declare SystemTap SDT probe argument prefixes and suffixes. Initialize gdbarch with them. * ia64-linux-tdep.c (ia64_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * stap-probe.c (stap_is_generic_prefix): New function. (stap_is_register_prefix): Likewise. (stap_is_register_indirection_prefix): Likewise. (stap_is_integer_prefix): Likewise. (stap_generic_check_suffix): Likewise. (stap_check_integer_suffix): Likewise. (stap_check_register_suffix): Likewise. (stap_check_register_indirection_suffix): Likewise. (stap_parse_register_operand): Remove unecessary declarations for variables holding prefix and suffix information. Use the new functions listed above for checking for prefixes and suffixes. (stap_parse_single_operand): Likewise.
2013-12-19 21:53:40 +01:00
static const char *const stap_integer_prefixes[] = { "$", NULL };
static const char *const stap_register_prefixes[] = { "%", NULL };
static const char *const stap_register_indirection_prefixes[] = { "(",
NULL };
static const char *const stap_register_indirection_suffixes[] = { ")",
NULL };
/* AMD64 generally uses `fxsave' instead of `fsave' for saving its
floating-point registers. */
tdep->sizeof_fpregset = I387_SIZEOF_FXSAVE;
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
tdep->fpregset = &amd64_fpregset;
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
if (! tdesc_has_registers (tdesc))
tdesc = tdesc_amd64;
tdep->tdesc = tdesc;
tdep->num_core_regs = AMD64_NUM_GREGS + I387_NUM_REGS;
tdep->register_names = amd64_register_names;
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx512") != NULL)
{
tdep->zmmh_register_names = amd64_zmmh_names;
tdep->k_register_names = amd64_k_names;
tdep->xmm_avx512_register_names = amd64_xmm_avx512_names;
tdep->ymm16h_register_names = amd64_ymmh_avx512_names;
tdep->num_zmm_regs = 32;
tdep->num_xmm_avx512_regs = 16;
tdep->num_ymm_avx512_regs = 16;
tdep->zmm0h_regnum = AMD64_ZMM0H_REGNUM;
tdep->k0_regnum = AMD64_K0_REGNUM;
tdep->xmm16_regnum = AMD64_XMM16_REGNUM;
tdep->ymm16h_regnum = AMD64_YMM16H_REGNUM;
}
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx") != NULL)
{
tdep->ymmh_register_names = amd64_ymmh_names;
tdep->num_ymm_regs = 16;
tdep->ymm0h_regnum = AMD64_YMM0H_REGNUM;
}
if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.mpx") != NULL)
{
tdep->mpx_register_names = amd64_mpx_names;
tdep->bndcfgu_regnum = AMD64_BNDCFGU_REGNUM;
tdep->bnd0r_regnum = AMD64_BND0R_REGNUM;
}
tdep->num_byte_regs = 20;
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
tdep->num_word_regs = 16;
tdep->num_dword_regs = 16;
/* Avoid wiring in the MMX registers for now. */
tdep->num_mmx_regs = 0;
set_gdbarch_pseudo_register_read_value (gdbarch,
amd64_pseudo_register_read_value);
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
set_gdbarch_pseudo_register_write (gdbarch,
amd64_pseudo_register_write);
set_gdbarch_ax_pseudo_register_collect (gdbarch,
amd64_ax_pseudo_register_collect);
Support x86 pseudo byte, word and dword registers. gdb/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * amd64-tdep.c (amd64_byte_names): New. (amd64_word_names): Likewise. (amd64_dword_names): Likewise. (amd64_pseudo_register_name): Likewise. (amd64_pseudo_register_read): Likewise. (amd64_pseudo_register_write): Likewise. (amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs and num_mmx_regs. Call set_gdbarch_pseudo_register_read, set_gdbarch_pseudo_register_write and set_tdesc_pseudo_register_name. Don't call set_gdbarch_num_pseudo_regs. Don't set mm0_regnum. * i386-tdep.c (i386_num_mmx_regs): Removed. (i386_num_pseudo_regs): Likewise. (i386_byte_names): New. (i386_word_names): Likewise. (i386_byte_regnum_p): Likewise. (i386_word_regnum_p): Likewise. (i386_mmx_regnum_p): Updated. (i386_pseudo_register_name): Make it global. Handle byte and word pseudo-registers. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. (i386_pseudo_register_type): Handle byte, word and dword pseudo-registers (i386_register_reggroup_p): Don't include pseudo registers, except for MXX, in any register groups. Don't include pseudo byte, word, dword registers in general_reggroup. (i386_gdbarch_init): Set num_byte_regs, num_word_regs, num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX pseudo-registers after word pseudo-registers. Call set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi. * i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs, al_regnum, num_word_regs, ax_regnum, num_dword_regs and eax_regnum. (i386_byte_regnum_p): New. (i386_word_regnum_p): Likewise. (i386_dword_regnum_p): Likewise. (i386_pseudo_register_name): Likewise. (i386_pseudo_register_read): Likewise. (i386_pseudo_register_write): Likewise. gdb/testsuite/ 2010-03-02 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/amd64-byte.exp: New. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-pseudo.c: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-pseudo.c: Likewise. * gdb.arch/i386-word.exp: Likewise.
2010-03-02 14:14:36 +01:00
set_tdesc_pseudo_register_name (gdbarch, amd64_pseudo_register_name);
* i386-tdep.h: Put opaque declarations in alphabetical 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.
2003-09-27 23:57:56 +02:00
/* AMD64 has an FPU and 16 SSE registers. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
tdep->st0_regnum = AMD64_ST0_REGNUM;
tdep->num_xmm_regs = 16;
/* This is what all the fuss is about. */
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
/* In contrast to the i386, on AMD64 a `long double' actually takes
up 128 bits, even though it's still based on the i387 extended
floating-point format which has only 80 significant bits. */
set_gdbarch_long_double_bit (gdbarch, 128);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
set_gdbarch_num_regs (gdbarch, AMD64_NUM_REGS);
/* Register numbers of various important registers. */
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
set_gdbarch_sp_regnum (gdbarch, AMD64_RSP_REGNUM); /* %rsp */
set_gdbarch_pc_regnum (gdbarch, AMD64_RIP_REGNUM); /* %rip */
set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */
set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
/* The "default" register numbering scheme for AMD64 is referred to
as the "DWARF Register Number Mapping" in the System V psABI.
The preferred debugging format for all known AMD64 targets is
actually DWARF2, and GCC doesn't seem to support DWARF (that is
DWARF-1), but we provide the same mapping just in case. This
mapping is also used for stabs, which GCC does support. */
set_gdbarch_stab_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, amd64_dwarf_reg_to_regnum);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* We don't override SDB_REG_RO_REGNUM, since COFF doesn't seem to
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
be in use on any of the supported AMD64 targets. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Call dummy code. */
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
set_gdbarch_push_dummy_call (gdbarch, amd64_push_dummy_call);
set_gdbarch_frame_align (gdbarch, amd64_frame_align);
set_gdbarch_frame_red_zone_size (gdbarch, 128);
set_gdbarch_convert_register_p (gdbarch, i387_convert_register_p);
set_gdbarch_register_to_value (gdbarch, i387_register_to_value);
set_gdbarch_value_to_register (gdbarch, i387_value_to_register);
set_gdbarch_return_value (gdbarch, amd64_return_value);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
set_gdbarch_skip_prologue (gdbarch, amd64_skip_prologue);
tdep->record_regmap = amd64_record_regmap;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
set_gdbarch_dummy_id (gdbarch, amd64_dummy_id);
/* Hook the function epilogue frame unwinder. This unwinder is
appended to the list first, so that it supercedes the other
unwinders in function epilogues. */
frame_unwind_prepend_unwinder (gdbarch, &amd64_epilogue_frame_unwind);
/* Hook the prologue-based frame unwinders. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
frame_unwind_append_unwinder (gdbarch, &amd64_sigtramp_frame_unwind);
frame_unwind_append_unwinder (gdbarch, &amd64_frame_unwind);
* x86-64-tdep.c: Update copyright year. (struct amd64_register_info): Rename from x86_64_register_info. (amd64_register_info): Rename from x86_64_register_info. (AMD64_NUM_REGS): Rename from X86_64_NUM_REGS. (amd64_register_name): Rename from x86_64_register_name. (amd64_register_type): Rename from x86_64_register_type. (amd64_dwarf_regmap): Rename from x86_64_dwarf_regmap. (amd64_dwarf_regmap_len): Rename from x86_64_dwarf_regmap_len. (amd64_dwarf_reg_to_regnum): Rename from x86_64_dwarf_reg_to_regnum. (amd64_convert_register_p): Rename from x86_64_convert_register_p. (amd64_push_dummy_call): Rename from x86_64_push_dummy_call. (AMD64_NUM_SAVED_REGS): Rename from X86_64_NUM_SAVED_REGS. (struct amd64_frame_cache): Renamed from x86_64_frame_cache. (amd64_alloc_frame_cache): Renamed from x86_64_alloc_frame_cache. (amd64_analyze_prologue): Rename from x86_64_analyze_prologue. (amd64_skip_prologue): Rename from x86_64_skip_prologue. (amd64_frame_cache): Rename from x86_64_frame_cache. (amd64_frame_this_id): Rename from x86_64_frame_this_id. (amd64_frame_prev_register): Rename from x86_64_frame_prev_register. (amd64_frame_unwind): Rename from x86_64_frame_unwind. (amd64_frame_sniffer): Rename from x86_64_frame_sniffer. (amd64_sigtramp_frame_cache): Rename from x86_64_sigtramp_frame_cache. (amd64_sigtramp_frame_prev_register): Rename from x86_64_sigtramp_frame_prev_register. (amd64_sigtramp_frame_unwind): Rename from x86_64_sigtramp_frame_unwind. (amd64_sigtramp_frame_sniffer): Rename from x86_64_sigtramp_frame_sniffer. (amd64_frame_base_address): Rename from x86_64_frame_base_address. (amd64_frame_base): Rename from x86_64_frame_base. (amd64_unwind_dummy_id): Rename from x86_64_unwind_dummy_id. (amd64_frame_align): Rename from x86_64_frame_align. (amd64_supply_fpregset): Rename from x86_64_supply_fpregset. (amd64_regset_from_core_section): Rename from x86_64_regset_from_core_section. (x86_64_init_abi): Update comments.
2004-01-04 20:07:02 +01:00
frame_base_set_default (gdbarch, &amd64_frame_base);
set_gdbarch_get_longjmp_target (gdbarch, amd64_get_longjmp_target);
set_gdbarch_relocate_instruction (gdbarch, amd64_relocate_instruction);
set_gdbarch_gen_return_address (gdbarch, amd64_gen_return_address);
2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com> Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (SFILES): Add `probe' and `stap-probe'. (COMMON_OBS): Likewise. (HFILES_NO_SRCDIR): Add `probe'. * NEWS: Mention support for static and SystemTap probes. * amd64-tdep.c (amd64_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * arm-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (arm_stap_is_single_operand): New function. (arm_stap_parse_special_token): Likewise. (arm_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * ax-gdb.c (require_rvalue): Removing static declaration. (gen_expr): Likewise. * ax-gdb.h (gen_expr): Declaring function. (require_rvalue): Likewise. * breakpoint.c: Include `gdb_regex.h' and `probe.h'. (bkpt_probe_breakpoint_ops): New variable. (momentary_breakpoint_from_master): Set the `probe' value. (add_location_to_breakpoint): Likewise. (break_command_1): Using proper breakpoint_ops according to the argument passed by the user in the command line. (bkpt_probe_insert_location): New function. (bkpt_probe_remove_location): Likewise. (bkpt_probe_create_sals_from_address): Likewise. (bkpt_probe_decode_linespec): Likewise. (tracepoint_probe_create_sals_from_address): Likewise. (tracepoint_probe_decode_linespec): Likewise. (tracepoint_probe_breakpoint_ops): New variable. (trace_command): Using proper breakpoint_ops according to the argument passed by the user in the command line. (initialize_breakpoint_ops): Initializing breakpoint_ops for static probes on breakpoints and tracepoints. * breakpoint.h (struct bp_location) <probe>: New field. * cli-utils.c (skip_spaces_const): New function. (extract_arg): Likewise. * cli-utils.h (skip_spaces_const): Likewise. (extract_arg): Likewise. * coffread.c (coff_sym_fns): Add `sym_probe_fns' value. * configure.ac: Append `stap-probe.o' to be generated when ELF support is present. * configure: Regenerate. * dbxread.c (aout_sym_fns): Add `sym_probe_fns' value. * elfread.c: Include `probe.h' and `arch-utils.h'. (probe_key): New variable. (elf_get_probes): New function. (elf_get_probe_argument_count): Likewise. (elf_evaluate_probe_argument): Likewise. (elf_compile_to_ax): Likewise. (elf_symfile_relocate_probe): Likewise. (stap_probe_key_free): Likewise. (elf_probe_fns): New variable. (elf_sym_fns): Add `sym_probe_fns' value. (elf_sym_fns_lazy_psyms): Likewise. (elf_sym_fns_gdb_index): Likewise. (_initialize_elfread): Initialize objfile cache for static probes. * gdb_vecs.h (struct probe): New forward declaration. (probe_p): New VEC declaration. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix): New variable. (stap_integer_suffix): Likewise. (stap_register_prefix): Likewise. (stap_register_suffix): Likewise. (stap_register_indirection_prefix): Likewise. (stap_register_indirection_suffix): Likewise. (stap_gdb_register_prefix): Likewise. (stap_gdb_register_suffix): Likewise. (stap_is_single_operand): New function. (stap_parse_special_token): Likewise. (struct stap_parse_info): Forward declaration. * i386-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. (i386_elf_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * i386-tdep.h (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. * machoread.c (macho_sym_fns): Add `sym_probe_fns' value. * mipsread.c (ecoff_sym_fns): Likewise. * objfiles.c (objfile_relocate1): Support relocation for static probes. * parse.c (prefixify_expression): Remove static declaration. (initialize_expout): Likewise. (reallocate_expout): Likewise. * parser-defs.h (initialize_expout): Declare function. (reallocate_expout): Likewise. (prefixify_expression): Likewise. * ppc-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (ppc_stap_is_single_operand): New function. (ppc_stap_parse_special_token): Likewise. (ppc_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * probe.c: New file, for generic statically defined probe support. * probe.h: Likewise. * s390-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (s390_stap_is_single_operand): New function. (s390_gdbarch_init): Initializing proper fields used by SystemTap probes' arguments parser. * somread.c (som_sym_fns): Add `sym_probe_fns' value. * stap-probe.c: New file, for SystemTap probe support. * stap-probe.h: Likewise. * symfile.h: Include `gdb_vecs.h'. (struct sym_probe_fns): New struct. (struct sym_fns) <sym_probe_fns>: New field. * symtab.c (init_sal): Initialize `probe' field. * symtab.h (struct probe): Forward declaration. (struct symtab_and_line) <probe>: New field. * tracepoint.c (start_tracing): Adjust semaphore on breakpoints locations. (stop_tracing): Likewise. * xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
2012-04-27 22:47:57 +02:00
/* SystemTap variables and functions. */
Extend SystemTap SDT probe argument parser This patch extends the current generic parser for SystemTap SDT probe arguments. It can be almost considered a cleanup, but the main point of it is actually to allow the generic parser to accept multiple prefixes and suffixes for the its operands (i.e., integers, register names, and register indirection). I have chosen to implement this as a list of const strings, and declare this list as "static" inside each target's method used to initialize gdbarch. This patch is actually a preparation for an upcoming patch for ARM, which implements the support for multiple integer prefixes (as defined by ARM's asm spec). And AArch64 will also need this, for the same reason. This patch was regtested on all architectures that it touches (i.e., i386, x86_64, ARM, PPC/PPC64, s390x and IA-64). No regressions were found. 2013-12-19 Sergio Durigan Junior <sergiodj@redhat.com> * amd64-tdep.c (amd64_init_abi): Declare SystemTap SDT probe argument prefixes and suffixes. Initialize gdbarch with them. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix, stap_integer_suffix) (stap_register_prefix, stap_register_suffix) (stap_register_indirection_prefix) (stap_register_indirection_suffix): Declare as "const char *const *" instead of "const char *". Adjust printing function. Rename all of the variables to the plural. (pstring_list): New function. * i386-tdep.c (i386_elf_init_abi): Declare SystemTap SDT probe argument prefixes and suffixes. Initialize gdbarch with them. * ia64-linux-tdep.c (ia64_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * stap-probe.c (stap_is_generic_prefix): New function. (stap_is_register_prefix): Likewise. (stap_is_register_indirection_prefix): Likewise. (stap_is_integer_prefix): Likewise. (stap_generic_check_suffix): Likewise. (stap_check_integer_suffix): Likewise. (stap_check_register_suffix): Likewise. (stap_check_register_indirection_suffix): Likewise. (stap_parse_register_operand): Remove unecessary declarations for variables holding prefix and suffix information. Use the new functions listed above for checking for prefixes and suffixes. (stap_parse_single_operand): Likewise.
2013-12-19 21:53:40 +01:00
set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);
set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes);
set_gdbarch_stap_register_indirection_prefixes (gdbarch,
stap_register_indirection_prefixes);
set_gdbarch_stap_register_indirection_suffixes (gdbarch,
stap_register_indirection_suffixes);
2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com> Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (SFILES): Add `probe' and `stap-probe'. (COMMON_OBS): Likewise. (HFILES_NO_SRCDIR): Add `probe'. * NEWS: Mention support for static and SystemTap probes. * amd64-tdep.c (amd64_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * arm-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (arm_stap_is_single_operand): New function. (arm_stap_parse_special_token): Likewise. (arm_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * ax-gdb.c (require_rvalue): Removing static declaration. (gen_expr): Likewise. * ax-gdb.h (gen_expr): Declaring function. (require_rvalue): Likewise. * breakpoint.c: Include `gdb_regex.h' and `probe.h'. (bkpt_probe_breakpoint_ops): New variable. (momentary_breakpoint_from_master): Set the `probe' value. (add_location_to_breakpoint): Likewise. (break_command_1): Using proper breakpoint_ops according to the argument passed by the user in the command line. (bkpt_probe_insert_location): New function. (bkpt_probe_remove_location): Likewise. (bkpt_probe_create_sals_from_address): Likewise. (bkpt_probe_decode_linespec): Likewise. (tracepoint_probe_create_sals_from_address): Likewise. (tracepoint_probe_decode_linespec): Likewise. (tracepoint_probe_breakpoint_ops): New variable. (trace_command): Using proper breakpoint_ops according to the argument passed by the user in the command line. (initialize_breakpoint_ops): Initializing breakpoint_ops for static probes on breakpoints and tracepoints. * breakpoint.h (struct bp_location) <probe>: New field. * cli-utils.c (skip_spaces_const): New function. (extract_arg): Likewise. * cli-utils.h (skip_spaces_const): Likewise. (extract_arg): Likewise. * coffread.c (coff_sym_fns): Add `sym_probe_fns' value. * configure.ac: Append `stap-probe.o' to be generated when ELF support is present. * configure: Regenerate. * dbxread.c (aout_sym_fns): Add `sym_probe_fns' value. * elfread.c: Include `probe.h' and `arch-utils.h'. (probe_key): New variable. (elf_get_probes): New function. (elf_get_probe_argument_count): Likewise. (elf_evaluate_probe_argument): Likewise. (elf_compile_to_ax): Likewise. (elf_symfile_relocate_probe): Likewise. (stap_probe_key_free): Likewise. (elf_probe_fns): New variable. (elf_sym_fns): Add `sym_probe_fns' value. (elf_sym_fns_lazy_psyms): Likewise. (elf_sym_fns_gdb_index): Likewise. (_initialize_elfread): Initialize objfile cache for static probes. * gdb_vecs.h (struct probe): New forward declaration. (probe_p): New VEC declaration. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix): New variable. (stap_integer_suffix): Likewise. (stap_register_prefix): Likewise. (stap_register_suffix): Likewise. (stap_register_indirection_prefix): Likewise. (stap_register_indirection_suffix): Likewise. (stap_gdb_register_prefix): Likewise. (stap_gdb_register_suffix): Likewise. (stap_is_single_operand): New function. (stap_parse_special_token): Likewise. (struct stap_parse_info): Forward declaration. * i386-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. (i386_elf_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * i386-tdep.h (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. * machoread.c (macho_sym_fns): Add `sym_probe_fns' value. * mipsread.c (ecoff_sym_fns): Likewise. * objfiles.c (objfile_relocate1): Support relocation for static probes. * parse.c (prefixify_expression): Remove static declaration. (initialize_expout): Likewise. (reallocate_expout): Likewise. * parser-defs.h (initialize_expout): Declare function. (reallocate_expout): Likewise. (prefixify_expression): Likewise. * ppc-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (ppc_stap_is_single_operand): New function. (ppc_stap_parse_special_token): Likewise. (ppc_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * probe.c: New file, for generic statically defined probe support. * probe.h: Likewise. * s390-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (s390_stap_is_single_operand): New function. (s390_gdbarch_init): Initializing proper fields used by SystemTap probes' arguments parser. * somread.c (som_sym_fns): Add `sym_probe_fns' value. * stap-probe.c: New file, for SystemTap probe support. * stap-probe.h: Likewise. * symfile.h: Include `gdb_vecs.h'. (struct sym_probe_fns): New struct. (struct sym_fns) <sym_probe_fns>: New field. * symtab.c (init_sal): Initialize `probe' field. * symtab.h (struct probe): Forward declaration. (struct symtab_and_line) <probe>: New field. * tracepoint.c (start_tracing): Adjust semaphore on breakpoints locations. (stop_tracing): Likewise. * xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
2012-04-27 22:47:57 +02:00
set_gdbarch_stap_is_single_operand (gdbarch,
i386_stap_is_single_operand);
set_gdbarch_stap_parse_special_token (gdbarch,
i386_stap_parse_special_token);
set_gdbarch_insn_is_call (gdbarch, amd64_insn_is_call);
set_gdbarch_insn_is_ret (gdbarch, amd64_insn_is_ret);
set_gdbarch_insn_is_jump (gdbarch, amd64_insn_is_jump);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
static struct type *
amd64_x32_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
switch (regnum - tdep->eax_regnum)
{
case AMD64_RBP_REGNUM: /* %ebp */
case AMD64_RSP_REGNUM: /* %esp */
return builtin_type (gdbarch)->builtin_data_ptr;
case AMD64_RIP_REGNUM: /* %eip */
return builtin_type (gdbarch)->builtin_func_ptr;
}
return i386_pseudo_register_type (gdbarch, regnum);
}
void
amd64_x32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
const struct target_desc *tdesc = info.target_desc;
amd64_init_abi (info, gdbarch);
if (! tdesc_has_registers (tdesc))
tdesc = tdesc_x32;
tdep->tdesc = tdesc;
tdep->num_dword_regs = 17;
set_tdesc_pseudo_register_type (gdbarch, amd64_x32_pseudo_register_type);
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
}
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
Add support for the x86 XSAVE extended state on FreeBSD/x86. Recognize NT_X86_XSTATE notes in FreeBSD process cores. Recent FreeBSD versions include a note containing the XSAVE state for each thread in the process when XSAVE is in use. The note stores a copy of the current XSAVE mask in a reserved section of the machine-defined XSAVE state at the same offset as Linux's NT_X86_XSTATE note. For native processes, use the PT_GETXSTATE_INFO ptrace request to determine if XSAVE is enabled, and if so the active XSAVE state mask (that is, the value of %xcr0 for the target process) as well as the size of XSAVE state area. Use the PT_GETXSTATE and PT_SETXSTATE requests to fetch and store the XSAVE state, respectively, in the BSD x86 native targets. In addition, the FreeBSD amd64 and i386 native targets now include "read_description" target methods to determine the correct x86 target description for the current XSAVE mask. On FreeBSD amd64 this also properly returns an i386 target description for 32-bit binaries which allows the 64-bit GDB to run 32-bit binaries. Note that the ptrace changes are in the BSD native targets, not the FreeBSD-specific native targets since that is where the other ptrace register accesses occur. Of the other BSDs, NetBSD and DragonFly use XSAVE in the kernel but do not currently export the extended state via ptrace(2). OpenBSD does not currently support XSAVE. bfd/ChangeLog: * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on FreeBSD. (elfcore_write_xstatereg): Use correct note name on FreeBSD. gdb/ChangeLog: * amd64-tdep.c (amd64_target_description): New function. * amd64-tdep.h: Export amd64_target_description and tdesc_amd64. * amd64bsd-nat.c [PT_GETXSTATE_INFO]: New variable amd64bsd_xsave_len. (amd64bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (amd64bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * amd64bsd-nat.h: Export amd64bsd_xsave_len. * amd64fbsd-nat.c (amd64fbsd_read_description): New function. (_initialize_amd64fbsd_nat): Set "to_read_description" to "amd64fbsd_read_description". * amd64fbsd-tdep.c (amd64fbsd_core_read_description): New function. (amd64fbsd_supply_xstateregset): New function. (amd64fbsd_collect_xstateregset): New function. Add "amd64fbsd_xstateregset". (amd64fbsd_iterate_over_regset_sections): New function. (amd64fbsd_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386-tdep.c (i386_target_description): New function. * i386-tdep.h: Export i386_target_description and tdesc_i386. * i386bsd-nat.c [PT_GETXSTATE_INFO]: New variable i386bsd_xsave_len. (i386bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (i386bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * i386bsd-nat.h: Export i386bsd_xsave_len. * i386fbsd-nat.c (i386fbsd_read_description): New function. (_initialize_i386fbsd_nat): Set "to_read_description" to "i386fbsd_read_description". * i386fbsd-tdep.c (i386fbsd_core_read_xcr0): New function. (i386fbsd_core_read_description): New function. (i386fbsd_supply_xstateregset): New function. (i386fbsd_collect_xstateregset): New function. Add "i386fbsd_xstateregset". (i386fbsd_iterate_over_regset_sections): New function. (i386fbsd4_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386fbsd-tdep.h: New file.
2015-02-21 22:43:30 +01:00
/* Return the target description for a specified XSAVE feature mask. */
const struct target_desc *
amd64_target_description (uint64_t xcr0)
{
switch (xcr0 & X86_XSTATE_ALL_MASK)
{
case X86_XSTATE_MPX_AVX512_MASK:
case X86_XSTATE_AVX512_MASK:
return tdesc_amd64_avx512;
case X86_XSTATE_MPX_MASK:
return tdesc_amd64_mpx;
Add target descriptions for AVX + MPX The current MPX target descriptions assume that MPX is always combined with AVX, however that's not correct. We can have machines with MPX and without AVX; or machines with AVX and without MPX. This patch adds new target descriptions for machines that support both MPX and AVX, as duplicates of the existing MPX descriptions. The following commit will remove AVX from the MPX-only descriptions. 2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c): New include. (amd64_linux_core_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux. * amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition. * amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include. (amd64_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx. * common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits. (X86_XSTATE_AVX_MPX_MASK): New case. * features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux) (i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules. (i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite) (i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite): New expedites. * i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New include. (i386_linux_core_read_description): Add case X86_XSTATE_AVX_MPX_MASK. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_avx_mpx_linux. * i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include. * i386-tdep.c (features/i386/i386-avx-mpx.c): New include. (i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. * x86-linux-nat.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. * features/i386/amd64-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx-linux.c: Generated. * features/i386/amd64-avx-mpx.c: Generated. * features/i386/i386-avx-mpx-linux.c: Generated. * features/i386/i386-avx-mpx.c: Generated. * regformats/i386/amd64-avx-mpx-linux.dat: Generated. * regformats/i386/amd64-avx-mpx.dat: Generated. * regformats/i386/i386-avx-mpx-linux.dat: Generated. * regformats/i386/i386-avx-mpx.dat: Generated. gdb/gdbserver/ChangeLog: * Makefile.in (clean): Add removal for i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c. (i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c) (amd64-avx-mpx-linux.c): New rules. (amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule. * configure.srv (srv_i386_regobj): Add i386-avx-mpx.o. (srv_i386_linux_regobj): Add i386-avx-mpx-linux.o. (srv_amd64_regobj): Add amd64-avx-mpx.o. (srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o. (srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml. (ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o. * linux-x86-low.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (x86_get_ipa_tdesc_idx): Add cases for avx_mpx. (initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and init_registers_i386_avx_mpx_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_i386_avx_mpx_linux. * linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_amd64_avx_mpx_linux. * linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value. (init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux) (init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New declarations.
2016-04-19 15:44:32 +02:00
case X86_XSTATE_AVX_MPX_MASK:
return tdesc_amd64_avx_mpx;
Add support for the x86 XSAVE extended state on FreeBSD/x86. Recognize NT_X86_XSTATE notes in FreeBSD process cores. Recent FreeBSD versions include a note containing the XSAVE state for each thread in the process when XSAVE is in use. The note stores a copy of the current XSAVE mask in a reserved section of the machine-defined XSAVE state at the same offset as Linux's NT_X86_XSTATE note. For native processes, use the PT_GETXSTATE_INFO ptrace request to determine if XSAVE is enabled, and if so the active XSAVE state mask (that is, the value of %xcr0 for the target process) as well as the size of XSAVE state area. Use the PT_GETXSTATE and PT_SETXSTATE requests to fetch and store the XSAVE state, respectively, in the BSD x86 native targets. In addition, the FreeBSD amd64 and i386 native targets now include "read_description" target methods to determine the correct x86 target description for the current XSAVE mask. On FreeBSD amd64 this also properly returns an i386 target description for 32-bit binaries which allows the 64-bit GDB to run 32-bit binaries. Note that the ptrace changes are in the BSD native targets, not the FreeBSD-specific native targets since that is where the other ptrace register accesses occur. Of the other BSDs, NetBSD and DragonFly use XSAVE in the kernel but do not currently export the extended state via ptrace(2). OpenBSD does not currently support XSAVE. bfd/ChangeLog: * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on FreeBSD. (elfcore_write_xstatereg): Use correct note name on FreeBSD. gdb/ChangeLog: * amd64-tdep.c (amd64_target_description): New function. * amd64-tdep.h: Export amd64_target_description and tdesc_amd64. * amd64bsd-nat.c [PT_GETXSTATE_INFO]: New variable amd64bsd_xsave_len. (amd64bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (amd64bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * amd64bsd-nat.h: Export amd64bsd_xsave_len. * amd64fbsd-nat.c (amd64fbsd_read_description): New function. (_initialize_amd64fbsd_nat): Set "to_read_description" to "amd64fbsd_read_description". * amd64fbsd-tdep.c (amd64fbsd_core_read_description): New function. (amd64fbsd_supply_xstateregset): New function. (amd64fbsd_collect_xstateregset): New function. Add "amd64fbsd_xstateregset". (amd64fbsd_iterate_over_regset_sections): New function. (amd64fbsd_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386-tdep.c (i386_target_description): New function. * i386-tdep.h: Export i386_target_description and tdesc_i386. * i386bsd-nat.c [PT_GETXSTATE_INFO]: New variable i386bsd_xsave_len. (i386bsd_fetch_inferior_registers) [PT_GETXSTATE_INFO]: Handle x86 extended save area. (i386bsd_store_inferior_registers) [PT_GETXSTATE_INFO]: Likewise. * i386bsd-nat.h: Export i386bsd_xsave_len. * i386fbsd-nat.c (i386fbsd_read_description): New function. (_initialize_i386fbsd_nat): Set "to_read_description" to "i386fbsd_read_description". * i386fbsd-tdep.c (i386fbsd_core_read_xcr0): New function. (i386fbsd_core_read_description): New function. (i386fbsd_supply_xstateregset): New function. (i386fbsd_collect_xstateregset): New function. Add "i386fbsd_xstateregset". (i386fbsd_iterate_over_regset_sections): New function. (i386fbsd4_init_abi): Set "xsave_xcr0_offset" to "I386_FBSD_XSAVE_XCR0_OFFSET". Add "iterate_over_regset_sections" gdbarch method. Add "core_read_description" gdbarch method. * i386fbsd-tdep.h: New file.
2015-02-21 22:43:30 +01:00
case X86_XSTATE_AVX_MASK:
return tdesc_amd64_avx;
default:
return tdesc_amd64;
}
}
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_amd64_tdep (void);
void
_initialize_amd64_tdep (void)
{
initialize_tdesc_amd64 ();
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
initialize_tdesc_amd64_avx ();
initialize_tdesc_amd64_mpx ();
Add target descriptions for AVX + MPX The current MPX target descriptions assume that MPX is always combined with AVX, however that's not correct. We can have machines with MPX and without AVX; or machines with AVX and without MPX. This patch adds new target descriptions for machines that support both MPX and AVX, as duplicates of the existing MPX descriptions. The following commit will remove AVX from the MPX-only descriptions. 2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c): New include. (amd64_linux_core_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux. * amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition. * amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include. (amd64_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx. * common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits. (X86_XSTATE_AVX_MPX_MASK): New case. * features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux) (i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules. (i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite) (i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite): New expedites. * i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New include. (i386_linux_core_read_description): Add case X86_XSTATE_AVX_MPX_MASK. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_avx_mpx_linux. * i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include. * i386-tdep.c (features/i386/i386-avx-mpx.c): New include. (i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. * x86-linux-nat.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. * features/i386/amd64-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx-linux.c: Generated. * features/i386/amd64-avx-mpx.c: Generated. * features/i386/i386-avx-mpx-linux.c: Generated. * features/i386/i386-avx-mpx.c: Generated. * regformats/i386/amd64-avx-mpx-linux.dat: Generated. * regformats/i386/amd64-avx-mpx.dat: Generated. * regformats/i386/i386-avx-mpx-linux.dat: Generated. * regformats/i386/i386-avx-mpx.dat: Generated. gdb/gdbserver/ChangeLog: * Makefile.in (clean): Add removal for i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c. (i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c) (amd64-avx-mpx-linux.c): New rules. (amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule. * configure.srv (srv_i386_regobj): Add i386-avx-mpx.o. (srv_i386_linux_regobj): Add i386-avx-mpx-linux.o. (srv_amd64_regobj): Add amd64-avx-mpx.o. (srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o. (srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml. (ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o. * linux-x86-low.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (x86_get_ipa_tdesc_idx): Add cases for avx_mpx. (initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and init_registers_i386_avx_mpx_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_i386_avx_mpx_linux. * linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_amd64_avx_mpx_linux. * linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value. (init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux) (init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New declarations.
2016-04-19 15:44:32 +02:00
initialize_tdesc_amd64_avx_mpx ();
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
initialize_tdesc_amd64_avx512 ();
initialize_tdesc_x32 ();
initialize_tdesc_x32_avx ();
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
initialize_tdesc_x32_avx512 ();
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* The 64-bit FXSAVE format differs from the 32-bit format in the
sense that the instruction pointer and data pointer are simply
64-bit offsets into the code segment and the data segment instead
of a selector offset pair. The functions below store the upper 32
bits of these pointers (instead of just the 16-bits of the segment
selector). */
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. If REGNUM is
-1, do this for all registers. This function masks off any of the
reserved bits in *FXSAVE. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
void
* x86-64-tdep.h: Tewak comment. (enum amd64_regnum): New. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM) (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM) (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM) (X86_64_XMM1_REGNUM): Removed. (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS. (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust prototypes for renamed functions. * x86-64-tdep.c: Fix typo. (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for register numbers. (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call): Use constants from `enum amd64_regnum' for register numbers. (AMD64_NUM_SAVED_REGS): Adjust for renamed macros. (amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache): Use constants from `enum amd64_regnum' for register numbers. (amd64_supply_fpregset): Adjust for renamed functions. (amd64_init_abi): Rename from x86_64_init_abi. Use constants from `enum amd64_regnum' for register numbers. (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'. (amd64_supply_fxsave): Rename from x86_64_supply_fxsave. (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave. * x86-64-linux-tdep.c (amd64_linux_supply_gregset) (amd64_linux_fill_gregset): Adjust for renamed macros. (fetch_core_registers): Adjust for renamed functions. (amd64_linux_init_abi): Adjust for renamed functions. * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for renamed functions. * amd64-nat.c: Adjust for renamed macros. * amd64bsd-nat.c (fetch_inferior_registers) (store_inferior_registers): Use constants from `enum amd64_regnum' for register numbers. Adjust for renamed variables. * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for renamed variables. (_initialize_amd64fbsd_nat): Use constants from `enum amd64_regnum' for register numbers. * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64fbsd_init_abi): Adjust for renamed functions. * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64nbsd_init_abi): Adjust for renamed functions. (_initialize_amd64nbsd_ndep): Adjust for renamed macros. * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from `enum amd64_regnum' for register numbers. (amd64obsd_init_abi): Adjust for renamed functions. (_initialize_amd64obsd_ndep): Adjust for renamed macros.
2004-02-23 22:37:52 +01:00
amd64_supply_fxsave (struct regcache *regcache, int regnum,
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch to get at the current architecture and at the target specific vector. Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and remove define of I387_ST0_REGNUM. * amd64-tdep.c (I387_ST0_REGNUM): Remove define. (amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to get at the current architecture (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as parameter. * i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM, I387_NUM_XMM_REGS and I387_MM0_REGNUM. (I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM, I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM, (I387_FSTAT_REGNUM): Add target specific vector as parameter. (i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get at the target specific vector. (i386_get_longjmp_target): Use get_frame_arch to get at the current architecture. Use gdbarch_tdep to get at the target specific vector. (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and update caller. Use gdbarch_tdep to get at the target specific vector. (i386_register_to_value: Use get_frame_arch to get at the current architecture. * i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter. * i387-tdep.c (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_ST0_REGNUM, FSAVE_ADDR, FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter. (I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and undef's. (i387_convert_register_p, i387_register_to_value, i387_value_to_register): Update call for i386_fp_regnum_p. * i387-tdep.h: Remove comment. (I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define. (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): Add target specific vector as parameter.
2008-03-11 06:21:38 +01:00
const void *fxsave)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch to get at the current architecture and at the target specific vector. Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and remove define of I387_ST0_REGNUM. * amd64-tdep.c (I387_ST0_REGNUM): Remove define. (amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to get at the current architecture (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as parameter. * i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM, I387_NUM_XMM_REGS and I387_MM0_REGNUM. (I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM, I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM, (I387_FSTAT_REGNUM): Add target specific vector as parameter. (i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get at the target specific vector. (i386_get_longjmp_target): Use get_frame_arch to get at the current architecture. Use gdbarch_tdep to get at the target specific vector. (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and update caller. Use gdbarch_tdep to get at the target specific vector. (i386_register_to_value: Use get_frame_arch to get at the current architecture. * i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter. * i387-tdep.c (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_ST0_REGNUM, FSAVE_ADDR, FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter. (I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and undef's. (i387_convert_register_p, i387_register_to_value, i387_value_to_register): Update call for i386_fp_regnum_p. * i387-tdep.h: Remove comment. (I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define. (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): Add target specific vector as parameter.
2008-03-11 06:21:38 +01:00
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
i387_supply_fxsave (regcache, regnum, fxsave);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
if (fxsave
&& gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
const gdb_byte *regs = (const gdb_byte *) fxsave;
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch to get at the current architecture and at the target specific vector. Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and remove define of I387_ST0_REGNUM. * amd64-tdep.c (I387_ST0_REGNUM): Remove define. (amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to get at the current architecture (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as parameter. * i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM, I387_NUM_XMM_REGS and I387_MM0_REGNUM. (I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM, I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM, (I387_FSTAT_REGNUM): Add target specific vector as parameter. (i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get at the target specific vector. (i386_get_longjmp_target): Use get_frame_arch to get at the current architecture. Use gdbarch_tdep to get at the target specific vector. (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and update caller. Use gdbarch_tdep to get at the target specific vector. (i386_register_to_value: Use get_frame_arch to get at the current architecture. * i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter. * i387-tdep.c (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_ST0_REGNUM, FSAVE_ADDR, FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter. (I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and undef's. (i387_convert_register_p, i387_register_to_value, i387_value_to_register): Update call for i386_fp_regnum_p. * i387-tdep.h: Remove comment. (I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define. (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): Add target specific vector as parameter.
2008-03-11 06:21:38 +01:00
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
regcache_raw_supply (regcache, I387_FISEG_REGNUM (tdep), regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
regcache_raw_supply (regcache, I387_FOSEG_REGNUM (tdep), regs + 20);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
}
}
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
/* Similar to amd64_supply_fxsave, but use XSAVE extended state. */
void
amd64_supply_xsave (struct regcache *regcache, int regnum,
const void *xsave)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
i387_supply_xsave (regcache, regnum, xsave);
if (xsave
&& gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
{
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
const gdb_byte *regs = (const gdb_byte *) xsave;
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
regcache_raw_supply (regcache, I387_FISEG_REGNUM (tdep),
regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
regcache_raw_supply (regcache, I387_FOSEG_REGNUM (tdep),
regs + 20);
}
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
*FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
all registers. This function doesn't touch any of the reserved
bits in *FXSAVE. */
void
amd64_collect_fxsave (const struct regcache *regcache, int regnum,
void *fxsave)
{
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch to get at the current architecture and at the target specific vector. Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and remove define of I387_ST0_REGNUM. * amd64-tdep.c (I387_ST0_REGNUM): Remove define. (amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to get at the current architecture (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as parameter. * i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM, I387_NUM_XMM_REGS and I387_MM0_REGNUM. (I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM, I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM, (I387_FSTAT_REGNUM): Add target specific vector as parameter. (i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get at the target specific vector. (i386_get_longjmp_target): Use get_frame_arch to get at the current architecture. Use gdbarch_tdep to get at the target specific vector. (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and update caller. Use gdbarch_tdep to get at the target specific vector. (i386_register_to_value: Use get_frame_arch to get at the current architecture. * i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter. * i387-tdep.c (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_ST0_REGNUM, FSAVE_ADDR, FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter. (I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and undef's. (i387_convert_register_p, i387_register_to_value, i387_value_to_register): Update call for i386_fp_regnum_p. * i387-tdep.h: Remove comment. (I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define. (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): Add target specific vector as parameter.
2008-03-11 06:21:38 +01:00
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
gdb_byte *regs = (gdb_byte *) fxsave;
i387_collect_fxsave (regcache, regnum, fxsave);
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
{
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch to get at the current architecture and at the target specific vector. Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and remove define of I387_ST0_REGNUM. * amd64-tdep.c (I387_ST0_REGNUM): Remove define. (amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to get at the current architecture (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as parameter. * i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM, I387_NUM_XMM_REGS and I387_MM0_REGNUM. (I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM, I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM, (I387_FSTAT_REGNUM): Add target specific vector as parameter. (i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get at the target specific vector. (i386_get_longjmp_target): Use get_frame_arch to get at the current architecture. Use gdbarch_tdep to get at the target specific vector. (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and update caller. Use gdbarch_tdep to get at the target specific vector. (i386_register_to_value: Use get_frame_arch to get at the current architecture. * i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter. * i387-tdep.c (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_ST0_REGNUM, FSAVE_ADDR, FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter. (I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and undef's. (i387_convert_register_p, i387_register_to_value, i387_value_to_register): Update call for i386_fp_regnum_p. * i387-tdep.h: Remove comment. (I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define. (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): Add target specific vector as parameter.
2008-03-11 06:21:38 +01:00
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep), regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
regcache_raw_collect (regcache, I387_FOSEG_REGNUM (tdep), regs + 20);
}
}
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
gdb * windows-tdep.c (windows_xfer_shared_library): * windows-nat.c (get_module_name, windows_make_so): * v850-tdep.c (v850_handle_pushm): * utils.c (null_cleanup, gdb_realpath): * ui-out.c (get_next_header): * tracepoint.c (clear_traceframe_info): * symtab.c (lookup_symtab): * serial.h (struct serial_ops): * mipsread.c (read_alphacoff_dynamic_symtab): * infcmd.c (print_return_value): * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): * f-exp.y (parse_number): * exceptions.c (catch_exceptions): * dummy-frame.c (dummy_frame_this_id): * defs.h (struct cleanup): * breakpoint.c (disable_breakpoints_in_unloaded_shlib): * arm-tdep.c (arm_push_dummy_call): * amd64-tdep.h (amd64_collect_xsave): * amd64-tdep.c (amd64_collect_xsave): * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): * README (typing): Remove duplicate words. * cli/cli-decode.c (lookup_cmd_composition): Add comma. * infrun.c (siginfo_value_read): Fix typo. * solib-frv.c (frv_fdpic_find_global_pointer): Likewise. * top.c (source_line_number): Add comma. gdb/doc * gdbint.texinfo (Register Information Functions): Remove duplicate "the". * gdb.texinfo (Emacs): Remove duplicate "to". (GDB/MI Variable Objects): Remove duplicate "the". (General Query Packets): Likewise. gdb/testsuite * gdb.mi/mi-nsmoribund.exp: * gdb.hp/gdb.objdbg/objdbg01.exp: * gdb.base/structs.exp (test_struct_returns): * gdb.base/call-sc.exp (test_scalar_returns): * gdb.base/bigcore.exp: Remove duplicate words. gdb/gdbserver * win32-low.c (handle_load_dll): Remove duplicate "the".
2011-04-19 20:04:11 +02:00
/* Similar to amd64_collect_fxsave, but use XSAVE extended state. */
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
void
amd64_collect_xsave (const struct regcache *regcache, int regnum,
void *xsave, int gcore)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
gdb_byte *regs = (gdb_byte *) xsave;
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
i387_collect_xsave (regcache, regnum, xsave, gcore);
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
{
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep),
regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
regcache_raw_collect (regcache, I387_FOSEG_REGNUM (tdep),
regs + 20);
}
}