binutils-gdb/gdb/rs6000-nat.c

675 lines
18 KiB
C
Raw Normal View History

/* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
Copyright (C) 1986-2018 Free Software Foundation, Inc.
1999-07-07 22:19:36 +02:00
This file is part of GDB.
1999-07-07 22:19:36 +02:00
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
1999-07-07 22:19:36 +02:00
(at your option) any later version.
1999-07-07 22:19:36 +02:00
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.
1999-07-07 22:19:36 +02:00
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 "inferior.h"
#include "target.h"
#include "gdbcore.h"
#include "symfile.h"
#include "objfiles.h"
#include "bfd.h"
#include "gdb-stabs.h"
#include "regcache.h"
#include "arch-utils.h"
#include "inf-child.h"
#include "inf-ptrace.h"
#include "ppc-tdep.h"
* config/powerpc/linux.mt (DEPRECATED_TM_FILE): Set to tm-ppc-eabi.h. * config/powerpc/tm-linux.h: Delete file. * config/powerpc/tm-ppc-eabi.h: Do not include "rs6000/tm-rs6000.h". (PROCESS_LINENUMBER_HOOK): Do not undefine. (TEXT_SEGMENT_BASE): Do not redefine. * config/rs6000/nm-rs6000.h (CHILD_SPECIAL_WAITSTATUS): Move here from config/rs6000/tm-rs6000.h. (TARGET_CREATE_INFERIOR_HOOK, rs6000_create_inferior): Likewise. * config/rs6000/tm-rs6000.h (struct frame_info): Remove declaration. (TEXT_SEGMENT_BASE): Remove. (IN_SOLIB_RETURN_TRAMPOLINE): Remove. (rs6000_in_solib_return_trampoline): Remove. (SKIP_TRAMPOLINE_CODE): Remove. (rs6000_skip_trampoline_code): Remove. (CHILD_SPECIAL_WAITSTATUS): Move to config/rs6000/nm-rs6000.h. (TARGET_CREATE_INFERIOR_HOOK, rs6000_create_inferior): Likewise. (FP0_REGNUM): Remove. (rs6000_find_toc_address_hook): Move to rs6000-tdep.h. (rs6000_set_host_arch_hook): Remove. * Makefile.in (rs6000-nat.o): Add dependency on $(rs6000_tdep_h). (rs6000-aix-tdep.o): Add dependency on $(ppc_tdep_h). * ppc-tdep.h (struct gdbarch_tdep): Add field text_segment_base. * rs6000-aix-tdep.c: Include "ppc-tdep.h". (rs6000_aix_init_osabi): Set text_segment_base tdep field. * rs6000-nat.c: Include "rs6000-tdep.h". (exec_one_dummy_insn): Replace TEXT_SEGMENT_BASE by tdep field. (set_host_arch): Rename to ... (rs6000_create_inferior): ... this. Make public. (_initialize_core_rs6000): Do not set rs6000_set_host_arch_hook. * rs6000-tdep.c (rs6000_set_host_arch_hook): Remove. (rs6000_create_inferior): Remove. (branch_dest): Replace TEXT_SEGMENT_BASE by tdep field. (rs6000_gdbarch_init): Call set_gdbarch_fp0_regnum, set_gdbarch_in_solib_return_trampoline, and set_gdbarch_skip_trampoline_code. * rs6000-tdep.h (rs6000_find_toc_address_hook): Move here from config/rs6000/tm-rs6000.h.
2007-02-28 00:04:28 +01:00
#include "rs6000-tdep.h"
ppc-aix core file relocation. The current code attempts to provide relocation support when debugging core files via the rs6000_xfer_partial method of the rs6000-nat target_ops vector. However, this target_ops vector does not get pushed on the target stack at all when debugging core files, thus bypassing completely that part of the code. This patch fixes the problem by extending corelow's core_xfer_partial into handling the TARGET_OBJECT_LIBRARIES_AIX object. gdb/ChangeLog: * gdbarch.sh (core_xfer_shared_libraries_aix): New method. * gdbarch.h, gdbarch.c: Regenerate. * corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX handling. * rs6000-aix-tdep.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h. * rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and "xml-utils.h". (struct field_info, struct ld_info_desc): New types. (ld_info32_desc, ld_info64_desc): New static constants. (struct ld_info): New type. (rs6000_aix_extract_ld_info): New function. (rs6000_aix_shared_library_to_xml): Likewise. (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. (rs6000_aix_init_osabi): Add call to set_gdbarch_core_xfer_shared_libraries_aix. * rs6000-nat.c: Add "rs6000-aix-tdep.h" include. Remove "xml-utils.h" include. (LdInfo): Delete typedef. (ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME): Delete macros. (rs6000_ptrace_ldinfo): Change return type to gdb_byte *. Adjust code accordingly. (rs6000_core_ldinfo): Delete, folded into rs6000_aix_core_xfer_shared_libraries_aix. (rs6000_xfer_shared_library): Delete. (rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 14:26:14 +02:00
#include "rs6000-aix-tdep.h"
#include "exec.h"
Convert observers to C++ This converts observers from using a special source-generating script to be plain C++. This version of the patch takes advantage of C++11 by using std::function and variadic templates; incorporates Pedro's patches; and renames the header file to "observable.h" (this change eliminates the need for a clean rebuild). Note that Pedro's patches used a template lambda in tui-hooks.c, but this failed to compile on some buildbot instances (presumably due to differing C++ versions); I replaced this with an ordinary template function. Regression tested on the buildbot. gdb/ChangeLog 2018-03-19 Pedro Alves <palves@redhat.com> Tom Tromey <tom@tromey.com> * unittests/observable-selftests.c: New file. * common/observable.h: New file. * observable.h: New file. * ada-lang.c, ada-tasks.c, agent.c, aix-thread.c, annotate.c, arm-tdep.c, auto-load.c, auxv.c, break-catch-syscall.c, breakpoint.c, bsd-uthread.c, cli/cli-interp.c, cli/cli-setshow.c, corefile.c, dummy-frame.c, event-loop.c, event-top.c, exec.c, extension.c, frame.c, gdbarch.c, guile/scm-breakpoint.c, infcall.c, infcmd.c, inferior.c, inflow.c, infrun.c, jit.c, linux-tdep.c, linux-thread-db.c, m68klinux-tdep.c, mi/mi-cmd-break.c, mi/mi-interp.c, mi/mi-main.c, objfiles.c, ppc-linux-nat.c, ppc-linux-tdep.c, printcmd.c, procfs.c, python/py-breakpoint.c, python/py-finishbreakpoint.c, python/py-inferior.c, python/py-unwind.c, ravenscar-thread.c, record-btrace.c, record-full.c, record.c, regcache.c, remote.c, riscv-tdep.c, sol-thread.c, solib-aix.c, solib-spu.c, solib.c, spu-multiarch.c, spu-tdep.c, stack.c, symfile-mem.c, symfile.c, symtab.c, thread.c, top.c, tracepoint.c, tui/tui-hooks.c, tui/tui-interp.c, valops.c: Update all users. * tui/tui-hooks.c (tui_bp_created_observer) (tui_bp_deleted_observer, tui_bp_modified_observer) (tui_inferior_exit_observer, tui_before_prompt_observer) (tui_normal_stop_observer, tui_register_changed_observer): Remove. (tui_observers_token): New global. (attach_or_detach, tui_attach_detach_observers): New functions. (tui_install_hooks, tui_remove_hooks): Use tui_attach_detach_observers. * record-btrace.c (record_btrace_thread_observer): Remove. (record_btrace_thread_observer_token): New global. * observer.sh: Remove. * observer.c: Rename to observable.c. * observable.c (namespace gdb_observers): Define new objects. (observer_debug): Move into gdb_observers namespace. (struct observer, struct observer_list, xalloc_observer_list_node) (xfree_observer_list_node, generic_observer_attach) (generic_observer_detach, generic_observer_notify): Remove. (_initialize_observer): Update. Don't include observer.inc. * Makefile.in (generated_files): Remove observer.h, observer.inc. (clean mostlyclean): Likewise. (observer.h, observer.inc): Remove targets. (SUBDIR_UNITTESTS_SRCS): Add observable-selftests.c. (COMMON_SFILES): Use observable.c, not observer.c. * .gitignore: Remove observer.h. gdb/doc/ChangeLog 2018-03-19 Tom Tromey <tom@tromey.com> * observer.texi: Remove. gdb/testsuite/ChangeLog 2018-03-19 Tom Tromey <tom@tromey.com> * gdb.gdb/observer.exp: Remove.
2016-10-02 18:50:20 +02:00
#include "observable.h"
Silence a few -Wmissing-prototypes warnings. PR build/9877: * alpha-linux-tdep.c (alpha_linux_regset_from_core_section): Make it static. * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Declare. * amd64fbsd-tdep.c (amd64fbsd_init_abi): Make it static. * amd64nbsd-tdep.c (_initialize_amd64nbsd_ndep): Rename to ... (_initialize_amd64nbsd_tdep): ... this. * arm-linux-tdep.c (arm_linux_software_single_step): Make it static. (_initialize_arm_linux_tdep): Declare. * armbsd-tdep.c (armbsd_fpreg_offset): Make it static. * armnbsd-tdep.c (_initialize_arm_netbsd_tdep): Declare. * armobsd-tdep.c (_initialize_armobsd_tdep): Declare. * avr-tdep.c (avr_return_value): Make it static. (avr_frame_unwind_cache): Ditto. * bsd-uthread.c (bsd_uthread_inferior_created): Ditto. (bsd_uthread_solib_loaded): Ditto. (bsd_uthread_solib_unloaded): Ditto. (bsd_uthread_target): Ditto. (_initialize_bsd_uthread): Declare. * cris-tdep.c (crisv32_single_step_through_delay): Make it static. (cris_frame_unwind_cache): Ditto. * frv-tdep.c (frv_return_value): Ditto. * h8300-tdep.c (h8300_use_struct_convention): Ditto. (h8300h_use_struct_convention): Ditto. * hppa-tdep.c (hppa_sign_extend, hppa_low_hppa_sign_extend): Ditto. * hppa-tdep.h (hppa_low_sign_extend, hppa_sign_extend): Delete declarations. * hppabsd-tdep.c: Include hppabsd-tdep.h. (hppabsd_find_global_pointer): Make it static. * hppabsd-tdep.h: New. * hppanbsd-tdep.c: Include hppabsd-tdep.h. (hppabsd_init_abi): Remove declaration. (_initialize_hppabsd_tdep): Remove declaration. (_initialize_hppanbsd_tdep): Declare. * hppaobsd-tdep.c: Include hppabsd-tdep.h. (hppabsd_init_abi): Delete declaration. (hppaobsd_init_abi): Make it static. * i386-nto-tdep.c (_initialize_i386nto_tdep): Declare. * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Declare. * ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Declare. * ia64-tdep.c (ia64_register_reggroup_p): Make it static. * iq2000-tdep.c (_initialize_iq2000_tdep): Declare. * m32c-tdep.c (m32c_register_reggroup_p): Make it static. (m32c_analyze_prologue, m32c_virtual_frame_pointer): Ditto. (_initialize_m32c_tdep): Declare. * m32r-rom.c (_initialize_m32r_rom): Declare. * m32r-tdep.c (m32r_skip_prologue): Make it static. (m32r_return_value): Ditto. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Make it static. (m68hc11_return_value): Ditto. * m68klinux-tdep.c (_initialize_m68k_linux_tdep): Declare. * m88k-tdep.c (m88k_frame_cache): Make it static. * mep-tdep.c (mep_gdb_print_insn): Ditto. (mep_return_value): Ditto. (_initialize_mep_tdep): Declare. * mips-irix-tdep.c (_initialize_mips_irix_tdep): Declare. * mips-linux-tdep.c (supply_64bit_reg): Make it static. (mips_linux_syscall_next_pc): Ditto. (_initialize_mips_linux_tdep): Declare. * mips-tdep.c (mips_single_step_through_delay): Make it static. * mipsnbsd-tdep.c (_initialize_mipsnbsd_tdep): Declare. * mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Declare. * mn10300-tdep.c (_initialize_mn10300_tdep): Declare. * mt-tdep.c (_initialize_mt_tdep): Declare. * nbsd-tdep.c: Include nbsd-tdep.h. * nto-tdep.c (find_load_phdr): Make it static. (_initialize_nto_tdep): Declare. * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Make it static. (_initialize_ppc_linux_tdep): Declare. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint) (m32r_insert_watchpoint, m32r_remove_watchpoint) (m32r_stopped_data_address, m32r_stopped_by_watchpoint): Make static. * rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Declare. * rs6000-nat.c: Include xcoffread.h. (find_toc_address): Don't extern declare get_toc_offset. Adjust to call xcoff_get_to_offset. * rs6000-tdep.c (ppc_vsx_support_p, ppc_displaced_step_fixup) (rs6000_skip_main_prologue, rs6000_in_solib_return_trampoline) (rs6000_skip_trampoline_code): Make static. * s390-tdep.c (s390_regset_from_core_section): Ditto. * sh-tdep.c (sh_register_reggroup_p): Ditto. * shnbsd-tdep.c (shnbsd_regset_from_core_section): Ditto. (_initialize_shnbsd_tdep): Declare. * solib-frv.c (displacement_from_map): Make static. (_initialize_frv_solib): Declare. * solib-irix.c (fetch_lm_info): Make static. (_initialize_irix_solib): Declare. * solib-som.c: Include solib-som.h. (som_solib_select): Line break. * sparc-tdep.c (sparc_regset_from_core_section): Make static. * sparcnbsd-tdep.c (_initialize_sparnbsd_tdep): Rename to ... (_initialize_sparcnbsd_tdep): ... this. * spu-tdep.c (spu_software_single_step): Make it static. (_initialize_spu_tdep): Declare. * vax-tdep.c (vax_frame_cache): Make it static. * xcoffread.c: Include xcoffread.h. (get_toc_offset): Rename to ... (xcoff_get_toc_offset): ... this. (_initialize_xcoffread): Declare. * xcoffread.h: New. * xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Declare. * xtensa-tdep.c (xtensa_skip_prologue, xtensa_derive_tdep): Make static. (_initialize_xtensa_tdep): Declare.
2009-02-22 02:02:20 +01:00
#include "xcoffread.h"
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sys/dir.h>
#include <sys/user.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <a.out.h>
#include <sys/file.h>
remove gdb_stat.h This patch is purely mechanical. It removes gdb_stat.h and changes the code to use sys/stat.h. 2013-11-18 Tom Tromey <tromey@redhat.com> * common/gdb_stat.h: Remove. * ada-lang.c: Use sys/stat.h, not gdb_stat.h. * common/filestuff.c: Use sys/stat.h, not gdb_stat.h. * common/linux-osdata.c: Use sys/stat.h, not gdb_stat.h. * corefile.c: Use sys/stat.h, not gdb_stat.h. * ctf.c: Use sys/stat.h, not gdb_stat.h. * darwin-nat.c: Use sys/stat.h, not gdb_stat.h. * dbxread.c: Use sys/stat.h, not gdb_stat.h. * dwarf2read.c: Use sys/stat.h, not gdb_stat.h. * exec.c: Use sys/stat.h, not gdb_stat.h. * gdbserver/linux-low.c: Use sys/stat.h, not gdb_stat.h. * gdbserver/remote-utils.c: Use sys/stat.h, not gdb_stat.h. * inf-child.c: Use sys/stat.h, not gdb_stat.h. * jit.c: Use sys/stat.h, not gdb_stat.h. * linux-nat.c: Use sys/stat.h, not gdb_stat.h. * m68klinux-nat.c: Use sys/stat.h, not gdb_stat.h. * main.c: Use sys/stat.h, not gdb_stat.h. * mdebugread.c: Use sys/stat.h, not gdb_stat.h. * mi/mi-cmd-env.c: Use sys/stat.h, not gdb_stat.h. * nto-tdep.c: Use sys/stat.h, not gdb_stat.h. * objfiles.c: Use sys/stat.h, not gdb_stat.h. * procfs.c: Use sys/stat.h, not gdb_stat.h. * remote-fileio.c: Use sys/stat.h, not gdb_stat.h. * remote-mips.c: Use sys/stat.h, not gdb_stat.h. * remote.c: Use sys/stat.h, not gdb_stat.h. * rs6000-nat.c: Use sys/stat.h, not gdb_stat.h. * sol-thread.c: Use sys/stat.h, not gdb_stat.h. * solib-spu.c: Use sys/stat.h, not gdb_stat.h. * source.c: Use sys/stat.h, not gdb_stat.h. * symfile.c: Use sys/stat.h, not gdb_stat.h. * symmisc.c: Use sys/stat.h, not gdb_stat.h. * symtab.c: Use sys/stat.h, not gdb_stat.h. * top.c: Use sys/stat.h, not gdb_stat.h. * xcoffread.c: Use sys/stat.h, not gdb_stat.h.
2013-11-06 15:55:51 +01:00
#include <sys/stat.h>
#include "gdb_bfd.h"
#include <sys/core.h>
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#define __LDINFO_PTRACE32__ /* for __ld_info32 */
#define __LDINFO_PTRACE64__ /* for __ld_info64 */
#include <sys/ldr.h>
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#include <sys/systemcfg.h>
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* On AIX4.3+, sys/ldr.h provides different versions of struct ld_info for
debugging 32-bit and 64-bit processes. Define a typedef and macros for
accessing fields in the appropriate structures. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* In 32-bit compilation mode (which is the only mode from which ptrace()
works on 4.3), __ld_info32 is #defined as equivalent to ld_info. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#if defined (__ld_info32) || defined (__ld_info64)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
# define ARCH3264
#endif
/* Return whether the current architecture is 64-bit. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#ifndef ARCH3264
# define ARCH64() 0
#else
# define ARCH64() (register_size (target_gdbarch (), 0) == 8)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#endif
static target_xfer_partial_ftype rs6000_xfer_shared_libraries;
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
/* Given REGNO, a gdb register number, return the corresponding
number suitable for use as a ptrace() parameter. Return -1 if
there's no suitable mapping. Also, set the int pointed to by
ISFLOAT to indicate whether REGNO is a floating point register. */
static int
regmap (struct gdbarch *gdbarch, int regno, int *isfloat)
1999-07-07 22:19:36 +02:00
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
*isfloat = 0;
if (tdep->ppc_gp0_regnum <= regno
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
return regno;
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
else if (tdep->ppc_fp0_regnum >= 0
&& tdep->ppc_fp0_regnum <= regno
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
{
*isfloat = 1;
return regno - tdep->ppc_fp0_regnum + FPR0;
}
else if (regno == gdbarch_pc_regnum (gdbarch))
return IAR;
else if (regno == tdep->ppc_ps_regnum)
return MSR;
else if (regno == tdep->ppc_cr_regnum)
return CR;
else if (regno == tdep->ppc_lr_regnum)
return LR;
else if (regno == tdep->ppc_ctr_regnum)
return CTR;
else if (regno == tdep->ppc_xer_regnum)
return XER;
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
else if (tdep->ppc_fpscr_regnum >= 0
&& regno == tdep->ppc_fpscr_regnum)
return FPSCR;
else if (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum)
return MQ;
else
return -1;
}
/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
static int
rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
#ifdef HAVE_PTRACE64
int ret = ptrace64 (req, id, (uintptr_t) addr, data, buf);
#else
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
int ret = ptrace (req, id, (int *)addr, data, buf);
#endif
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#if 0
printf ("rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
req, id, (unsigned int)addr, data, (unsigned int)buf, ret);
#endif
return ret;
}
/* Call ptracex(REQ, ID, ADDR, DATA, BUF). */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
static int
rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
#ifdef ARCH3264
# ifdef HAVE_PTRACE64
Fix AIX gdb build with C++ compiler We currently get: ../../src/gdb/aix-thread.c: In function 'int pdc_read_data(pthdb_user_t, void*, pthdb_addr_t, size_t)': ../../src/gdb/aix-thread.c:465:46: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] status = target_read_memory (addr, buf, len); ^ ../../src/gdb/aix-thread.c: In function 'void aix_thread_resume(target_ops*, ptid_t, int, gdb_signal)': ../../src/gdb/aix-thread.c:1010:46: error: invalid conversion from 'void*' to 'int*' [-fpermissive] gdb_signal_to_host (sig), (void *) tid); ^ ../../src/gdb/aix-thread.c:243:1: error: initializing argument 5 of 'int ptrace64aix(int, int, long long int, int, int*)' [-fpermissive] ptrace64aix (int req, int id, long long addr, int data, int *buf) ../../src/gdb/rs6000-nat.c: In function 'gdb_byte* rs6000_ptrace_ldinfo(ptid_t)': ../../src/gdb/rs6000-nat.c:596:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] gdb_byte *ldi = xmalloc (ldi_size); ^ ../../src/gdb/rs6000-nat.c:615:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] ldi = xrealloc (ldi, ldi_size); ^ (and more instances of the same). gdb/ChangeLog: 2016-04-21 Pedro Alves <palves@redhat.com> * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. (aix_thread_resume): Use PTRACE_TYPE_ARG5. * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void pointer, and cast return to gdb_byte pointer.
2016-04-21 15:02:20 +02:00
int ret = ptrace64 (req, id, addr, data, (PTRACE_TYPE_ARG5) buf);
# else
Fix AIX gdb build with C++ compiler We currently get: ../../src/gdb/aix-thread.c: In function 'int pdc_read_data(pthdb_user_t, void*, pthdb_addr_t, size_t)': ../../src/gdb/aix-thread.c:465:46: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] status = target_read_memory (addr, buf, len); ^ ../../src/gdb/aix-thread.c: In function 'void aix_thread_resume(target_ops*, ptid_t, int, gdb_signal)': ../../src/gdb/aix-thread.c:1010:46: error: invalid conversion from 'void*' to 'int*' [-fpermissive] gdb_signal_to_host (sig), (void *) tid); ^ ../../src/gdb/aix-thread.c:243:1: error: initializing argument 5 of 'int ptrace64aix(int, int, long long int, int, int*)' [-fpermissive] ptrace64aix (int req, int id, long long addr, int data, int *buf) ../../src/gdb/rs6000-nat.c: In function 'gdb_byte* rs6000_ptrace_ldinfo(ptid_t)': ../../src/gdb/rs6000-nat.c:596:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] gdb_byte *ldi = xmalloc (ldi_size); ^ ../../src/gdb/rs6000-nat.c:615:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] ldi = xrealloc (ldi, ldi_size); ^ (and more instances of the same). gdb/ChangeLog: 2016-04-21 Pedro Alves <palves@redhat.com> * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. (aix_thread_resume): Use PTRACE_TYPE_ARG5. * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void pointer, and cast return to gdb_byte pointer.
2016-04-21 15:02:20 +02:00
int ret = ptracex (req, id, addr, data, (PTRACE_TYPE_ARG5) buf);
# endif
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#else
int ret = 0;
#endif
#if 0
printf ("rs6000_ptrace64 (%d, %d, %s, %08x, 0x%x) = 0x%x\n",
req, id, hex_string (addr), data, (unsigned int)buf, ret);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#endif
return ret;
}
/* Fetch register REGNO from the inferior. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
static void
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (struct regcache *regcache, int regno)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
s/get_regcache_arch (regcache)/regcache->arch ()/g This patches removes get_regcache_arch, and use regache->arch () instead. The motivation of this change is that I am going to move some basic stuff into a base class of regcache. I don't need to update "client" code regcache->arch (). On the other hand, this patch shortens the code a little bit. gdb: 2017-10-25 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use regcache->arch () instead get_regcache_arch. * aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers): Likewise. (aarch64_fbsd_store_inferior_registers): Likewise. * aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise. (store_gregs_to_thread): Likewise. (fetch_fpregs_from_thread): Likewise. (store_fpregs_to_thread): Likewise. * aarch64-tdep.c (aarch64_extract_return_value): Likewise. (aarch64_store_return_value): Likewise. (aarch64_software_single_step): Likewise. * aix-thread.c (aix_thread_wait): Likewise. (supply_reg32): Likewise. (supply_sprs64): Likewise. (supply_sprs32): Likewise. (fill_gprs64): Likewise. (fill_gprs32): Likewise. (fill_sprs64): Likewise. (fill_sprs32): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * alpha-tdep.c (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. (alpha_deal_with_atomic_sequence): Likewise. (alpha_next_pc): Likewise. (alpha_software_single_step): Likewise. * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise. (amd64obsd_collect_uthread): Likewise. * amd64-tdep.c (amd64_supply_fpregset): Likewise. (amd64_collect_fpregset): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * arc-tdep.c (arc_write_pc): Likewise. * arch-utils.c (default_skip_permanent_breakpoint): Likewise. * arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise. (arm_fbsd_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_vfp_regs): Likewise. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_sigreturn_next_pc): Likewise. (arm_linux_get_next_pcs_syscall_next_pc): Likewise. * arm-nbsd-nat.c (arm_supply_gregset): Likewise. (fetch_register): Likewise. (store_register): Likewise. * arm-tdep.c (arm_is_thumb): Likewise. (displaced_in_arm_mode): Likewise. (bx_write_pc): Likewise. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_software_single_step): Likewise. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. (arm_write_pc): Likewise. * bfin-tdep.c (bfin_extract_return_value): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * core-regset.c (fetch_core_registers): Likewise. * corelow.c (get_core_registers): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. (find_step_target): Likewise. (find_step_target): Likewise. (cris_software_single_step): Likewise. * ctf.c (ctf_fetch_registers): Likewise. * darwin-nat.c (cancel_breakpoint): Likewise. * fbsd-tdep.c (fbsd_collect_thread_registers): Likewise. * frv-tdep.c (frv_extract_return_value): Likewise. * ft32-tdep.c (ft32_store_return_value): Likewise. (ft32_extract_return_value): Likewise. * go32-nat.c (fetch_register): Likewise. (go32_fetch_registers): Likewise. (go32_store_registers): Likewise. (store_register): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise. (i386_darwin_store_inferior_registers): Likewise. * i386-gnu-nat.c (gnu_fetch_registers): Likewise. (gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (supply_gregset): Likewise. (fill_gregset): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. (i386_linux_resume): Likewise. * i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache): Likewise. * i386-nto-tdep.c (i386nto_supply_gregset): Likewise. * i386-obsd-nat.c (i386obsd_supply_pcb): Likewise. * i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise. (i386obsd_collect_uthread): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. (i386_mpx_bd_base): Likewise. * i386-v4-nat.c (supply_fpregset): Likewise. (fill_fpregset): 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-linux-nat.c (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_registers): Likewise. * ia64-tdep.c (ia64_access_rse_reg): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (find_func_descr): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_registers): Likewise. * infrun.c (use_displaced_stepping): Likewise. (displaced_step_prepare_throw): Likewise. (resume): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (save_infcall_suspend_state): Likewise. (restore_infcall_suspend_state): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Likewise. * jit.c (jit_frame_prev_register): Likewise. * linux-nat.c (save_stop_reason): Likewise. (linux_nat_wait_1): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (record_linux_system_call): Likewise. * linux-tdep.c (linux_collect_thread_registers): Likewise. * lm32-tdep.c (lm32_extract_return_value): Likewise. (lm32_store_return_value): Likewise. * m32c-tdep.c (m32c_read_flg): Likewise. (m32c_pseudo_register_read): Likewise. (m32c_pseudo_register_write): Likewise. * m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_store_return_value): Likewise. (m32r_extract_return_value): Likewise. * m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. * m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise. * m68k-linux-nat.c (fetch_register): Likewise. (old_fetch_inferior_registers): Likewise. (old_store_inferior_registers): Likewise. (store_regs): Likewise. * m68k-tdep.c (m68k_svr4_extract_return_value): Likewise. (m68k_svr4_store_return_value): Likewise. * m88k-tdep.c (m88k_store_arguments): Likewise. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_write_register_values): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise. (mips_fbsd_store_inferior_registers): Likewise. * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise. (mips_fbsd_supply_gregs): Likewise. (mips_fbsd_collect_fpregs): Likewise. (mips_fbsd_collect_gregs): Likewise. (mips_fbsd_supply_fpregset): Likewise. (mips_fbsd_collect_fpregset): Likewise. (mips_fbsd_supply_gregset): Likewise. (mips_fbsd_collect_gregset): Likewise. * mips-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (supply_fpregset): Likewise. (fill_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset): Likewise. (mips_fill_gregset): Likewise. (mips_supply_fpregset): Likewise. (mips_fill_fpregset): Likewise. (mips64_supply_gregset): Likewise. (micromips_linux_sigframe_validate): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise. (mipsnbsd_supply_gregset): Likewise. (mipsnbsd_iterate_over_regset_sections): Likewise. (mipsnbsd_supply_reg): Likewise. (mipsnbsd_supply_fpreg): Likewise. * mips-tdep.c (mips_in_frame_stub): Likewise. (mips_dummy_id): Likewise. (is_octeon_bbit_op): Likewise. (micromips_bc1_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (deal_with_atomic_sequence): Likewise. * moxie-tdep.c (moxie_process_readu): Likewise. * nios2-tdep.c (nios2_get_next_pc): Likewise. * nto-procfs.c (procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise. (ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (fetch_vsx_register): Likewise. (fetch_altivec_register): Likewise. (get_spe_registers): Likewise. (fetch_spe_register): Likewise. (fetch_altivec_registers): Likewise. (fetch_all_gp_regs): Likewise. (fetch_all_fp_regs): Likewise. (store_vsx_register): Likewise. (store_altivec_register): Likewise. (set_spe_registers): Likewise. (store_spe_register): Likewise. (store_altivec_registers): Likewise. (store_all_gp_regs): Likewise. (store_all_fp_regs): Likewise. * ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise. (ppc_linux_collect_gregset): Likewise. (ppc_canonicalize_syscall): Likewise. (ppc_linux_record_signal): Likewise. (ppu2spu_prev_register): Likewise. * ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers): Likewise. (ppc_ravenscar_generic_store_registers): Likewise. * procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers): Likewise. (ravenscar_store_registers): Likewise. (ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers): Likewise. * record-full.c (record_full_wait_1): Likewise. (record_full_registers_change): Likewise. (record_full_store_registers): Likewise. (record_full_core_fetch_registers): Likewise. (record_full_save): Likewise. (record_full_goto_insn): Likewise. * regcache.c (regcache_register_size): Likewise. (get_regcache_arch): Remove. (regcache_read_pc): Likewise. * regcache.h (get_regcache_arch): Remove. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * remote.c (fetch_register_using_p): Likewise. (send_g_packet): Likewise. (remote_prepare_to_store): Likewise. (store_registers_using_G): Likewise. * reverse.c (save_bookmark_command): Likewise. (goto_bookmark_command): Likewise. * rs6000-aix-tdep.c (branch_dest): Likewise. * rs6000-nat.c (rs6000_ptrace64): Likewise. (fetch_register): Likewise. * rs6000-tdep.c (ppc_supply_reg): Likewise. (ppc_collect_reg): Likewise. (ppc_collect_gregset): Likewise. (ppc_collect_fpregset): Likewise. (ppc_collect_vsxregset): Likewise. (ppc_collect_vrregset): Likewise. (ppc_displaced_step_hw_singlestep): Likewise. (rs6000_pseudo_register_read): Likewise. (rs6000_pseudo_register_write): Likewise. * s390-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (s390_linux_fetch_inferior_registers): Likewise. * s390-linux-tdep.c (s390_write_pc): Likewise. (s390_software_single_step): Likewise. (s390_all_but_pc_registers_record): Likewise. (s390_linux_syscall_record): Likewise. * sentinel-frame.c (sentinel_frame_prev_arch): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sh-tdep.c (sh_extract_return_value_nofpu): Likewise. (sh_extract_return_value_fpu): Likewise. (sh_store_return_value_nofpu): Likewise. (sh_corefile_supply_regset): Likewise. (sh_corefile_collect_regset): Likewise. * sh64-tdep.c (sh64_extract_return_value): Likewise. (sh64_store_return_value): Likewise. * sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers): Likewise. (sparc_store_inferior_registers): Likewise. * sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise. (sparc_ravenscar_prepare_to_store): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. (sparc_analyze_control_transfer): Likewise. (sparc_step_trap): Likewise. (sparc_software_single_step): Likewise. (sparc32_gdbarch_init): Likewise. (sparc_supply_rwindow): Likewise. (sparc_collect_rwindow): Likewise. * sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise. (sparc64nbsd_collect_gregset): Likewise. (sparc64nbsd_supply_fpregset): Likewise. (sparc64nbsd_collect_fpregset): Likewise. * sparc64-tdep.c (sparc64_store_arguments): Likewise. (sparc64_supply_gregset): Likewise. (sparc64_collect_gregset): Likewise. (sparc64_supply_fpregset): Likewise. (sparc64_collect_fpregset): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. * spu-tdep.c (spu_unwind_sp): Likewise. (spu2ppu_prev_register): Likewise. (spu_memory_remove_breakpoint): Likewise. * stack.c (return_command): Likewise. * tic6x-tdep.c (tic6x_extract_signed_field): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (trace_save_ctf): Likewise. * windows-nat.c (do_windows_fetch_inferior_registers): Likewise. (do_windows_store_inferior_registers): Likewise. (windows_resume): Likewise. * xtensa-linux-nat.c (fill_gregset): Likewise. (supply_gregset_reg): Likewise. * xtensa-tdep.c (xtensa_register_write_masked): Likewise. (xtensa_register_read_masked): Likewise. (xtensa_supply_gregset): Likewise. (xtensa_extract_return_value): Likewise. (xtensa_store_return_value): Likewise.
2017-10-25 17:37:03 +02:00
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
/* Retrieved values may be -1, so infer errors from errno. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
errno = 0;
nr = regmap (gdbarch, regno, &isfloat);
/* Floating-point registers. */
if (isfloat)
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
rs6000_ptrace32 (PT_READ_FPR, pid, addr, nr, 0);
/* Bogus register number. */
else if (nr < 0)
{
if (regno >= gdbarch_num_regs (gdbarch))
fprintf_unfiltered (gdb_stderr,
"gdb error: register no %d not implemented.\n",
regno);
return;
}
/* Fixed-point registers. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
if (!ARCH64 ())
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
*addr = rs6000_ptrace32 (PT_READ_GPR, pid, (int *) nr, 0, 0);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
/* PT_READ_GPR requires the buffer parameter to point to long long,
even if the register is really only 32 bits. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
long long buf;
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
rs6000_ptrace64 (PT_READ_GPR, pid, nr, 0, &buf);
if (register_size (gdbarch, regno) == 8)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
memcpy (addr, &buf, 8);
else
*addr = buf;
}
}
if (!errno)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
regcache_raw_supply (regcache, regno, (char *) addr);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
#if 0
/* FIXME: this happens 3 times at the start of each 64-bit program. */
perror (_("ptrace read"));
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
#endif
errno = 0;
}
}
/* Store register REGNO back into the inferior. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
static void
* inferior.h (read_pc, write_pc): Remove. * regcache.c (read_pc, write_pc): Remove. * infrun.c (displaced_step_fixup): Use regcache_read_pc instead of read_pc. (handle_inferior_event): Use regcache_read_pc instead of read_pc when determining value of stop_pc. Replace subsequent uses of read_pc by inspecting already-retrieved stop_pc value. (keep_going): Use regcache_read_pc instead of read_pc. * breakpoint.c (watchpoint_check): Use current frame architecture and PC instead of current_gdbarch and read_pc (). * tracepoint.c (set_traceframe_context): Replace PC argument with FRAME argument. (trace_start_command, finish_tfind_command): Update calls. (finish_tfind_command): Compare frame IDs to identify transitions between frames. (trace_find_pc_command): Use regcache_read_pc instead of read_pc. * rs6000-nat.c (exec_one_dummy_insn): Pass in regcache instead of gdbarch. Use regcache_read_pc and regcache_write_pc instead of read_pc and write_pc. (store_register): Make regcache argument non-const. Update call to exec_one_dummy_insn. * thread.c (switch_to_thread): Use regcache_read_pc instead of read_pc. * infcmd.c (post_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-sunos.c (sunos_solib_create_inferior_hook): Likewise. * solib-svr4.c (enable_break, svr4_relocate_main_executable): Likewise. * linux-fork.c (fork_load_infrun_state): Likewise. * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Likewise. * record.c (record_wait): Likewise. * procfs.c (procfs_wait): Likewise. * remote-mips.c (common_open, mips_wait): Likewise. * remote-m32r-sdi.c (m32r_resume): Likewise. * symfile.c (generic_load): Use regcache_write_pc instead of write_pc. * monitor.c (monitor_create_inferior, monitor_load): Likewise. * m32r-rom.c (m32r_load, m32r_upload_command): Likewise. * remote-m32r-sdi.c (m32r_create_inferior, m32r_load): Likewise. * remote-mips.c (mips_create_inferior, mips_load): Likewise. * solib-darwin.c: Include "regcache.h". * solib-pa64.c: Include "regcache.h". * solib-svr4.c: Include "regcache.h.". * symfile.c: Do not mention read_pc or write_pc in comments. * dink32-rom.c: Likewise. * m32r-rom.c: Likewise. * mips-tdep.c: Likewise.
2009-05-05 15:24:49 +02:00
store_register (struct regcache *regcache, int regno)
{
s/get_regcache_arch (regcache)/regcache->arch ()/g This patches removes get_regcache_arch, and use regache->arch () instead. The motivation of this change is that I am going to move some basic stuff into a base class of regcache. I don't need to update "client" code regcache->arch (). On the other hand, this patch shortens the code a little bit. gdb: 2017-10-25 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use regcache->arch () instead get_regcache_arch. * aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers): Likewise. (aarch64_fbsd_store_inferior_registers): Likewise. * aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise. (store_gregs_to_thread): Likewise. (fetch_fpregs_from_thread): Likewise. (store_fpregs_to_thread): Likewise. * aarch64-tdep.c (aarch64_extract_return_value): Likewise. (aarch64_store_return_value): Likewise. (aarch64_software_single_step): Likewise. * aix-thread.c (aix_thread_wait): Likewise. (supply_reg32): Likewise. (supply_sprs64): Likewise. (supply_sprs32): Likewise. (fill_gprs64): Likewise. (fill_gprs32): Likewise. (fill_sprs64): Likewise. (fill_sprs32): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * alpha-tdep.c (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. (alpha_deal_with_atomic_sequence): Likewise. (alpha_next_pc): Likewise. (alpha_software_single_step): Likewise. * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise. (amd64obsd_collect_uthread): Likewise. * amd64-tdep.c (amd64_supply_fpregset): Likewise. (amd64_collect_fpregset): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * arc-tdep.c (arc_write_pc): Likewise. * arch-utils.c (default_skip_permanent_breakpoint): Likewise. * arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise. (arm_fbsd_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_vfp_regs): Likewise. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_sigreturn_next_pc): Likewise. (arm_linux_get_next_pcs_syscall_next_pc): Likewise. * arm-nbsd-nat.c (arm_supply_gregset): Likewise. (fetch_register): Likewise. (store_register): Likewise. * arm-tdep.c (arm_is_thumb): Likewise. (displaced_in_arm_mode): Likewise. (bx_write_pc): Likewise. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_software_single_step): Likewise. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. (arm_write_pc): Likewise. * bfin-tdep.c (bfin_extract_return_value): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * core-regset.c (fetch_core_registers): Likewise. * corelow.c (get_core_registers): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. (find_step_target): Likewise. (find_step_target): Likewise. (cris_software_single_step): Likewise. * ctf.c (ctf_fetch_registers): Likewise. * darwin-nat.c (cancel_breakpoint): Likewise. * fbsd-tdep.c (fbsd_collect_thread_registers): Likewise. * frv-tdep.c (frv_extract_return_value): Likewise. * ft32-tdep.c (ft32_store_return_value): Likewise. (ft32_extract_return_value): Likewise. * go32-nat.c (fetch_register): Likewise. (go32_fetch_registers): Likewise. (go32_store_registers): Likewise. (store_register): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise. (i386_darwin_store_inferior_registers): Likewise. * i386-gnu-nat.c (gnu_fetch_registers): Likewise. (gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (supply_gregset): Likewise. (fill_gregset): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. (i386_linux_resume): Likewise. * i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache): Likewise. * i386-nto-tdep.c (i386nto_supply_gregset): Likewise. * i386-obsd-nat.c (i386obsd_supply_pcb): Likewise. * i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise. (i386obsd_collect_uthread): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. (i386_mpx_bd_base): Likewise. * i386-v4-nat.c (supply_fpregset): Likewise. (fill_fpregset): 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-linux-nat.c (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_registers): Likewise. * ia64-tdep.c (ia64_access_rse_reg): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (find_func_descr): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_registers): Likewise. * infrun.c (use_displaced_stepping): Likewise. (displaced_step_prepare_throw): Likewise. (resume): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (save_infcall_suspend_state): Likewise. (restore_infcall_suspend_state): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Likewise. * jit.c (jit_frame_prev_register): Likewise. * linux-nat.c (save_stop_reason): Likewise. (linux_nat_wait_1): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (record_linux_system_call): Likewise. * linux-tdep.c (linux_collect_thread_registers): Likewise. * lm32-tdep.c (lm32_extract_return_value): Likewise. (lm32_store_return_value): Likewise. * m32c-tdep.c (m32c_read_flg): Likewise. (m32c_pseudo_register_read): Likewise. (m32c_pseudo_register_write): Likewise. * m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_store_return_value): Likewise. (m32r_extract_return_value): Likewise. * m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. * m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise. * m68k-linux-nat.c (fetch_register): Likewise. (old_fetch_inferior_registers): Likewise. (old_store_inferior_registers): Likewise. (store_regs): Likewise. * m68k-tdep.c (m68k_svr4_extract_return_value): Likewise. (m68k_svr4_store_return_value): Likewise. * m88k-tdep.c (m88k_store_arguments): Likewise. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_write_register_values): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise. (mips_fbsd_store_inferior_registers): Likewise. * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise. (mips_fbsd_supply_gregs): Likewise. (mips_fbsd_collect_fpregs): Likewise. (mips_fbsd_collect_gregs): Likewise. (mips_fbsd_supply_fpregset): Likewise. (mips_fbsd_collect_fpregset): Likewise. (mips_fbsd_supply_gregset): Likewise. (mips_fbsd_collect_gregset): Likewise. * mips-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (supply_fpregset): Likewise. (fill_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset): Likewise. (mips_fill_gregset): Likewise. (mips_supply_fpregset): Likewise. (mips_fill_fpregset): Likewise. (mips64_supply_gregset): Likewise. (micromips_linux_sigframe_validate): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise. (mipsnbsd_supply_gregset): Likewise. (mipsnbsd_iterate_over_regset_sections): Likewise. (mipsnbsd_supply_reg): Likewise. (mipsnbsd_supply_fpreg): Likewise. * mips-tdep.c (mips_in_frame_stub): Likewise. (mips_dummy_id): Likewise. (is_octeon_bbit_op): Likewise. (micromips_bc1_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (deal_with_atomic_sequence): Likewise. * moxie-tdep.c (moxie_process_readu): Likewise. * nios2-tdep.c (nios2_get_next_pc): Likewise. * nto-procfs.c (procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise. (ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (fetch_vsx_register): Likewise. (fetch_altivec_register): Likewise. (get_spe_registers): Likewise. (fetch_spe_register): Likewise. (fetch_altivec_registers): Likewise. (fetch_all_gp_regs): Likewise. (fetch_all_fp_regs): Likewise. (store_vsx_register): Likewise. (store_altivec_register): Likewise. (set_spe_registers): Likewise. (store_spe_register): Likewise. (store_altivec_registers): Likewise. (store_all_gp_regs): Likewise. (store_all_fp_regs): Likewise. * ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise. (ppc_linux_collect_gregset): Likewise. (ppc_canonicalize_syscall): Likewise. (ppc_linux_record_signal): Likewise. (ppu2spu_prev_register): Likewise. * ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers): Likewise. (ppc_ravenscar_generic_store_registers): Likewise. * procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers): Likewise. (ravenscar_store_registers): Likewise. (ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers): Likewise. * record-full.c (record_full_wait_1): Likewise. (record_full_registers_change): Likewise. (record_full_store_registers): Likewise. (record_full_core_fetch_registers): Likewise. (record_full_save): Likewise. (record_full_goto_insn): Likewise. * regcache.c (regcache_register_size): Likewise. (get_regcache_arch): Remove. (regcache_read_pc): Likewise. * regcache.h (get_regcache_arch): Remove. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * remote.c (fetch_register_using_p): Likewise. (send_g_packet): Likewise. (remote_prepare_to_store): Likewise. (store_registers_using_G): Likewise. * reverse.c (save_bookmark_command): Likewise. (goto_bookmark_command): Likewise. * rs6000-aix-tdep.c (branch_dest): Likewise. * rs6000-nat.c (rs6000_ptrace64): Likewise. (fetch_register): Likewise. * rs6000-tdep.c (ppc_supply_reg): Likewise. (ppc_collect_reg): Likewise. (ppc_collect_gregset): Likewise. (ppc_collect_fpregset): Likewise. (ppc_collect_vsxregset): Likewise. (ppc_collect_vrregset): Likewise. (ppc_displaced_step_hw_singlestep): Likewise. (rs6000_pseudo_register_read): Likewise. (rs6000_pseudo_register_write): Likewise. * s390-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (s390_linux_fetch_inferior_registers): Likewise. * s390-linux-tdep.c (s390_write_pc): Likewise. (s390_software_single_step): Likewise. (s390_all_but_pc_registers_record): Likewise. (s390_linux_syscall_record): Likewise. * sentinel-frame.c (sentinel_frame_prev_arch): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sh-tdep.c (sh_extract_return_value_nofpu): Likewise. (sh_extract_return_value_fpu): Likewise. (sh_store_return_value_nofpu): Likewise. (sh_corefile_supply_regset): Likewise. (sh_corefile_collect_regset): Likewise. * sh64-tdep.c (sh64_extract_return_value): Likewise. (sh64_store_return_value): Likewise. * sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers): Likewise. (sparc_store_inferior_registers): Likewise. * sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise. (sparc_ravenscar_prepare_to_store): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. (sparc_analyze_control_transfer): Likewise. (sparc_step_trap): Likewise. (sparc_software_single_step): Likewise. (sparc32_gdbarch_init): Likewise. (sparc_supply_rwindow): Likewise. (sparc_collect_rwindow): Likewise. * sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise. (sparc64nbsd_collect_gregset): Likewise. (sparc64nbsd_supply_fpregset): Likewise. (sparc64nbsd_collect_fpregset): Likewise. * sparc64-tdep.c (sparc64_store_arguments): Likewise. (sparc64_supply_gregset): Likewise. (sparc64_collect_gregset): Likewise. (sparc64_supply_fpregset): Likewise. (sparc64_collect_fpregset): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. * spu-tdep.c (spu_unwind_sp): Likewise. (spu2ppu_prev_register): Likewise. (spu_memory_remove_breakpoint): Likewise. * stack.c (return_command): Likewise. * tic6x-tdep.c (tic6x_extract_signed_field): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (trace_save_ctf): Likewise. * windows-nat.c (do_windows_fetch_inferior_registers): Likewise. (do_windows_store_inferior_registers): Likewise. (windows_resume): Likewise. * xtensa-linux-nat.c (fill_gregset): Likewise. (supply_gregset_reg): Likewise. * xtensa-tdep.c (xtensa_register_write_masked): Likewise. (xtensa_register_read_masked): Likewise. (xtensa_supply_gregset): Likewise. (xtensa_extract_return_value): Likewise. (xtensa_store_return_value): Likewise.
2017-10-25 17:37:03 +02:00
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
/* Fetch the register's value from the register cache. */
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
regcache_raw_collect (regcache, regno, addr);
/* -1 can be a successful return value, so infer errors from errno. */
errno = 0;
nr = regmap (gdbarch, regno, &isfloat);
/* Floating-point registers. */
if (isfloat)
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
rs6000_ptrace32 (PT_WRITE_FPR, pid, addr, nr, 0);
/* Bogus register number. */
else if (nr < 0)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
if (regno >= gdbarch_num_regs (gdbarch))
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
fprintf_unfiltered (gdb_stderr,
"gdb error: register no %d not implemented.\n",
regno);
}
/* Fixed-point registers. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
/* The PT_WRITE_GPR operation is rather odd. For 32-bit inferiors,
the register's value is passed by value, but for 64-bit inferiors,
the address of a buffer containing the value is passed. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (!ARCH64 ())
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
rs6000_ptrace32 (PT_WRITE_GPR, pid, (int *) nr, *addr, 0);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
area, even if the register is really only 32 bits. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
long long buf;
if (register_size (gdbarch, regno) == 8)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
memcpy (&buf, addr, 8);
else
buf = *addr;
Use ptid from regcache in almost all remaining nat files This patch contains almost all of the remaining changes needed to make to_fetch_registers/to_store_registers/to_prepare_to_store independent of inferior_ptid. It contains only some "trivial" changes, the more complicated ones are in separate patches. gdb/ChangeLog: * i386-linux-nat.c (fetch_register, store_register, i386_linux_fetch_inferior_registers, i386_linux_store_inferior_registers): Use ptid from regcache. * ia64-linux-nat.c (ia64_linux_fetch_register, ia64_linux_store_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register, inf_ptrace_store_register): Likewise. * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers, m32r_linux_store_inferior_registers): Likewise. * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers, m68kbsd_store_inferior_registers): Likewise. * m68k-linux-nat.c (fetch_register, store_register, m68k_linux_fetch_inferior_registers, m68k_linux_store_inferior_registers): Likewise. * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers, m88kbsd_store_inferior_registers): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers, mips_fbsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers, mips64_linux_regsets_store_registers): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers, mipsnbsd_store_inferior_registers): Likewise. * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers, mips64obsd_store_inferior_registers): Likewise. * nto-procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers, ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers, ppc_linux_store_inferior_registers): Likewise. * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers, ppcnbsd_store_inferior_registers): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers, ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers, ravenscar_store_registers, ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers, record_btrace_store_registers, record_btrace_prepare_to_store): Likewise. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Lookup inferior using ptid from regcache, instead of current_inferior. * remote.c (remote_fetch_registers, remote_store_registers): Use ptid from regcache. * rs6000-nat.c (fetch_register, store_register): Likewise. * s390-linux-nat.c (s390_linux_fetch_inferior_registers, s390_linux_store_inferior_registers): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers, sol_thread_store_registers): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers, sparc_store_inferior_registers): Likewise. * tilegx-linux-nat.c (fetch_inferior_registers, store_inferior_registers): Likewise. * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers, vaxbsd_store_inferior_registers): Likewise. * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs, store_xtregs): Likewise.
2017-03-20 22:37:36 +01:00
rs6000_ptrace64 (PT_WRITE_GPR, pid, nr, 0, &buf);
}
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (errno)
{
perror (_("ptrace write"));
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
errno = 0;
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Read from the inferior all registers if REGNO == -1 and just register
REGNO otherwise. */
static void
* corelow.c (get_core_registers): Adjust. (core_file_thread_alive): Rename to... (core_thread_alive): ... this. (core_pid_to_str): Try gdbarch_core_pid_to_str first. (init_core_ops): Adjust. (coreops_suppress_target): Delete. (_initialize_corelow): Unconditionally add core_ops. * procfs.c: Include "inf-child.h". (procfs_ops): Delete. (init_procfs_ops): Delete. Reimplement as... (procfs_target): ... this, inheriting from inf-child. (procfs_attach, procfs_detach, procfs_fetch_registers): Adjust. (procfs_prepare_to_store): Delete. (procfs_store_registers, procfs_resume): Adjust. (procfs_open): Delete. (procfs_suppress_run): Delete. (procfs_can_run): Delete. (procfs_mourn_inferior): Adjust. (procfs_init_inferior): Add target_ops parameter. Adjust. (procfs_create_inferior): Don't pass procfs_init_inferior to fork_inferior. Instead call it after fork_inferior returns. (procfs_find_new_threads): Adjust. (_initialize_procfs): Adjust to use procfs_target instead of init_procfs_ops. * sol-thread.c (orig_core_ops, sol_core_ops): Delete. (lwp_to_thread): Use target_thread_alive. (sol_thread_open): Delete. (sol_thread_attach): Delete. (sol_thread_detach, sol_thread_resume, sol_thread_wait) (sol_thread_fetch_registers, sol_thread_store_registers): Adjust to use find_target_beneath. (sol_thread_prepare_to_store, sol_thread_xfer_memory): Delete. (sol_thread_xfer_partial): Adjust to use find_target_beneath. (sol_thread_files_info, sol_thread_kill_inferior): Delete. (check_for_thread_db): New. (sol_thread_notice_signals, sol_thread_create_inferior): Delete. (sol_thread_new_objfile): Call check_for_thread_db. (sol_thread_mourn_inferior): Adjust to use find_target_beneath. (sol_thread_can_run): Delete. (sol_thread_alive): Adjust to use find_target_beneath. (sol_thread_stop): Delete. (rw_common): Use target_write_memory or target_read_memory. (ps_lgetregs, ps_lgetfpregs): Use target_fetch_registers. (ps_lsetregs, ps_lsetfpregs): Use target_store_registers. (solaris_pid_to_str): Remove check for libthread_db initialization failing. (sol_find_new_threads): Remove check for libthread_db initialization failing, or for an invalid inferior_ptid. Adjust to use find_target_beneath. (sol_core_open, sol_core_close, sol_core_detach, sol_core_files_info, sol_find_memory_regions, sol_make_note_section, ignore): Delete. (init_sol_thread_ops): Make it a thread_stratum target. Remove unneeded callback settings. (init_sol_core_ops): Delete. (_initialize_sol_thread): No longer call init_sol_core_ops, set procfs_suppress_run, or hack with core_ops. * target.h (struct target_ops): Add a target_ops * parameter to to_resume, to_fetch_registers, to_store_registers, to_thread_alive and to_find_new_threads. (target_fetch_registers, target_store_registers) (target_thread_alive, target_find_new_threads): Redeclare as function. * target.c (update_current_target): Do not inherit or de_fault to_resume, to_fetch_registers, to_store_registers, to_thread_alive, to_find_new_threads. (target_resume): Adjust. (target_thread_alive, target_find_new_threads): New. (debug_to_resume, debug_to_fetch_registers): Delete. (target_fetch_registers): New. (debug_to_store_registers): Delete. (target_store_registers): New. (debug_to_thread_alive, debug_to_find_new_threads): Delete. (setup_target_debug): Adjust. * gdbcore.h (core_ops): Delete declaration. * inf-ptrace.c, linux-nat.c, remote.c, amd64-linux-nat.c, inf-child.c, linux-thread-db.c, bsd-uthread.c, inf-ttrace.c, i386-sol2-tdep.c, darwin-nat.c, gnu-nat.c, go32-nat.c, hpux-thread.c, i386-linux-nat.c, i386fbsd-nat.c, monitor.c, nto-procfs.c, remote-m32r-sdi.c, remote-mips.c, windows-nat.c, alphabsd-nat.c, amd64bsd-nat.c, arm-linux-nat.c, armnbsd-nat.c, bsd-kvm.c, hppa-hpux-nat.c, hppa-linux-nat.c, hppabsd-nat.c, hppanbsd-nat.c, i386-darwin-nat.c, i386bsd-nat.c, ia64-linux-nat.c, m32r-linux-nat.c, m68kbsd-nat.c, m68klinux-nat.c, m88kbsd-nat.c, mips-linux-nat.c, mips64obsd-nat.c, mipsnbsd-nat.c, ppc-linux-nat.c, ppcnbsd-nat.c, ppcobsd-nat.c, remote-sim.c, rs6000-nat.c, s390-nat.c, shnbsd-nat.c, sparc-nat.c, sparc-nat.h, spu-linux-nat.c, vaxbsd-nat.c, xtensa-linux-nat.c: Adjust to target_ops changes. * gdbarch.sh (core_pid_to_str): New gdbarch callback. * gdbarch.h, gdbarch.c: Regenerate. * sol2-tdep.c: Include "inferior.h". (sol2_core_pid_to_str): New. * sol2-tdep.h (sol2_core_pid_to_str): Declare. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Set it. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Set it. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Set it. * i386-sol2-tdep.c (i386_sol2_init_abi): Set it.
2009-02-23 01:03:50 +01:00
rs6000_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
s/get_regcache_arch (regcache)/regcache->arch ()/g This patches removes get_regcache_arch, and use regache->arch () instead. The motivation of this change is that I am going to move some basic stuff into a base class of regcache. I don't need to update "client" code regcache->arch (). On the other hand, this patch shortens the code a little bit. gdb: 2017-10-25 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use regcache->arch () instead get_regcache_arch. * aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers): Likewise. (aarch64_fbsd_store_inferior_registers): Likewise. * aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise. (store_gregs_to_thread): Likewise. (fetch_fpregs_from_thread): Likewise. (store_fpregs_to_thread): Likewise. * aarch64-tdep.c (aarch64_extract_return_value): Likewise. (aarch64_store_return_value): Likewise. (aarch64_software_single_step): Likewise. * aix-thread.c (aix_thread_wait): Likewise. (supply_reg32): Likewise. (supply_sprs64): Likewise. (supply_sprs32): Likewise. (fill_gprs64): Likewise. (fill_gprs32): Likewise. (fill_sprs64): Likewise. (fill_sprs32): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * alpha-tdep.c (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. (alpha_deal_with_atomic_sequence): Likewise. (alpha_next_pc): Likewise. (alpha_software_single_step): Likewise. * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise. (amd64obsd_collect_uthread): Likewise. * amd64-tdep.c (amd64_supply_fpregset): Likewise. (amd64_collect_fpregset): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * arc-tdep.c (arc_write_pc): Likewise. * arch-utils.c (default_skip_permanent_breakpoint): Likewise. * arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise. (arm_fbsd_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_vfp_regs): Likewise. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_sigreturn_next_pc): Likewise. (arm_linux_get_next_pcs_syscall_next_pc): Likewise. * arm-nbsd-nat.c (arm_supply_gregset): Likewise. (fetch_register): Likewise. (store_register): Likewise. * arm-tdep.c (arm_is_thumb): Likewise. (displaced_in_arm_mode): Likewise. (bx_write_pc): Likewise. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_software_single_step): Likewise. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. (arm_write_pc): Likewise. * bfin-tdep.c (bfin_extract_return_value): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * core-regset.c (fetch_core_registers): Likewise. * corelow.c (get_core_registers): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. (find_step_target): Likewise. (find_step_target): Likewise. (cris_software_single_step): Likewise. * ctf.c (ctf_fetch_registers): Likewise. * darwin-nat.c (cancel_breakpoint): Likewise. * fbsd-tdep.c (fbsd_collect_thread_registers): Likewise. * frv-tdep.c (frv_extract_return_value): Likewise. * ft32-tdep.c (ft32_store_return_value): Likewise. (ft32_extract_return_value): Likewise. * go32-nat.c (fetch_register): Likewise. (go32_fetch_registers): Likewise. (go32_store_registers): Likewise. (store_register): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise. (i386_darwin_store_inferior_registers): Likewise. * i386-gnu-nat.c (gnu_fetch_registers): Likewise. (gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (supply_gregset): Likewise. (fill_gregset): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. (i386_linux_resume): Likewise. * i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache): Likewise. * i386-nto-tdep.c (i386nto_supply_gregset): Likewise. * i386-obsd-nat.c (i386obsd_supply_pcb): Likewise. * i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise. (i386obsd_collect_uthread): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. (i386_mpx_bd_base): Likewise. * i386-v4-nat.c (supply_fpregset): Likewise. (fill_fpregset): 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-linux-nat.c (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_registers): Likewise. * ia64-tdep.c (ia64_access_rse_reg): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (find_func_descr): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_registers): Likewise. * infrun.c (use_displaced_stepping): Likewise. (displaced_step_prepare_throw): Likewise. (resume): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (save_infcall_suspend_state): Likewise. (restore_infcall_suspend_state): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Likewise. * jit.c (jit_frame_prev_register): Likewise. * linux-nat.c (save_stop_reason): Likewise. (linux_nat_wait_1): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (record_linux_system_call): Likewise. * linux-tdep.c (linux_collect_thread_registers): Likewise. * lm32-tdep.c (lm32_extract_return_value): Likewise. (lm32_store_return_value): Likewise. * m32c-tdep.c (m32c_read_flg): Likewise. (m32c_pseudo_register_read): Likewise. (m32c_pseudo_register_write): Likewise. * m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_store_return_value): Likewise. (m32r_extract_return_value): Likewise. * m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. * m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise. * m68k-linux-nat.c (fetch_register): Likewise. (old_fetch_inferior_registers): Likewise. (old_store_inferior_registers): Likewise. (store_regs): Likewise. * m68k-tdep.c (m68k_svr4_extract_return_value): Likewise. (m68k_svr4_store_return_value): Likewise. * m88k-tdep.c (m88k_store_arguments): Likewise. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_write_register_values): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise. (mips_fbsd_store_inferior_registers): Likewise. * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise. (mips_fbsd_supply_gregs): Likewise. (mips_fbsd_collect_fpregs): Likewise. (mips_fbsd_collect_gregs): Likewise. (mips_fbsd_supply_fpregset): Likewise. (mips_fbsd_collect_fpregset): Likewise. (mips_fbsd_supply_gregset): Likewise. (mips_fbsd_collect_gregset): Likewise. * mips-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (supply_fpregset): Likewise. (fill_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset): Likewise. (mips_fill_gregset): Likewise. (mips_supply_fpregset): Likewise. (mips_fill_fpregset): Likewise. (mips64_supply_gregset): Likewise. (micromips_linux_sigframe_validate): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise. (mipsnbsd_supply_gregset): Likewise. (mipsnbsd_iterate_over_regset_sections): Likewise. (mipsnbsd_supply_reg): Likewise. (mipsnbsd_supply_fpreg): Likewise. * mips-tdep.c (mips_in_frame_stub): Likewise. (mips_dummy_id): Likewise. (is_octeon_bbit_op): Likewise. (micromips_bc1_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (deal_with_atomic_sequence): Likewise. * moxie-tdep.c (moxie_process_readu): Likewise. * nios2-tdep.c (nios2_get_next_pc): Likewise. * nto-procfs.c (procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise. (ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (fetch_vsx_register): Likewise. (fetch_altivec_register): Likewise. (get_spe_registers): Likewise. (fetch_spe_register): Likewise. (fetch_altivec_registers): Likewise. (fetch_all_gp_regs): Likewise. (fetch_all_fp_regs): Likewise. (store_vsx_register): Likewise. (store_altivec_register): Likewise. (set_spe_registers): Likewise. (store_spe_register): Likewise. (store_altivec_registers): Likewise. (store_all_gp_regs): Likewise. (store_all_fp_regs): Likewise. * ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise. (ppc_linux_collect_gregset): Likewise. (ppc_canonicalize_syscall): Likewise. (ppc_linux_record_signal): Likewise. (ppu2spu_prev_register): Likewise. * ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers): Likewise. (ppc_ravenscar_generic_store_registers): Likewise. * procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers): Likewise. (ravenscar_store_registers): Likewise. (ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers): Likewise. * record-full.c (record_full_wait_1): Likewise. (record_full_registers_change): Likewise. (record_full_store_registers): Likewise. (record_full_core_fetch_registers): Likewise. (record_full_save): Likewise. (record_full_goto_insn): Likewise. * regcache.c (regcache_register_size): Likewise. (get_regcache_arch): Remove. (regcache_read_pc): Likewise. * regcache.h (get_regcache_arch): Remove. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * remote.c (fetch_register_using_p): Likewise. (send_g_packet): Likewise. (remote_prepare_to_store): Likewise. (store_registers_using_G): Likewise. * reverse.c (save_bookmark_command): Likewise. (goto_bookmark_command): Likewise. * rs6000-aix-tdep.c (branch_dest): Likewise. * rs6000-nat.c (rs6000_ptrace64): Likewise. (fetch_register): Likewise. * rs6000-tdep.c (ppc_supply_reg): Likewise. (ppc_collect_reg): Likewise. (ppc_collect_gregset): Likewise. (ppc_collect_fpregset): Likewise. (ppc_collect_vsxregset): Likewise. (ppc_collect_vrregset): Likewise. (ppc_displaced_step_hw_singlestep): Likewise. (rs6000_pseudo_register_read): Likewise. (rs6000_pseudo_register_write): Likewise. * s390-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (s390_linux_fetch_inferior_registers): Likewise. * s390-linux-tdep.c (s390_write_pc): Likewise. (s390_software_single_step): Likewise. (s390_all_but_pc_registers_record): Likewise. (s390_linux_syscall_record): Likewise. * sentinel-frame.c (sentinel_frame_prev_arch): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sh-tdep.c (sh_extract_return_value_nofpu): Likewise. (sh_extract_return_value_fpu): Likewise. (sh_store_return_value_nofpu): Likewise. (sh_corefile_supply_regset): Likewise. (sh_corefile_collect_regset): Likewise. * sh64-tdep.c (sh64_extract_return_value): Likewise. (sh64_store_return_value): Likewise. * sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers): Likewise. (sparc_store_inferior_registers): Likewise. * sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise. (sparc_ravenscar_prepare_to_store): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. (sparc_analyze_control_transfer): Likewise. (sparc_step_trap): Likewise. (sparc_software_single_step): Likewise. (sparc32_gdbarch_init): Likewise. (sparc_supply_rwindow): Likewise. (sparc_collect_rwindow): Likewise. * sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise. (sparc64nbsd_collect_gregset): Likewise. (sparc64nbsd_supply_fpregset): Likewise. (sparc64nbsd_collect_fpregset): Likewise. * sparc64-tdep.c (sparc64_store_arguments): Likewise. (sparc64_supply_gregset): Likewise. (sparc64_collect_gregset): Likewise. (sparc64_supply_fpregset): Likewise. (sparc64_collect_fpregset): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. * spu-tdep.c (spu_unwind_sp): Likewise. (spu2ppu_prev_register): Likewise. (spu_memory_remove_breakpoint): Likewise. * stack.c (return_command): Likewise. * tic6x-tdep.c (tic6x_extract_signed_field): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (trace_save_ctf): Likewise. * windows-nat.c (do_windows_fetch_inferior_registers): Likewise. (do_windows_store_inferior_registers): Likewise. (windows_resume): Likewise. * xtensa-linux-nat.c (fill_gregset): Likewise. (supply_gregset_reg): Likewise. * xtensa-tdep.c (xtensa_register_write_masked): Likewise. (xtensa_register_read_masked): Likewise. (xtensa_supply_gregset): Likewise. (xtensa_extract_return_value): Likewise. (xtensa_store_return_value): Likewise.
2017-10-25 17:37:03 +02:00
struct gdbarch *gdbarch = regcache->arch ();
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (regno != -1)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, regno);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Read 32 general purpose registers. */
for (regno = tdep->ppc_gp0_regnum;
regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
regno++)
{
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, regno);
}
/* Read general purpose floating point registers. */
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
if (tdep->ppc_fp0_regnum >= 0)
for (regno = 0; regno < ppc_num_fprs; regno++)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, tdep->ppc_fp0_regnum + regno);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Read special registers. */
fetch_register (regcache, gdbarch_pc_regnum (gdbarch));
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, tdep->ppc_ps_regnum);
fetch_register (regcache, tdep->ppc_cr_regnum);
fetch_register (regcache, tdep->ppc_lr_regnum);
fetch_register (regcache, tdep->ppc_ctr_regnum);
fetch_register (regcache, tdep->ppc_xer_regnum);
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
if (tdep->ppc_fpscr_regnum >= 0)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, tdep->ppc_fpscr_regnum);
if (tdep->ppc_mq_regnum >= 0)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
fetch_register (regcache, tdep->ppc_mq_regnum);
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Store our register values back into the inferior.
If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register (so we can save time). */
static void
* corelow.c (get_core_registers): Adjust. (core_file_thread_alive): Rename to... (core_thread_alive): ... this. (core_pid_to_str): Try gdbarch_core_pid_to_str first. (init_core_ops): Adjust. (coreops_suppress_target): Delete. (_initialize_corelow): Unconditionally add core_ops. * procfs.c: Include "inf-child.h". (procfs_ops): Delete. (init_procfs_ops): Delete. Reimplement as... (procfs_target): ... this, inheriting from inf-child. (procfs_attach, procfs_detach, procfs_fetch_registers): Adjust. (procfs_prepare_to_store): Delete. (procfs_store_registers, procfs_resume): Adjust. (procfs_open): Delete. (procfs_suppress_run): Delete. (procfs_can_run): Delete. (procfs_mourn_inferior): Adjust. (procfs_init_inferior): Add target_ops parameter. Adjust. (procfs_create_inferior): Don't pass procfs_init_inferior to fork_inferior. Instead call it after fork_inferior returns. (procfs_find_new_threads): Adjust. (_initialize_procfs): Adjust to use procfs_target instead of init_procfs_ops. * sol-thread.c (orig_core_ops, sol_core_ops): Delete. (lwp_to_thread): Use target_thread_alive. (sol_thread_open): Delete. (sol_thread_attach): Delete. (sol_thread_detach, sol_thread_resume, sol_thread_wait) (sol_thread_fetch_registers, sol_thread_store_registers): Adjust to use find_target_beneath. (sol_thread_prepare_to_store, sol_thread_xfer_memory): Delete. (sol_thread_xfer_partial): Adjust to use find_target_beneath. (sol_thread_files_info, sol_thread_kill_inferior): Delete. (check_for_thread_db): New. (sol_thread_notice_signals, sol_thread_create_inferior): Delete. (sol_thread_new_objfile): Call check_for_thread_db. (sol_thread_mourn_inferior): Adjust to use find_target_beneath. (sol_thread_can_run): Delete. (sol_thread_alive): Adjust to use find_target_beneath. (sol_thread_stop): Delete. (rw_common): Use target_write_memory or target_read_memory. (ps_lgetregs, ps_lgetfpregs): Use target_fetch_registers. (ps_lsetregs, ps_lsetfpregs): Use target_store_registers. (solaris_pid_to_str): Remove check for libthread_db initialization failing. (sol_find_new_threads): Remove check for libthread_db initialization failing, or for an invalid inferior_ptid. Adjust to use find_target_beneath. (sol_core_open, sol_core_close, sol_core_detach, sol_core_files_info, sol_find_memory_regions, sol_make_note_section, ignore): Delete. (init_sol_thread_ops): Make it a thread_stratum target. Remove unneeded callback settings. (init_sol_core_ops): Delete. (_initialize_sol_thread): No longer call init_sol_core_ops, set procfs_suppress_run, or hack with core_ops. * target.h (struct target_ops): Add a target_ops * parameter to to_resume, to_fetch_registers, to_store_registers, to_thread_alive and to_find_new_threads. (target_fetch_registers, target_store_registers) (target_thread_alive, target_find_new_threads): Redeclare as function. * target.c (update_current_target): Do not inherit or de_fault to_resume, to_fetch_registers, to_store_registers, to_thread_alive, to_find_new_threads. (target_resume): Adjust. (target_thread_alive, target_find_new_threads): New. (debug_to_resume, debug_to_fetch_registers): Delete. (target_fetch_registers): New. (debug_to_store_registers): Delete. (target_store_registers): New. (debug_to_thread_alive, debug_to_find_new_threads): Delete. (setup_target_debug): Adjust. * gdbcore.h (core_ops): Delete declaration. * inf-ptrace.c, linux-nat.c, remote.c, amd64-linux-nat.c, inf-child.c, linux-thread-db.c, bsd-uthread.c, inf-ttrace.c, i386-sol2-tdep.c, darwin-nat.c, gnu-nat.c, go32-nat.c, hpux-thread.c, i386-linux-nat.c, i386fbsd-nat.c, monitor.c, nto-procfs.c, remote-m32r-sdi.c, remote-mips.c, windows-nat.c, alphabsd-nat.c, amd64bsd-nat.c, arm-linux-nat.c, armnbsd-nat.c, bsd-kvm.c, hppa-hpux-nat.c, hppa-linux-nat.c, hppabsd-nat.c, hppanbsd-nat.c, i386-darwin-nat.c, i386bsd-nat.c, ia64-linux-nat.c, m32r-linux-nat.c, m68kbsd-nat.c, m68klinux-nat.c, m88kbsd-nat.c, mips-linux-nat.c, mips64obsd-nat.c, mipsnbsd-nat.c, ppc-linux-nat.c, ppcnbsd-nat.c, ppcobsd-nat.c, remote-sim.c, rs6000-nat.c, s390-nat.c, shnbsd-nat.c, sparc-nat.c, sparc-nat.h, spu-linux-nat.c, vaxbsd-nat.c, xtensa-linux-nat.c: Adjust to target_ops changes. * gdbarch.sh (core_pid_to_str): New gdbarch callback. * gdbarch.h, gdbarch.c: Regenerate. * sol2-tdep.c: Include "inferior.h". (sol2_core_pid_to_str): New. * sol2-tdep.h (sol2_core_pid_to_str): Declare. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Set it. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Set it. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Set it. * i386-sol2-tdep.c (i386_sol2_init_abi): Set it.
2009-02-23 01:03:50 +01:00
rs6000_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
s/get_regcache_arch (regcache)/regcache->arch ()/g This patches removes get_regcache_arch, and use regache->arch () instead. The motivation of this change is that I am going to move some basic stuff into a base class of regcache. I don't need to update "client" code regcache->arch (). On the other hand, this patch shortens the code a little bit. gdb: 2017-10-25 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use regcache->arch () instead get_regcache_arch. * aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers): Likewise. (aarch64_fbsd_store_inferior_registers): Likewise. * aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise. (store_gregs_to_thread): Likewise. (fetch_fpregs_from_thread): Likewise. (store_fpregs_to_thread): Likewise. * aarch64-tdep.c (aarch64_extract_return_value): Likewise. (aarch64_store_return_value): Likewise. (aarch64_software_single_step): Likewise. * aix-thread.c (aix_thread_wait): Likewise. (supply_reg32): Likewise. (supply_sprs64): Likewise. (supply_sprs32): Likewise. (fill_gprs64): Likewise. (fill_gprs32): Likewise. (fill_sprs64): Likewise. (fill_sprs32): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * alpha-tdep.c (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. (alpha_deal_with_atomic_sequence): Likewise. (alpha_next_pc): Likewise. (alpha_software_single_step): Likewise. * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise. (amd64obsd_collect_uthread): Likewise. * amd64-tdep.c (amd64_supply_fpregset): Likewise. (amd64_collect_fpregset): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * arc-tdep.c (arc_write_pc): Likewise. * arch-utils.c (default_skip_permanent_breakpoint): Likewise. * arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise. (arm_fbsd_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_vfp_regs): Likewise. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_sigreturn_next_pc): Likewise. (arm_linux_get_next_pcs_syscall_next_pc): Likewise. * arm-nbsd-nat.c (arm_supply_gregset): Likewise. (fetch_register): Likewise. (store_register): Likewise. * arm-tdep.c (arm_is_thumb): Likewise. (displaced_in_arm_mode): Likewise. (bx_write_pc): Likewise. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_software_single_step): Likewise. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. (arm_write_pc): Likewise. * bfin-tdep.c (bfin_extract_return_value): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * core-regset.c (fetch_core_registers): Likewise. * corelow.c (get_core_registers): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. (find_step_target): Likewise. (find_step_target): Likewise. (cris_software_single_step): Likewise. * ctf.c (ctf_fetch_registers): Likewise. * darwin-nat.c (cancel_breakpoint): Likewise. * fbsd-tdep.c (fbsd_collect_thread_registers): Likewise. * frv-tdep.c (frv_extract_return_value): Likewise. * ft32-tdep.c (ft32_store_return_value): Likewise. (ft32_extract_return_value): Likewise. * go32-nat.c (fetch_register): Likewise. (go32_fetch_registers): Likewise. (go32_store_registers): Likewise. (store_register): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise. (i386_darwin_store_inferior_registers): Likewise. * i386-gnu-nat.c (gnu_fetch_registers): Likewise. (gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (supply_gregset): Likewise. (fill_gregset): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. (i386_linux_resume): Likewise. * i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache): Likewise. * i386-nto-tdep.c (i386nto_supply_gregset): Likewise. * i386-obsd-nat.c (i386obsd_supply_pcb): Likewise. * i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise. (i386obsd_collect_uthread): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. (i386_mpx_bd_base): Likewise. * i386-v4-nat.c (supply_fpregset): Likewise. (fill_fpregset): 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-linux-nat.c (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_registers): Likewise. * ia64-tdep.c (ia64_access_rse_reg): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (find_func_descr): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_registers): Likewise. * infrun.c (use_displaced_stepping): Likewise. (displaced_step_prepare_throw): Likewise. (resume): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (save_infcall_suspend_state): Likewise. (restore_infcall_suspend_state): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Likewise. * jit.c (jit_frame_prev_register): Likewise. * linux-nat.c (save_stop_reason): Likewise. (linux_nat_wait_1): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (record_linux_system_call): Likewise. * linux-tdep.c (linux_collect_thread_registers): Likewise. * lm32-tdep.c (lm32_extract_return_value): Likewise. (lm32_store_return_value): Likewise. * m32c-tdep.c (m32c_read_flg): Likewise. (m32c_pseudo_register_read): Likewise. (m32c_pseudo_register_write): Likewise. * m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_store_return_value): Likewise. (m32r_extract_return_value): Likewise. * m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. * m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise. * m68k-linux-nat.c (fetch_register): Likewise. (old_fetch_inferior_registers): Likewise. (old_store_inferior_registers): Likewise. (store_regs): Likewise. * m68k-tdep.c (m68k_svr4_extract_return_value): Likewise. (m68k_svr4_store_return_value): Likewise. * m88k-tdep.c (m88k_store_arguments): Likewise. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_write_register_values): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise. (mips_fbsd_store_inferior_registers): Likewise. * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise. (mips_fbsd_supply_gregs): Likewise. (mips_fbsd_collect_fpregs): Likewise. (mips_fbsd_collect_gregs): Likewise. (mips_fbsd_supply_fpregset): Likewise. (mips_fbsd_collect_fpregset): Likewise. (mips_fbsd_supply_gregset): Likewise. (mips_fbsd_collect_gregset): Likewise. * mips-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (supply_fpregset): Likewise. (fill_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset): Likewise. (mips_fill_gregset): Likewise. (mips_supply_fpregset): Likewise. (mips_fill_fpregset): Likewise. (mips64_supply_gregset): Likewise. (micromips_linux_sigframe_validate): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise. (mipsnbsd_supply_gregset): Likewise. (mipsnbsd_iterate_over_regset_sections): Likewise. (mipsnbsd_supply_reg): Likewise. (mipsnbsd_supply_fpreg): Likewise. * mips-tdep.c (mips_in_frame_stub): Likewise. (mips_dummy_id): Likewise. (is_octeon_bbit_op): Likewise. (micromips_bc1_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (deal_with_atomic_sequence): Likewise. * moxie-tdep.c (moxie_process_readu): Likewise. * nios2-tdep.c (nios2_get_next_pc): Likewise. * nto-procfs.c (procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise. (ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (fetch_vsx_register): Likewise. (fetch_altivec_register): Likewise. (get_spe_registers): Likewise. (fetch_spe_register): Likewise. (fetch_altivec_registers): Likewise. (fetch_all_gp_regs): Likewise. (fetch_all_fp_regs): Likewise. (store_vsx_register): Likewise. (store_altivec_register): Likewise. (set_spe_registers): Likewise. (store_spe_register): Likewise. (store_altivec_registers): Likewise. (store_all_gp_regs): Likewise. (store_all_fp_regs): Likewise. * ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise. (ppc_linux_collect_gregset): Likewise. (ppc_canonicalize_syscall): Likewise. (ppc_linux_record_signal): Likewise. (ppu2spu_prev_register): Likewise. * ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers): Likewise. (ppc_ravenscar_generic_store_registers): Likewise. * procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers): Likewise. (ravenscar_store_registers): Likewise. (ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers): Likewise. * record-full.c (record_full_wait_1): Likewise. (record_full_registers_change): Likewise. (record_full_store_registers): Likewise. (record_full_core_fetch_registers): Likewise. (record_full_save): Likewise. (record_full_goto_insn): Likewise. * regcache.c (regcache_register_size): Likewise. (get_regcache_arch): Remove. (regcache_read_pc): Likewise. * regcache.h (get_regcache_arch): Remove. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * remote.c (fetch_register_using_p): Likewise. (send_g_packet): Likewise. (remote_prepare_to_store): Likewise. (store_registers_using_G): Likewise. * reverse.c (save_bookmark_command): Likewise. (goto_bookmark_command): Likewise. * rs6000-aix-tdep.c (branch_dest): Likewise. * rs6000-nat.c (rs6000_ptrace64): Likewise. (fetch_register): Likewise. * rs6000-tdep.c (ppc_supply_reg): Likewise. (ppc_collect_reg): Likewise. (ppc_collect_gregset): Likewise. (ppc_collect_fpregset): Likewise. (ppc_collect_vsxregset): Likewise. (ppc_collect_vrregset): Likewise. (ppc_displaced_step_hw_singlestep): Likewise. (rs6000_pseudo_register_read): Likewise. (rs6000_pseudo_register_write): Likewise. * s390-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (s390_linux_fetch_inferior_registers): Likewise. * s390-linux-tdep.c (s390_write_pc): Likewise. (s390_software_single_step): Likewise. (s390_all_but_pc_registers_record): Likewise. (s390_linux_syscall_record): Likewise. * sentinel-frame.c (sentinel_frame_prev_arch): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sh-tdep.c (sh_extract_return_value_nofpu): Likewise. (sh_extract_return_value_fpu): Likewise. (sh_store_return_value_nofpu): Likewise. (sh_corefile_supply_regset): Likewise. (sh_corefile_collect_regset): Likewise. * sh64-tdep.c (sh64_extract_return_value): Likewise. (sh64_store_return_value): Likewise. * sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers): Likewise. (sparc_store_inferior_registers): Likewise. * sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise. (sparc_ravenscar_prepare_to_store): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. (sparc_analyze_control_transfer): Likewise. (sparc_step_trap): Likewise. (sparc_software_single_step): Likewise. (sparc32_gdbarch_init): Likewise. (sparc_supply_rwindow): Likewise. (sparc_collect_rwindow): Likewise. * sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise. (sparc64nbsd_collect_gregset): Likewise. (sparc64nbsd_supply_fpregset): Likewise. (sparc64nbsd_collect_fpregset): Likewise. * sparc64-tdep.c (sparc64_store_arguments): Likewise. (sparc64_supply_gregset): Likewise. (sparc64_collect_gregset): Likewise. (sparc64_supply_fpregset): Likewise. (sparc64_collect_fpregset): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. * spu-tdep.c (spu_unwind_sp): Likewise. (spu2ppu_prev_register): Likewise. (spu_memory_remove_breakpoint): Likewise. * stack.c (return_command): Likewise. * tic6x-tdep.c (tic6x_extract_signed_field): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (trace_save_ctf): Likewise. * windows-nat.c (do_windows_fetch_inferior_registers): Likewise. (do_windows_store_inferior_registers): Likewise. (windows_resume): Likewise. * xtensa-linux-nat.c (fill_gregset): Likewise. (supply_gregset_reg): Likewise. * xtensa-tdep.c (xtensa_register_write_masked): Likewise. (xtensa_register_read_masked): Likewise. (xtensa_supply_gregset): Likewise. (xtensa_extract_return_value): Likewise. (xtensa_store_return_value): Likewise.
2017-10-25 17:37:03 +02:00
struct gdbarch *gdbarch = regcache->arch ();
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (regno != -1)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, regno);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
else
2000-02-15 22:17:04 +01:00
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Write general purpose registers first. */
for (regno = tdep->ppc_gp0_regnum;
regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
regno++)
{
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, regno);
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Write floating point registers. */
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
if (tdep->ppc_fp0_regnum >= 0)
for (regno = 0; regno < ppc_num_fprs; regno++)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, tdep->ppc_fp0_regnum + regno);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Write special registers. */
store_register (regcache, gdbarch_pc_regnum (gdbarch));
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, tdep->ppc_ps_regnum);
store_register (regcache, tdep->ppc_cr_regnum);
store_register (regcache, tdep->ppc_lr_regnum);
store_register (regcache, tdep->ppc_ctr_regnum);
store_register (regcache, tdep->ppc_xer_regnum);
* ppc-tdep.h (struct gdbarch_tdep): Change definition of ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this processor variant lacks those registers. (ppc_floating_point_unit_p): Change description to make it clear that this returns info about the ISA, not the ABI. * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to return true or false by checking tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum. The original code replicated the BFD arch/mach switching done in rs6000_gdbarch_init; it's better to keep that logic there, and just check the results here. (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and tdep->ppc_fpscr_regnum to -1 to indicate that we have no floating-point registers. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_store_return_value): Assert that we have floating-point registers. (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. (rs6000_frame_cache): Don't note the locations at which floating-point registers were saved if we have no fprs. * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP registers. (fetch_regs_user_thread, fetch_regs_kernel_thread) (store_regs_user_thread, store_regs_kernel_thread): Only call supply_fprs / fill_fprs if we actually have floating-point registers. (special_register_p): Check ppc_fpscr_regnum before matching against it. (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't supply / collect fpscr if we don't have it. * ppc-bdm.c: #include "gdb_assert.h". (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we have floating-point registers, since I can't test this code on FP-free systems to adapt it. * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_register): Assert that we have floating-point registers before we reach the code that handles them. (store_register): Same. And use tdep instead of calling gdbarch_tdep again. (fill_fpregset): Don't try to collect FP registers and fpscr if we don't have them. (ppc_linux_sigtramp_cache): Don't record the saved locations of fprs and fpscr if we don't have them. (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we don't have them. * ppcnbsd-nat.c: #include "gdb_assert.h". (getfpregs_supplies): Assert that we have floating-point registers. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppcobsd-tdep.c: #include "gdb_assert.h". (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we have floating-point registers. * rs6000-nat.c (regmap): Don't match against the fpscr and floating point register numbers if they don't exist. (fetch_inferior_registers, store_inferior_registers, fetch_core_registers): Only fetch / store / supply the floating-point registers and the fpscr if we have them. * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) (ppcobsd-tdep.o): Update dependencies.
2004-05-11 06:55:32 +02:00
if (tdep->ppc_fpscr_regnum >= 0)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, tdep->ppc_fpscr_regnum);
if (tdep->ppc_mq_regnum >= 0)
* target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. (target_fetch_registers, target_store_registers): Update. * regcache.c (regcache_raw_read): Replace register_cached by regcache_valid_p. Pass regcache to target_fetch_registers. (regcache_raw_write): Pass regcache to target_store_registers. * arm-linux-nat.c (store_fpregister, store_fpregs, store_register, store_regs, store_wmmx_regs): Replace register_cached by regcache_valid_p. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd): Pass current_regcache to target_fetch_registers calls. * corelow.c (core_open): Likewise. * linux-nat.c (linux_nat_corefile_thread_callback): Likewise. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * win32-nat.c (win32_resume): Likewise. * ia64-tdep.c (ia64_store_return_value): Pass current_regcache to target_store_registers call. * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. * inferior.h (store_inferior_registers): Update prototype. (fetch_inferior_registers): Likewise. * gnu-nat.c (gnu_store_registers, gnu_fetch_registers): Likewise. * mips-linux-nat.c (super_fetch_registers, super_store_registers): Update function pointer signatures. * aix-thread.c (aix_thread_fetch_registers): Add REGCACHE parameter, use it instead of current_regcache, update calls. (aix_thread_store_registers): Likewise. * alphabsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * amd64bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_fpregister, fetch_fpregs, store_fpregister, store_fpregs, fetch_register, fetch_regs, store_register, store_regs, fetch_wmmx_regs, store_wmmx_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * armnbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs, armnbsd_fetch_registers): Likewise. (store_register, store_regs, store_fp_register, store_fp_regs, armnbsd_store_registers): Likewise. * bsd-kvm.c (bsd_kvm_fetch_pcb, bsd_kvm_fetch_registers): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * corelow.c (get_core_registers): Likewise. * go32-nat.c (fetch_register, go32_fetch_registers, store_register, go32_store_registers): Likewise. * hppabsd-nat.c (hppabsd_fetch_registers): Likewise. (hppabsd_store_registers): Likewise. * hppa-hpux-nat.c (hppa_hpux_fetch_register): Likewise. (hppa_hpux_fetch_inferior_registers): Likewise. (hppa_hpux_store_register): Likewise. (hppa_hpux_store_inferior_registers): Likewise. * hppa-linux-nat.c (fetch_register, store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * hpux-thread.c (hpux_thread_fetch_registers): Likewise. (hpux_thread_store_registers): Likewise. * i386bsd-nat.c (i386bsd_fetch_inferior_registers): Likewise. (i386bsd_store_inferior_registers): Likewise. * i386gnu-nat.c (fetch_fpregs, gnu_fetch_registers, store_fpregs, gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register, store_register, fetch_regs, store_regs, fetch_fpregs, store_fpregs, fetch_fpxregs, store_fpxregs): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_register): Likewise. (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_register): Likewise. (ia64_linux_store_registers): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. (inf_child_store_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_register): Likewise. (inf_ptrace_store_registers): Likewise. * infptrace.c (fetch_register, store_register): Likewise. (fetch_inferior_registers, store_inferior_registers): Likewise. * m32r-linux-nat.c (fetch_regs, store_regs): Likewise. (m32r_linux_fetch_inferior_registers): Likewise. (m32r_linux_store_inferior_registers): Likewise. * m68kbsd-nat.c (m68kbsd_fetch_inferior_registers): Likewise. (m68kbsd_store_inferior_registers): Likewise. * m68klinux-nat.c (fetch_register, old_fetch_inferior_registers, store_register, old_store_inferior_registers, fetch_regs, store_regs, fetch_fpregs, store_fpregs): Likewise. (m68k_linux_fetch_inferior_registers): Likewise. (m68k_linux_store_inferior_registers): Likewise. * m88kbsd-nat.c (m88kbsd_fetch_inferior_registers): Likewise. (m88kbsd_store_inferior_registers): Likewise. * mips64obsd-nat.c (mips64obsd_fetch_inferior_registers): Likewise. (mips64obsd_store_inferior_registers): Likewise. * mips-linux-nat.c (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Likewise. (mips64_linux_store_registers): Likewise. * mipsnbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * monitor.c (monitor_fetch_register, monitor_store_register): Likewise. (monitor_fetch_registers, monitor_store_registers): Likewise. * nto-procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register, fetch_register, supply_vrregset, fetch_altivec_registers, fetch_ppc_registers, ppc_linux_fetch_inferior_registers): Likewise. (store_altivec_register, store_spe_register, store_register, fill_vrregset, store_altivec_registers, store_ppc_registers, ppc_linux_store_inferior_registers): Likewise. * ppcnbsd-nat.c (ppcnbsd_fetch_inferior_registers): Likewise. (ppcnbsd_store_inferior_registers): Likewise. * ppcobsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise. * remote.c (fetch_register_using_p, process_g_packet, fetch_registers_using_g, remote_fetch_registers): Likewise. (store_register_using_P, store_registers_using_G, remote_store_registers): Likewise. * remote-m32r-sdi.c (m32r_fetch_registers, m32r_fetch_register, m32r_store_register, m32r_store_register): Likewise. * remote-mips.c (mips_fetch_registers, mips_store_registers): Likewise. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * rs6000-nat.c (fetch_register, store_register): Likewise. (rs6000_fetch_inferior_registers): Likewise. (rs6000_store_inferior_registers): Likewise. * s390-nat.c (fetch_regs, store_regs): Likewise. (fetch_fpregs, store_fpregs): Likewise. (s390_linux_fetch_inferior_registers): Likewise. (s390_linux_store_inferior_registers): Likewise. * shnbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sol-thread.c (sol_thread_fetch_registers): Likewise. (sol_thread_store_registers): Likewise. * sparc-nat.c (fetch_inferior_registers): Likewise. (store_inferior_registers): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. (spu_store_inferior_registers): Likewise. * target.c (debug_print_register): Likewise. (debug_to_fetch_registers, debug_to_store_registers): Likewise. * vaxbsd-nat.c (vaxbsd_fetch_inferior_registers): Likewise. (vaxbsd_store_inferior_registers): Likewise. * win32-nat.c (do_win32_fetch_inferior_registers): Likewise. (win32_fetch_inferior_registers): Likewise. (win32_store_inferior_registers): Likewise.
2007-05-06 16:34:38 +02:00
store_register (regcache, tdep->ppc_mq_regnum);
2000-02-15 22:17:04 +01:00
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
}
2000-02-15 22:17:04 +01:00
/* Implement the to_xfer_partial target_ops method. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
static enum target_xfer_status
rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
const char *annex, gdb_byte *readbuf,
const gdb_byte *writebuf,
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
pid_t pid = ptid_get_pid (inferior_ptid);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
int arch64 = ARCH64 ();
switch (object)
{
case TARGET_OBJECT_LIBRARIES_AIX:
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
return rs6000_xfer_shared_libraries (ops, object, annex,
readbuf, writebuf,
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
offset, len, xfered_len);
case TARGET_OBJECT_MEMORY:
{
union
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
PTRACE_TYPE_RET word;
gdb_byte byte[sizeof (PTRACE_TYPE_RET)];
} buffer;
ULONGEST rounded_offset;
LONGEST partial_len;
/* Round the start offset down to the next long word
boundary. */
rounded_offset = offset & -(ULONGEST) sizeof (PTRACE_TYPE_RET);
/* Since ptrace will transfer a single word starting at that
rounded_offset the partial_len needs to be adjusted down to
that (remember this function only does a single transfer).
Should the required length be even less, adjust it down
again. */
partial_len = (rounded_offset + sizeof (PTRACE_TYPE_RET)) - offset;
if (partial_len > len)
partial_len = len;
if (writebuf)
{
/* If OFFSET:PARTIAL_LEN is smaller than
ROUNDED_OFFSET:WORDSIZE then a read/modify write will
be needed. Read in the entire word. */
if (rounded_offset < offset
|| (offset + partial_len
< rounded_offset + sizeof (PTRACE_TYPE_RET)))
{
/* Need part of initial word -- fetch it. */
if (arch64)
buffer.word = rs6000_ptrace64 (PT_READ_I, pid,
rounded_offset, 0, NULL);
else
buffer.word = rs6000_ptrace32 (PT_READ_I, pid,
(int *) (uintptr_t)
rounded_offset,
0, NULL);
}
/* Copy data to be written over corresponding part of
buffer. */
memcpy (buffer.byte + (offset - rounded_offset),
writebuf, partial_len);
errno = 0;
if (arch64)
rs6000_ptrace64 (PT_WRITE_D, pid,
rounded_offset, buffer.word, NULL);
else
rs6000_ptrace32 (PT_WRITE_D, pid,
(int *) (uintptr_t) rounded_offset,
buffer.word, NULL);
if (errno)
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
return TARGET_XFER_EOF;
}
if (readbuf)
{
errno = 0;
if (arch64)
buffer.word = rs6000_ptrace64 (PT_READ_I, pid,
rounded_offset, 0, NULL);
else
buffer.word = rs6000_ptrace32 (PT_READ_I, pid,
(int *)(uintptr_t)rounded_offset,
0, NULL);
if (errno)
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
return TARGET_XFER_EOF;
/* Copy appropriate bytes out of the buffer. */
memcpy (readbuf, buffer.byte + (offset - rounded_offset),
partial_len);
}
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
*xfered_len = (ULONGEST) partial_len;
return TARGET_XFER_OK;
}
default:
Replace -1 with TARGET_XFER_E_IO Hi, This patch replaces -1 with TARGET_XFER_E_IO in the implementations of to_xfer_partial and their callees. This change is quite mechanical, and makes the next patch shorter. gdb: 2014-02-07 Yao Qi <yao@codesourcery.com> * auxv.c (procfs_xfer_auxv): Replace -1 with TARGET_XFER_E_IO. (ld_so_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. (darwin_xfer_partial): Likewise. * exec.c (exec_xfer_partial): Likewise. * gnu-nat.c (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_uregs): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo): Likewise. (linux_proc_xfer_spu): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_qxfer): Likewise. (remote_write_qxfer, remote_read_qxfer): Likewise. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. (spu_xfer_partial): Likewise. * target.c (memory_xfer_partial_1): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise.
2014-01-27 10:32:33 +01:00
return TARGET_XFER_E_IO;
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
}
}
/* Wait for the child specified by PTID to do something. Return the
process ID of the child, or MINUS_ONE_PTID in case of error; store
the status in *OURSTATUS. */
static ptid_t
* linux-nat.c (linux_nat_wait): Adjust. (linux_nat_pid_to_str): Adjust. Remove call to thread_db_init. * linux-nat.h (thread_db_init): Delete declaration. * linux-thread-db.c (target_beneath): Delete. (thread_db_init): Delete. (thread_db_detach): Use find_target_beneath. (thread_db_wait): Adjust interface. Use find_target_beneath. (thread_db_mourn_inferior): Use find_target_beneath. (thread_db_can_async_p, thread_db_is_async_p, thread_db_async) (thread_db_async_mask): Delete. (thread_db_pid_to_str): Adjust interface. Use find_target_beneath. (thread_db_get_thread_local_address): Adjust interface. Use find_target_beneath. (init_thread_db_ops): Delete references to delete functions. * target.c (update_current_target): Don't inherit or default to_wait. Don't inherit to_pid_to_str and to_get_thread_local_address. (target_translate_tls_address): Look for a pushed target that implements to_get_thread_local_address, and use it instead of checking for target_get_thread_local_address_p. (target_wait, target_pid_to_str): Reimplement as functions. (dummy_pid_to_str): New. (init_dummy_target): Register it. (debug_to_wait): Delete. * target.h (struct target_ops): Make to_wait, to_pid_to_str and to_get_thread_local_address accept a pointer to struct target_ops. (target_wait): Delete macro, and declare as function. (target_pid_to_str): Likewise. (target_get_thread_local_address) (target_get_thread_local_address_p): Delete. (noprocess): Add NORETURN and ATTR_NORETURN tags. * inf-ptrace.c (inf_ptrace_wait): Adjust. (inf_ptrace_pid_to_str): New. (inf_ptrace_target): Use inf_ptrace_pid_to_str. * aix-thread.c (aix_thread_wait, aix_thread_pid_to_str): Adjust. * bsd-kvm.c (bsd_kvm_pid_to_str): Adjust. * bsd-uthread.c (bsd_uthread_wait, bsd_uthread_pid_to_str): Adjust. * corelow.c (core_pid_to_str): Adjust. * darwin-nat.c (darwin_wait, darwin_pid_to_str): Adjust. * dec-thread.c (dec_thread_wait, dec_thread_pid_to_str): Adjust. * gnu-nat.c (gnu_wait, gnu_pid_to_str): Adjust. * go32-nat.c (go32_wait, go32_pid_to_str): Adjust. * hpux-thread.c (hpux_thread_wait): Adjust. * inf-ttrace.c (inf_ttrace_wait, inf_ttrace_pid_to_str): Adjust. * monitor.c (monitor_wait, monitor_pid_to_str): Adjust. * nto-procfs.c (procfs_wait, procfs_pid_to_str): Adjust. * procfs.c (procfs_pid_to_str): Adjust. * remote-m32r-sdi.c (m32r_wait, m32r_pid_to_str): Adjust. * remote-mips.c (mips_wait): Adjust. * remote-sim.c (gdbsim_wait, gdbsim_pid_to_str): Adjust. * remote.c (remote_wait, remote_pid_to_str) (remote_get_thread_local_address): Adjust. * rs6000-nat.c (rs6000_wait): Adjust. * sol-thread.c (procfs_pid_to_str): Adjust declaration. (sol_thread_wait, solaris_pid_to_str): Adjust. * spu-linux-nat.c (spu_child_wait): Adjust. * windows-nat.c (windows_wait, windows_pid_to_str): Adjust.
2009-02-06 23:21:26 +01:00
rs6000_wait (struct target_ops *ops,
* target.h (TARGET_WNOHANG): New. * target.c (target_wait): Add `options' argument. Adjust. (struct target_ops) <to_wait>: Add `options' argument. (target_wait): Add `options' argument. * infrun.c (wait_for_inferior): Pass 0 as options to target_wait (blocking wait). (fetch_inferior_event): Pass TARGET_WNOHANG as options to target_wait. * fork-child.c (startup_inferior): Pass 0 as options to target_wait (blocking wait). * linux-nat.c (linux_nat_create_inferior): Remove async masking. (linux_nat_wait_1): Add `target_options' argument. Use it instead of checking on target_can_async_p. (linux_nat_wait): Add `target_options' argument. Adjust. * remote.c (remote_wait_ns): Add `options' argument. Adjust to check on TARGET_WNOWAIT instead of checking on remote_is_async_p. (remote_wait_as): Add `options' argument. Adjust to check on TARGET_WNOWAIT instead of checking on remote_is_async_p. If doing a blocking wait, keep waiting until an interesting event comes out. (remote_wait): Add `options' argument. Don't loop here if the target is in async mode, and a blocking wait has been requested. * top.c (deprecated_target_wait_hook): Add `options' argument. * linux-thread-db.c (thread_db_wait): Add `options' argument, and pass it down to the layer beneath. * inf-ptrace.c (inf_ptrace_wait): Add `options' argument. * record.c (record_beneath_to_wait): Add `options' argument. (record_wait): Add `options' argument, and pass it down to the layer beneath. * bsd-uthread.c (bsd_uthread_wait): Add `options' argument. * darwin-nat.c (darwin_wait): Likewise. * defs.h (deprecated_target_wait_hook): Likewise. * gnu-nat.c (gnu_wait): Add `options' argument. * go32-nat.c (go32_wait): Likewise. * hpux-thread.c (hpux_thread_wait): Add `options' argument, and pass it down to the layer beneath. * inf-ttrace.c (inf_ttrace_wait): Add `options' argument. * monitor.c (monitor_wait): Likewise. * nto-procfs.c (procfs_wait): Likewise. * remote-mips.c (mips_wait): Add `options' argument. * remote-sim.c (gdbsim_wait): Likewise. * rs6000-nat.c (rs6000_wait): Add `options' argument. * sol-thread.c (sol_thread_wait): Add `options' argument, and pass it down to the layer beneath. * spu-linux-nat.c (spu_child_wait): Add `options' argument. * windows-nat.c (windows_wait): Likewise. * tui/tui-hooks.c (tui_target_wait_hook): Likewise. Adjust.
2009-05-21 17:48:42 +02:00
ptid_t ptid, struct target_waitstatus *ourstatus, int options)
{
pid_t pid;
int status, save_errno;
do
{
set_sigint_trap ();
do
{
pid = waitpid (ptid_get_pid (ptid), &status, 0);
save_errno = errno;
}
while (pid == -1 && errno == EINTR);
clear_sigint_trap ();
if (pid == -1)
{
fprintf_unfiltered (gdb_stderr,
_("Child process unexpectedly missing: %s.\n"),
safe_strerror (save_errno));
/* Claim it exited with unknown signal. */
ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. include/gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 * gdb/signals.def: Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/arm/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/avr/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/common/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/cr16/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/d10v/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/erc32/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/m32c/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/ppc/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rl78/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rx/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
2012-05-24 18:51:47 +02:00
ourstatus->value.sig = GDB_SIGNAL_UNKNOWN;
return inferior_ptid;
}
/* Ignore terminated detached child processes. */
if (!WIFSTOPPED (status) && pid != ptid_get_pid (inferior_ptid))
pid = -1;
}
while (pid == -1);
/* AIX has a couple of strange returns from wait(). */
/* stop after load" status. */
if (status == 0x57c)
ourstatus->kind = TARGET_WAITKIND_LOADED;
/* signal 0. I have no idea why wait(2) returns with this status word. */
else if (status == 0x7f)
ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
/* A normal waitstatus. Let the usual macros deal with it. */
else
store_waitstatus (ourstatus, status);
return pid_to_ptid (pid);
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
/* Set the current architecture from the host running GDB. Called when
starting a child process. */
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
C++-fy and prepare for sharing fork_inferior As a preparation for the next patch, which will move fork_inferior from GDB to common/ (and therefore share it with gdbserver), it is interesting to convert a few functions to C++. This patch touches functions related to parsing command-line arguments to the inferior (see gdb/fork-child.c:breakup_args), the way the arguments are stored on fork_inferior (using std::vector instead of char **), and the code responsible for dealing with argv also on gdbserver. I've taken this opportunity and decided to constify a few arguments to fork_inferior/create_inferior as well, in order to make the code cleaner. And now, on gdbserver, we're using xstrdup everywhere and aren't checking for memory allocation failures anymore, as requested by Pedro: <https://sourceware.org/ml/gdb-patches/2017-03/msg00191.html> Message-Id: <025ebdb9-90d9-d54a-c055-57ed2406b812@redhat.com> Pedro Alves wrote: > On the "== NULL" check: IIUC, the old NULL check was there to > handle strdup returning NULL due to out-of-memory. > See NULL checks and comments further above in this function. > Now that you're using a std::vector, that doesn't work or make > sense any longer, since if push_back fails to allocate space for > its internal buffer (with operator new), our operator new replacement > (common/new-op.c) calls malloc_failure, which aborts gdbserver. > > Not sure it makes sense to handle out-of-memory specially in > the gdb/rsp-facing functions nowadays (maybe git blame/log/patch > submission for that code shows some guidelines). Maybe (or, probably) > it's OK to stop caring about it, but then we should consistently remove > left over code, by using xstrdup instead and remove the NULL checks. IMO this refactoring was very good to increase the readability of the code as well, because some parts of the argument handling were unnecessarily confusing before. gdb/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * common/common-utils.c (free_vector_argv): New function. * common/common-utils.h: Include <vector>. (free_vector_argv): New prototype. * darwin-nat.c (darwin_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * fork-child.c: Include <vector>. (breakup_args): Rewrite function, using C++. (fork_inferior): Rewrite function header, constify "exec_file_arg" and accept "std::string" for "allargs". Update the code to calculate "argv" based on "allargs". Update calls to "exec_fun" and "execvp". * gnu-nat.c (gnu_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * go32-nat.c (go32_create_inferior): Likewise. * inf-ptrace.c (inf_ptrace_create_inferior): Likewise. * infcmd.c (run_command_1): Constify "exec_file". Use "std::string" for inferior arguments. * inferior.h (fork_inferior): Update prototype. * linux-nat.c (linux_nat_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * nto-procfs.c (procfs_create_inferior): Likewise. * procfs.c (procfs_create_inferior): Likewise. * remote-sim.c (gdbsim_create_inferior): Likewise. * remote.c (extended_remote_run): Update code to accept "std::string" as argument. (extended_remote_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * rs6000-nat.c (super_create_inferior): Likewise. (rs6000_create_inferior): Likewise. * target.h (struct target_ops) <to_create_inferior>: Likewise. * windows-nat.c (windows_create_inferior): Likewise. gdb/gdbserver/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * server.c: Include <vector>. <program_argv, wrapper_argv>: Convert to std::vector. (start_inferior): Rewrite function to use C++. (handle_v_run): Likewise. Update code that calculates the argv based on the vRun packet; use C++. (captured_main): Likewise.
2017-03-23 02:54:49 +01:00
static void (*super_create_inferior) (struct target_ops *,
const char *exec_file,
const std::string &allargs,
char **env, int from_tty);
static void
C++-fy and prepare for sharing fork_inferior As a preparation for the next patch, which will move fork_inferior from GDB to common/ (and therefore share it with gdbserver), it is interesting to convert a few functions to C++. This patch touches functions related to parsing command-line arguments to the inferior (see gdb/fork-child.c:breakup_args), the way the arguments are stored on fork_inferior (using std::vector instead of char **), and the code responsible for dealing with argv also on gdbserver. I've taken this opportunity and decided to constify a few arguments to fork_inferior/create_inferior as well, in order to make the code cleaner. And now, on gdbserver, we're using xstrdup everywhere and aren't checking for memory allocation failures anymore, as requested by Pedro: <https://sourceware.org/ml/gdb-patches/2017-03/msg00191.html> Message-Id: <025ebdb9-90d9-d54a-c055-57ed2406b812@redhat.com> Pedro Alves wrote: > On the "== NULL" check: IIUC, the old NULL check was there to > handle strdup returning NULL due to out-of-memory. > See NULL checks and comments further above in this function. > Now that you're using a std::vector, that doesn't work or make > sense any longer, since if push_back fails to allocate space for > its internal buffer (with operator new), our operator new replacement > (common/new-op.c) calls malloc_failure, which aborts gdbserver. > > Not sure it makes sense to handle out-of-memory specially in > the gdb/rsp-facing functions nowadays (maybe git blame/log/patch > submission for that code shows some guidelines). Maybe (or, probably) > it's OK to stop caring about it, but then we should consistently remove > left over code, by using xstrdup instead and remove the NULL checks. IMO this refactoring was very good to increase the readability of the code as well, because some parts of the argument handling were unnecessarily confusing before. gdb/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * common/common-utils.c (free_vector_argv): New function. * common/common-utils.h: Include <vector>. (free_vector_argv): New prototype. * darwin-nat.c (darwin_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * fork-child.c: Include <vector>. (breakup_args): Rewrite function, using C++. (fork_inferior): Rewrite function header, constify "exec_file_arg" and accept "std::string" for "allargs". Update the code to calculate "argv" based on "allargs". Update calls to "exec_fun" and "execvp". * gnu-nat.c (gnu_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * go32-nat.c (go32_create_inferior): Likewise. * inf-ptrace.c (inf_ptrace_create_inferior): Likewise. * infcmd.c (run_command_1): Constify "exec_file". Use "std::string" for inferior arguments. * inferior.h (fork_inferior): Update prototype. * linux-nat.c (linux_nat_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * nto-procfs.c (procfs_create_inferior): Likewise. * procfs.c (procfs_create_inferior): Likewise. * remote-sim.c (gdbsim_create_inferior): Likewise. * remote.c (extended_remote_run): Update code to accept "std::string" as argument. (extended_remote_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * rs6000-nat.c (super_create_inferior): Likewise. (rs6000_create_inferior): Likewise. * target.h (struct target_ops) <to_create_inferior>: Likewise. * windows-nat.c (windows_create_inferior): Likewise. gdb/gdbserver/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * server.c: Include <vector>. <program_argv, wrapper_argv>: Convert to std::vector. (start_inferior): Rewrite function to use C++. (handle_v_run): Likewise. Update code that calculates the argv based on the vRun packet; use C++. (captured_main): Likewise.
2017-03-23 02:54:49 +01:00
rs6000_create_inferior (struct target_ops * ops, const char *exec_file,
const std::string &allargs, char **env, int from_tty)
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
{
enum bfd_architecture arch;
unsigned long mach;
bfd abfd;
struct gdbarch_info info;
Kill pthread_ops_hack * target.h (struct target_ops): Make to_attach, to_detach, to_create_inferior and to_mourn_inferior accept a pointer to struct target_ops. (target_attach, target_create_inferior, target_create_inferior): Convert from macros to function. Find the right target to invoke a method of. (find_default_attach, find_default_create_inferior): New parameter ops. * corefile.c (core_file_command): Pass target to to_detach. * corelow.c (core_detach): Add 'ops' parameter. * fork-child.c (fork_inferior): Return the pid. Allow init_trace_fun to be NULL. * inf-ptrace (ptrace_ops_hack): Remove. (inf_ptrace_him): Remove, moving all logic into.... (inf_ptrace_create_inferior): ... here. Push the target passed as parameter. (inf_ptrace_mourn_inferior, inf_ptrace_attach, inf_ptrace_detach): Push/pop target passed as parameter, no ptrace_ops_hack. (inf_ptrace_target): Don't remember result. * inferior.h (fork_inferior): Adjust prototype. * linux-nat.c (linux_nat_create_inferior, linux_nat_attach) (linux_nat_detach, linux_nat_mourn_inferior): New parameter ops. Pass it to linux_ops target. * linux-thread-db.c (thread_db_detach, thread_db_mourn_inferior): New parameter ops. Pass it to the target beneath. * remote.c (remote_mourn, extended_remote_mourn, remote_detach) (extended_remote_create_inferior): New parameter ops. Pass it further. * target.c (debug_to_attach, debug_to_detach) (debug_to_mourn_inferior): New parameter ops. (target_create_inferior): New. (update_current_target): Do not inherit to_attach, to_detach, to_create_inferiour, to_mourn_inferior. Do not default to_detach and to_mourn_inferior. (target_detach): Find the right target to use. (target_mourn_inferior): New. (find_default_attach, find_default_create_inferior): New parameter ops. Pass the found target when calling its method. (init_dummy_target): Provide fallback definition of to_detach. (target_attach): New. (debug_to_attach, debug_to_detach, debug_to_create_inferior) (debug_to_mourn_inferiour): New parameter ops. * aix-thread.c: Adjust. * bsd-uthread.c: Adjust. * gnu-nat.c: Adjust. * go32-nat.c: Adjust. * hpux-thread.c: Adjust. * inf-ttrace.c: Ajust. * monitor.c: Adjust. * nto-procfs.c: Adjust. * procfs.c: Adjust. * remote-m32r-sdi.c: Adjust. * remote-mips.c: Adjust. * remote-sim.c: Adjust. * rs6000-nat.c: Adjust. * sol-thread.c: Adjust. * win32-nat.c: Adjust. * dec-thread.c: Adjust.
2008-11-09 12:27:18 +01:00
super_create_inferior (ops, exec_file, allargs, env, from_tty);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (__power_rs ())
{
arch = bfd_arch_rs6000;
mach = bfd_mach_rs6k;
}
else
{
arch = bfd_arch_powerpc;
mach = bfd_mach_ppc;
}
/* FIXME: schauer/2002-02-25:
We don't know if we are executing a 32 or 64 bit executable,
and have no way to pass the proper word size to rs6000_gdbarch_init.
So we have to avoid switching to a new architecture, if the architecture
matches already.
Blindly calling rs6000_gdbarch_init used to work in older versions of
GDB, as rs6000_gdbarch_init incorrectly used the previous tdep to
determine the wordsize. */
if (exec_bfd)
{
const struct bfd_arch_info *exec_bfd_arch_info;
exec_bfd_arch_info = bfd_get_arch_info (exec_bfd);
if (arch == exec_bfd_arch_info->arch)
return;
}
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
bfd_default_set_arch_mach (&abfd, arch, mach);
gdbarch_info_init (&info);
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
info.bfd_arch_info = bfd_get_arch_info (&abfd);
info.abfd = exec_bfd;
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
if (!gdbarch_update_p (info))
2005-02-11 Andrew Cagney <cagney@gnu.org> Mark up error_no_arg, query, perror_with_name, complaint, and internal_error. * breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update. * cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update. * dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update. * exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update. * frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update. * gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update. * go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update. * i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update. * i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update. * infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update. * interps.c, language.c, linespec.c, linux-nat.c: Update. * m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update. * m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update. * macrotab.c, maint.c, mdebugread.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update. * mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update. * objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update. * parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update. * ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update. * regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update. * remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update. * s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update. * sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update. * solib-aix5.c, solib-svr4.c, solib.c, source.c: Update. * sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update. * symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update. * utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update. * win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update. * cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update. * cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update. * mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update. * tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 19:13:55 +01:00
internal_error (__FILE__, __LINE__,
_("rs6000_create_inferior: failed "
"to select architecture"));
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
}
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
/* Shared Object support. */
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
/* Return the LdInfo data for the given process. Raises an error
if the data could not be obtained.
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
The returned value must be deallocated after use. */
ppc-aix core file relocation. The current code attempts to provide relocation support when debugging core files via the rs6000_xfer_partial method of the rs6000-nat target_ops vector. However, this target_ops vector does not get pushed on the target stack at all when debugging core files, thus bypassing completely that part of the code. This patch fixes the problem by extending corelow's core_xfer_partial into handling the TARGET_OBJECT_LIBRARIES_AIX object. gdb/ChangeLog: * gdbarch.sh (core_xfer_shared_libraries_aix): New method. * gdbarch.h, gdbarch.c: Regenerate. * corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX handling. * rs6000-aix-tdep.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h. * rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and "xml-utils.h". (struct field_info, struct ld_info_desc): New types. (ld_info32_desc, ld_info64_desc): New static constants. (struct ld_info): New type. (rs6000_aix_extract_ld_info): New function. (rs6000_aix_shared_library_to_xml): Likewise. (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. (rs6000_aix_init_osabi): Add call to set_gdbarch_core_xfer_shared_libraries_aix. * rs6000-nat.c: Add "rs6000-aix-tdep.h" include. Remove "xml-utils.h" include. (LdInfo): Delete typedef. (ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME): Delete macros. (rs6000_ptrace_ldinfo): Change return type to gdb_byte *. Adjust code accordingly. (rs6000_core_ldinfo): Delete, folded into rs6000_aix_core_xfer_shared_libraries_aix. (rs6000_xfer_shared_library): Delete. (rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 14:26:14 +02:00
static gdb_byte *
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
rs6000_ptrace_ldinfo (ptid_t ptid)
{
const int pid = ptid_get_pid (ptid);
int ldi_size = 1024;
Fix AIX gdb build with C++ compiler We currently get: ../../src/gdb/aix-thread.c: In function 'int pdc_read_data(pthdb_user_t, void*, pthdb_addr_t, size_t)': ../../src/gdb/aix-thread.c:465:46: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] status = target_read_memory (addr, buf, len); ^ ../../src/gdb/aix-thread.c: In function 'void aix_thread_resume(target_ops*, ptid_t, int, gdb_signal)': ../../src/gdb/aix-thread.c:1010:46: error: invalid conversion from 'void*' to 'int*' [-fpermissive] gdb_signal_to_host (sig), (void *) tid); ^ ../../src/gdb/aix-thread.c:243:1: error: initializing argument 5 of 'int ptrace64aix(int, int, long long int, int, int*)' [-fpermissive] ptrace64aix (int req, int id, long long addr, int data, int *buf) ../../src/gdb/rs6000-nat.c: In function 'gdb_byte* rs6000_ptrace_ldinfo(ptid_t)': ../../src/gdb/rs6000-nat.c:596:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] gdb_byte *ldi = xmalloc (ldi_size); ^ ../../src/gdb/rs6000-nat.c:615:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] ldi = xrealloc (ldi, ldi_size); ^ (and more instances of the same). gdb/ChangeLog: 2016-04-21 Pedro Alves <palves@redhat.com> * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. (aix_thread_resume): Use PTRACE_TYPE_ARG5. * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void pointer, and cast return to gdb_byte pointer.
2016-04-21 15:02:20 +02:00
void *ldi = xmalloc (ldi_size);
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
int rc = -1;
* rs6000-tdep.c: Changes throughout for multi-arch 64-bit support. Incorporate most of tm-rs6000.h. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. (read_memory_addr): Define. (pop_frame): Rename to rs6000_pop_frame. (rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments, rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic dummy frame handling. (branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain, rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead of read_memory_integer. (branch_dest, rs6000_pop_frame, rs6000_push_arguments, rs6000_skip_trampoline_code, rs6000_frame_saved_pc, frame_get_saved_regs, frame_initial_stack_address, rs6000_frame_chain): Replace 4 with TDEP->wordsize. (skip_prologue): Recognize some 64-bit stack adjustments. (push_dummy_frame, pop_dummy_frame, set_processor, show_processor): Delete. (frame_get_saved_regs): Manipulate saved register addresses using CORE_ADDR instead of int. (rs6000_create_inferior): New function. (register_names_*[]): Change to struct reg registers_*[]. (variants[]): Assimilate into multi-arch approach. (register_names_*[], variants[]): Refer to pre-PowerPC architectures as POWER instead of RS6000. * rs6000-nat.c: Ubiquitous changes for 64-bit support. (vmap_secs, xcoff_relocate_symtab): Cast addresses to unsigned long to avoid sign-extension errors. (set_host_arch): New function. (xcoff_relocate_symtab): Try disabling usleep(36000) workaround. (rs6000_core_fns): Use new bfd_target_xcoff_flavour. (_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook. * symfile.c (find_sym_fns): Remove special xcoff kludge. * xcoffread.c (secnum_to_bfd_section): Initialize args.objfile. (process_linenos): Query line struct size from coff backend instead of using compile-time constant. (enter_line_range): Likewise. (read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to record_debugformat() if appropriate. (process_xcoff_symbol): Access symbol addresses using SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE. (read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl. (scan_xcoff_symtab): Likewise. Query syment struct size from coff backend instead of using compile-time constant. (xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour. * Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags that this Makefile variable get set to. (From Kevin Buettner.) * config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that the TOC doesn't overflow. (From Kevin Buettner.) * config/powerpc/tm-ppc-aix.h: Move config decisions to multi-arched rs6000-tdep.c. * config/rs6000/tm-rs6000.h: Likewise. (GDB_MULTI_ARCH): Define. (skip_trampoline_code): Rename to rs6000_skip_trampoline_code. (is_magic_function_pointer): Replace with rs6000_convert_from_func_ptr_addr. (TARGET_CREATE_INFERIOR_HOOK): Define. (find_toc_address_hook): Rename to rs6000_find_toc_address_hook. (rs6000_set_host_arch_hook): Declare. * config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
2000-06-16 23:02:22 +02:00
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
while (1)
{
if (ARCH64 ())
rc = rs6000_ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, ldi_size,
NULL);
else
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
rc = rs6000_ptrace32 (PT_LDINFO, pid, (int *) ldi, ldi_size, NULL);
if (rc != -1)
break; /* Success, we got the entire ld_info data. */
if (errno != ENOMEM)
perror_with_name (_("ptrace ldinfo"));
/* ldi is not big enough. Double it and try again. */
ldi_size *= 2;
ldi = xrealloc (ldi, ldi_size);
}
Fix AIX gdb build with C++ compiler We currently get: ../../src/gdb/aix-thread.c: In function 'int pdc_read_data(pthdb_user_t, void*, pthdb_addr_t, size_t)': ../../src/gdb/aix-thread.c:465:46: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] status = target_read_memory (addr, buf, len); ^ ../../src/gdb/aix-thread.c: In function 'void aix_thread_resume(target_ops*, ptid_t, int, gdb_signal)': ../../src/gdb/aix-thread.c:1010:46: error: invalid conversion from 'void*' to 'int*' [-fpermissive] gdb_signal_to_host (sig), (void *) tid); ^ ../../src/gdb/aix-thread.c:243:1: error: initializing argument 5 of 'int ptrace64aix(int, int, long long int, int, int*)' [-fpermissive] ptrace64aix (int req, int id, long long addr, int data, int *buf) ../../src/gdb/rs6000-nat.c: In function 'gdb_byte* rs6000_ptrace_ldinfo(ptid_t)': ../../src/gdb/rs6000-nat.c:596:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] gdb_byte *ldi = xmalloc (ldi_size); ^ ../../src/gdb/rs6000-nat.c:615:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] ldi = xrealloc (ldi, ldi_size); ^ (and more instances of the same). gdb/ChangeLog: 2016-04-21 Pedro Alves <palves@redhat.com> * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. (aix_thread_resume): Use PTRACE_TYPE_ARG5. * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void pointer, and cast return to gdb_byte pointer.
2016-04-21 15:02:20 +02:00
return (gdb_byte *) ldi;
}
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
/* Implement the to_xfer_partial target_ops method for
TARGET_OBJECT_LIBRARIES_AIX objects. */
1999-09-28 23:55:21 +02:00
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
static enum target_xfer_status
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
rs6000_xfer_shared_libraries
(struct target_ops *ops, enum target_object object,
const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf,
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
{
ppc-aix core file relocation. The current code attempts to provide relocation support when debugging core files via the rs6000_xfer_partial method of the rs6000-nat target_ops vector. However, this target_ops vector does not get pushed on the target stack at all when debugging core files, thus bypassing completely that part of the code. This patch fixes the problem by extending corelow's core_xfer_partial into handling the TARGET_OBJECT_LIBRARIES_AIX object. gdb/ChangeLog: * gdbarch.sh (core_xfer_shared_libraries_aix): New method. * gdbarch.h, gdbarch.c: Regenerate. * corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX handling. * rs6000-aix-tdep.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h. * rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and "xml-utils.h". (struct field_info, struct ld_info_desc): New types. (ld_info32_desc, ld_info64_desc): New static constants. (struct ld_info): New type. (rs6000_aix_extract_ld_info): New function. (rs6000_aix_shared_library_to_xml): Likewise. (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. (rs6000_aix_init_osabi): Add call to set_gdbarch_core_xfer_shared_libraries_aix. * rs6000-nat.c: Add "rs6000-aix-tdep.h" include. Remove "xml-utils.h" include. (LdInfo): Delete typedef. (ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME): Delete macros. (rs6000_ptrace_ldinfo): Change return type to gdb_byte *. Adjust code accordingly. (rs6000_core_ldinfo): Delete, folded into rs6000_aix_core_xfer_shared_libraries_aix. (rs6000_xfer_shared_library): Delete. (rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 14:26:14 +02:00
gdb_byte *ldi_buf;
ULONGEST result;
struct cleanup *cleanup;
/* This function assumes that it is being run with a live process.
Core files are handled via gdbarch. */
gdb_assert (target_has_execution);
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
if (writebuf)
Replace -1 with TARGET_XFER_E_IO Hi, This patch replaces -1 with TARGET_XFER_E_IO in the implementations of to_xfer_partial and their callees. This change is quite mechanical, and makes the next patch shorter. gdb: 2014-02-07 Yao Qi <yao@codesourcery.com> * auxv.c (procfs_xfer_auxv): Replace -1 with TARGET_XFER_E_IO. (ld_so_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. (darwin_xfer_partial): Likewise. * exec.c (exec_xfer_partial): Likewise. * gnu-nat.c (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_uregs): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo): Likewise. (linux_proc_xfer_spu): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_qxfer): Likewise. (remote_write_qxfer, remote_read_qxfer): Likewise. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. (spu_xfer_partial): Likewise. * target.c (memory_xfer_partial_1): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise.
2014-01-27 10:32:33 +01:00
return TARGET_XFER_E_IO;
1999-07-07 22:19:36 +02:00
ppc-aix core file relocation. The current code attempts to provide relocation support when debugging core files via the rs6000_xfer_partial method of the rs6000-nat target_ops vector. However, this target_ops vector does not get pushed on the target stack at all when debugging core files, thus bypassing completely that part of the code. This patch fixes the problem by extending corelow's core_xfer_partial into handling the TARGET_OBJECT_LIBRARIES_AIX object. gdb/ChangeLog: * gdbarch.sh (core_xfer_shared_libraries_aix): New method. * gdbarch.h, gdbarch.c: Regenerate. * corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX handling. * rs6000-aix-tdep.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h. * rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and "xml-utils.h". (struct field_info, struct ld_info_desc): New types. (ld_info32_desc, ld_info64_desc): New static constants. (struct ld_info): New type. (rs6000_aix_extract_ld_info): New function. (rs6000_aix_shared_library_to_xml): Likewise. (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. (rs6000_aix_init_osabi): Add call to set_gdbarch_core_xfer_shared_libraries_aix. * rs6000-nat.c: Add "rs6000-aix-tdep.h" include. Remove "xml-utils.h" include. (LdInfo): Delete typedef. (ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME): Delete macros. (rs6000_ptrace_ldinfo): Change return type to gdb_byte *. Adjust code accordingly. (rs6000_core_ldinfo): Delete, folded into rs6000_aix_core_xfer_shared_libraries_aix. (rs6000_xfer_shared_library): Delete. (rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 14:26:14 +02:00
ldi_buf = rs6000_ptrace_ldinfo (inferior_ptid);
gdb_assert (ldi_buf != NULL);
cleanup = make_cleanup (xfree, ldi_buf);
result = rs6000_aix_ld_info_to_xml (target_gdbarch (), ldi_buf,
readbuf, offset, len, 1);
xfree (ldi_buf);
Reimplement shared library support on ppc-aix... ... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
2013-05-06 16:15:50 +02:00
ppc-aix core file relocation. The current code attempts to provide relocation support when debugging core files via the rs6000_xfer_partial method of the rs6000-nat target_ops vector. However, this target_ops vector does not get pushed on the target stack at all when debugging core files, thus bypassing completely that part of the code. This patch fixes the problem by extending corelow's core_xfer_partial into handling the TARGET_OBJECT_LIBRARIES_AIX object. gdb/ChangeLog: * gdbarch.sh (core_xfer_shared_libraries_aix): New method. * gdbarch.h, gdbarch.c: Regenerate. * corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX handling. * rs6000-aix-tdep.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h. * rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and "xml-utils.h". (struct field_info, struct ld_info_desc): New types. (ld_info32_desc, ld_info64_desc): New static constants. (struct ld_info): New type. (rs6000_aix_extract_ld_info): New function. (rs6000_aix_shared_library_to_xml): Likewise. (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. (rs6000_aix_init_osabi): Add call to set_gdbarch_core_xfer_shared_libraries_aix. * rs6000-nat.c: Add "rs6000-aix-tdep.h" include. Remove "xml-utils.h" include. (LdInfo): Delete typedef. (ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME): Delete macros. (rs6000_ptrace_ldinfo): Change return type to gdb_byte *. Adjust code accordingly. (rs6000_core_ldinfo): Delete, folded into rs6000_aix_core_xfer_shared_libraries_aix. (rs6000_xfer_shared_library): Delete. (rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 14:26:14 +02:00
do_cleanups (cleanup);
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
if (result == 0)
return TARGET_XFER_EOF;
else
{
*xfered_len = result;
return TARGET_XFER_OK;
}
}
void
_initialize_rs6000_nat (void)
{
struct target_ops *t;
t = inf_ptrace_target ();
t->to_fetch_registers = rs6000_fetch_inferior_registers;
t->to_store_registers = rs6000_store_inferior_registers;
t->to_xfer_partial = rs6000_xfer_partial;
super_create_inferior = t->to_create_inferior;
t->to_create_inferior = rs6000_create_inferior;
t->to_wait = rs6000_wait;
add_target (t);
}