binutils-gdb/gdb/i386bsd-tdep.c

258 lines
6.9 KiB
C
Raw Normal View History

/* Target-dependent code for i386 BSD's.
Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
#include "regcache.h"
#include "osabi.h"
#include "gdb_string.h"
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
#include "i386-tdep.h"
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
/* Support for signal handlers. */
/* Return whether PC is in a BSD sigtramp routine. */
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
static int
i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
return (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end);
}
* i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove defenitions. (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. * i386-tdep.c: Mark functions that are 64-bit safe as such. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): New defines. (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, codestream_get): Remove define. (codestream_next_addr, condestream_addr, condestream_buf, codestream_off, codestream_cnt): Remove variables. (codestream_fill, codestream_seek, codestream_read): Remove functions. (i386_follow_jump): Rewrite to avoid usage of removed codestream functionality. (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, i386_frame_saved_pc, i386_saved_pc_after_call, i386_frame_num_args, i386_frame_init_saved_regs, i386_push_return_address, i386_do_pop_frame, i386_pop_frame, i386_push_arguments): Remove functions. (i386_skip_prologue): Rewrite to avoid usage of removed codestream functionality. Use i386_analyze_prologue instead of i386_get_frame_setup. (I386_NUM_SAVED_REGS): New define. (struct i386_frame_cache): New structure. (i386_alloc_frame_cache, i386_analyze_struct_return, i386_skip_probe, i386_analyze_frame_setup, i386_analyze_register_saves, i386_analyze_prologue, i386_unwind_pc, i386_frame_cache, i386_frame_this_id, i386_frame_prev_register, i386_sigtramp_frame_cache, i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): New functions. (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): New variables. (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of I386_EAX_REGNUM and I386_EDX_REGNUM. (i386_extract_return_value, i386_store_return_value): Use I386_ST0_REGNUM where appropriate. (i386_extract_struct_value_address): Rewrite to use extract_address. (i386_svr4_pc_in_sigtramp): Add comment. (i386_svr4_sigcontext_addr): Rewrite. (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms of new defines. Set push_dummy_call, don't set deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame. Don't set parm_boundary. Don't set deprecated_frame_chain, deprecated_frame_saved_pc, deprecated_saved_pc_after_call. Set unwind_dummy_id, save_dummy_frame_tos, unwind_pc. Call frame_unwind_append_predicate and frame_base_set_default. Don't set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. Don't set frameless_function_invocation. Don't set deprecated_register_bytes, deprecated_register_size, deprecated_call_dummy_words and deprecated_sizeof_call_dummy. * i386-linux-tdep.c: Fix formatting in some comments. (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop redundant parentheses. (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. (i386_linux_sigcontext_addr): Use it. Rewrite. (find_minsym_and_objfile): Change name of second argument. (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers changed. Use frame_pc_unwind instead of DEPRECATED_SAVED_PC_AFTER_CALL. (i386_linux_init_abi): Don't set deprecated_register_bytes. * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame unwinder. * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and "dummy-frame.h". (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. (_initialize_i386_cygwin_tdep): New prototype. (i386_cygwin_init_abi): Don't set deprecated_frame_chain and deprecated_frame_chain_valid. * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. Rely on the SVR4 defaults. * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.
2003-05-30 21:24:30 +02:00
/* Assuming NEXT_FRAME is for a frame following a BSD sigtramp
routine, return the address of the associated sigcontext structure. */
* i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove defenitions. (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. * i386-tdep.c: Mark functions that are 64-bit safe as such. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): New defines. (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, codestream_get): Remove define. (codestream_next_addr, condestream_addr, condestream_buf, codestream_off, codestream_cnt): Remove variables. (codestream_fill, codestream_seek, codestream_read): Remove functions. (i386_follow_jump): Rewrite to avoid usage of removed codestream functionality. (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, i386_frame_saved_pc, i386_saved_pc_after_call, i386_frame_num_args, i386_frame_init_saved_regs, i386_push_return_address, i386_do_pop_frame, i386_pop_frame, i386_push_arguments): Remove functions. (i386_skip_prologue): Rewrite to avoid usage of removed codestream functionality. Use i386_analyze_prologue instead of i386_get_frame_setup. (I386_NUM_SAVED_REGS): New define. (struct i386_frame_cache): New structure. (i386_alloc_frame_cache, i386_analyze_struct_return, i386_skip_probe, i386_analyze_frame_setup, i386_analyze_register_saves, i386_analyze_prologue, i386_unwind_pc, i386_frame_cache, i386_frame_this_id, i386_frame_prev_register, i386_sigtramp_frame_cache, i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): New functions. (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): New variables. (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of I386_EAX_REGNUM and I386_EDX_REGNUM. (i386_extract_return_value, i386_store_return_value): Use I386_ST0_REGNUM where appropriate. (i386_extract_struct_value_address): Rewrite to use extract_address. (i386_svr4_pc_in_sigtramp): Add comment. (i386_svr4_sigcontext_addr): Rewrite. (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms of new defines. Set push_dummy_call, don't set deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame. Don't set parm_boundary. Don't set deprecated_frame_chain, deprecated_frame_saved_pc, deprecated_saved_pc_after_call. Set unwind_dummy_id, save_dummy_frame_tos, unwind_pc. Call frame_unwind_append_predicate and frame_base_set_default. Don't set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. Don't set frameless_function_invocation. Don't set deprecated_register_bytes, deprecated_register_size, deprecated_call_dummy_words and deprecated_sizeof_call_dummy. * i386-linux-tdep.c: Fix formatting in some comments. (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop redundant parentheses. (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. (i386_linux_sigcontext_addr): Use it. Rewrite. (find_minsym_and_objfile): Change name of second argument. (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers changed. Use frame_pc_unwind instead of DEPRECATED_SAVED_PC_AFTER_CALL. (i386_linux_init_abi): Don't set deprecated_register_bytes. * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame unwinder. * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and "dummy-frame.h". (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. (_initialize_i386_cygwin_tdep): New prototype. (i386_cygwin_init_abi): Don't set deprecated_frame_chain and deprecated_frame_chain_valid. * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. Rely on the SVR4 defaults. * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.
2003-05-30 21:24:30 +02:00
static CORE_ADDR
i386bsd_sigcontext_addr (struct frame_info *next_frame)
{
* i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove defenitions. (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. * i386-tdep.c: Mark functions that are 64-bit safe as such. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): New defines. (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, codestream_get): Remove define. (codestream_next_addr, condestream_addr, condestream_buf, codestream_off, codestream_cnt): Remove variables. (codestream_fill, codestream_seek, codestream_read): Remove functions. (i386_follow_jump): Rewrite to avoid usage of removed codestream functionality. (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, i386_frame_saved_pc, i386_saved_pc_after_call, i386_frame_num_args, i386_frame_init_saved_regs, i386_push_return_address, i386_do_pop_frame, i386_pop_frame, i386_push_arguments): Remove functions. (i386_skip_prologue): Rewrite to avoid usage of removed codestream functionality. Use i386_analyze_prologue instead of i386_get_frame_setup. (I386_NUM_SAVED_REGS): New define. (struct i386_frame_cache): New structure. (i386_alloc_frame_cache, i386_analyze_struct_return, i386_skip_probe, i386_analyze_frame_setup, i386_analyze_register_saves, i386_analyze_prologue, i386_unwind_pc, i386_frame_cache, i386_frame_this_id, i386_frame_prev_register, i386_sigtramp_frame_cache, i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): New functions. (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): New variables. (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of I386_EAX_REGNUM and I386_EDX_REGNUM. (i386_extract_return_value, i386_store_return_value): Use I386_ST0_REGNUM where appropriate. (i386_extract_struct_value_address): Rewrite to use extract_address. (i386_svr4_pc_in_sigtramp): Add comment. (i386_svr4_sigcontext_addr): Rewrite. (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms of new defines. Set push_dummy_call, don't set deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame. Don't set parm_boundary. Don't set deprecated_frame_chain, deprecated_frame_saved_pc, deprecated_saved_pc_after_call. Set unwind_dummy_id, save_dummy_frame_tos, unwind_pc. Call frame_unwind_append_predicate and frame_base_set_default. Don't set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. Don't set frameless_function_invocation. Don't set deprecated_register_bytes, deprecated_register_size, deprecated_call_dummy_words and deprecated_sizeof_call_dummy. * i386-linux-tdep.c: Fix formatting in some comments. (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop redundant parentheses. (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. (i386_linux_sigcontext_addr): Use it. Rewrite. (find_minsym_and_objfile): Change name of second argument. (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers changed. Use frame_pc_unwind instead of DEPRECATED_SAVED_PC_AFTER_CALL. (i386_linux_init_abi): Don't set deprecated_register_bytes. * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame unwinder. * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and "dummy-frame.h". (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. (_initialize_i386_cygwin_tdep): New prototype. (i386_cygwin_init_abi): Don't set deprecated_frame_chain and deprecated_frame_chain_valid. * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. Rely on the SVR4 defaults. * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.
2003-05-30 21:24:30 +02:00
char buf[4];
CORE_ADDR sp;
frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
* i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove defenitions. (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. * i386-tdep.c: Mark functions that are 64-bit safe as such. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): New defines. (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, codestream_get): Remove define. (codestream_next_addr, condestream_addr, condestream_buf, codestream_off, codestream_cnt): Remove variables. (codestream_fill, codestream_seek, codestream_read): Remove functions. (i386_follow_jump): Rewrite to avoid usage of removed codestream functionality. (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, i386_frame_saved_pc, i386_saved_pc_after_call, i386_frame_num_args, i386_frame_init_saved_regs, i386_push_return_address, i386_do_pop_frame, i386_pop_frame, i386_push_arguments): Remove functions. (i386_skip_prologue): Rewrite to avoid usage of removed codestream functionality. Use i386_analyze_prologue instead of i386_get_frame_setup. (I386_NUM_SAVED_REGS): New define. (struct i386_frame_cache): New structure. (i386_alloc_frame_cache, i386_analyze_struct_return, i386_skip_probe, i386_analyze_frame_setup, i386_analyze_register_saves, i386_analyze_prologue, i386_unwind_pc, i386_frame_cache, i386_frame_this_id, i386_frame_prev_register, i386_sigtramp_frame_cache, i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): New functions. (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): New variables. (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of I386_EAX_REGNUM and I386_EDX_REGNUM. (i386_extract_return_value, i386_store_return_value): Use I386_ST0_REGNUM where appropriate. (i386_extract_struct_value_address): Rewrite to use extract_address. (i386_svr4_pc_in_sigtramp): Add comment. (i386_svr4_sigcontext_addr): Rewrite. (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms of new defines. Set push_dummy_call, don't set deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame. Don't set parm_boundary. Don't set deprecated_frame_chain, deprecated_frame_saved_pc, deprecated_saved_pc_after_call. Set unwind_dummy_id, save_dummy_frame_tos, unwind_pc. Call frame_unwind_append_predicate and frame_base_set_default. Don't set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. Don't set frameless_function_invocation. Don't set deprecated_register_bytes, deprecated_register_size, deprecated_call_dummy_words and deprecated_sizeof_call_dummy. * i386-linux-tdep.c: Fix formatting in some comments. (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop redundant parentheses. (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. (i386_linux_sigcontext_addr): Use it. Rewrite. (find_minsym_and_objfile): Change name of second argument. (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers changed. Use frame_pc_unwind instead of DEPRECATED_SAVED_PC_AFTER_CALL. (i386_linux_init_abi): Don't set deprecated_register_bytes. * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame unwinder. * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and "dummy-frame.h". (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. (_initialize_i386_cygwin_tdep): New prototype. (i386_cygwin_init_abi): Don't set deprecated_frame_chain and deprecated_frame_chain_valid. * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. Rely on the SVR4 defaults. * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.
2003-05-30 21:24:30 +02:00
sp = extract_unsigned_integer (buf, 4);
* i386-tdep.h (i386bsd_sigcontext_addr): Remove prototype. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS): Remove defenitions. (IS_FP_REGNUM, IS_SSE_REGNUM): Remove definitions. * i386-tdep.c: Mark functions that are 64-bit safe as such. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): New defines. (CODESTREAM_BUFSIZ, codestream_tell, codestream_peek, codestream_get): Remove define. (codestream_next_addr, condestream_addr, condestream_buf, codestream_off, codestream_cnt): Remove variables. (codestream_fill, codestream_seek, codestream_read): Remove functions. (i386_follow_jump): Rewrite to avoid usage of removed codestream functionality. (i386_get_frame_setup, i386_frameless_signal_p, i386_frame_chain, i386_sigtramp_saved_pc, i386_sigtramp_saved_sp, i386_frame_saved_pc, i386_saved_pc_after_call, i386_frame_num_args, i386_frame_init_saved_regs, i386_push_return_address, i386_do_pop_frame, i386_pop_frame, i386_push_arguments): Remove functions. (i386_skip_prologue): Rewrite to avoid usage of removed codestream functionality. Use i386_analyze_prologue instead of i386_get_frame_setup. (I386_NUM_SAVED_REGS): New define. (struct i386_frame_cache): New structure. (i386_alloc_frame_cache, i386_analyze_struct_return, i386_skip_probe, i386_analyze_frame_setup, i386_analyze_register_saves, i386_analyze_prologue, i386_unwind_pc, i386_frame_cache, i386_frame_this_id, i386_frame_prev_register, i386_sigtramp_frame_cache, i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register, i386_frame_p, i386_sigtramp_frame_p, i386_frame_base_address, i386_unwind_dummy_id, i386_save_dummy_tos, i386_push_dummy_call): New functions. (i386_frame_unwind, i386_sigtramp_frame_unwind, i386_frame_base): New variables. (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): Define in terms of I386_EAX_REGNUM and I386_EDX_REGNUM. (i386_extract_return_value, i386_store_return_value): Use I386_ST0_REGNUM where appropriate. (i386_extract_struct_value_address): Rewrite to use extract_address. (i386_svr4_pc_in_sigtramp): Add comment. (i386_svr4_sigcontext_addr): Rewrite. (i386_svr4_init_abi): Adjust TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386_gdbarch_init): Don't set deprecated_init_frame_pc. Set sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum in terms of new defines. Set push_dummy_call, don't set deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame. Don't set parm_boundary. Don't set deprecated_frame_chain, deprecated_frame_saved_pc, deprecated_saved_pc_after_call. Set unwind_dummy_id, save_dummy_frame_tos, unwind_pc. Call frame_unwind_append_predicate and frame_base_set_default. Don't set deprecated_dummy_write_pc. Don't set deprecated_fp_regnum. Don't set frameless_function_invocation. Don't set deprecated_register_bytes, deprecated_register_size, deprecated_call_dummy_words and deprecated_sizeof_call_dummy. * i386-linux-tdep.c: Fix formatting in some comments. (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop redundant parentheses. (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. (i386_linux_sigcontext_addr): Use it. Rewrite. (find_minsym_and_objfile): Change name of second argument. (skip_gnu_resolver): Renamed from skip_hurd_resolver. All callers changed. Use frame_pc_unwind instead of DEPRECATED_SAVED_PC_AFTER_CALL. (i386_linux_init_abi): Don't set deprecated_register_bytes. * i386bsd-tdep.c (i386bsd_sigcontext_addr): Rewrite. * i386-nto-tdep.c (i386nto_sigcontext_addr): Adapt for new frame unwinder. * i386-cygwin-tdep.c: Don't include "gdbcore.h", "frame.h" and "dummy-frame.h". (i386_cygwin_frame_chain_valid, i386_cygwin_frame_chain): Removed. (_initialize_i386_cygwin_tdep): New prototype. (i386_cygwin_init_abi): Don't set deprecated_frame_chain and deprecated_frame_chain_valid. * i386-sol2-tdep.c (i386_sol2_init_abi): Don't set TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. Rely on the SVR4 defaults. * config/i386/i386sol2.mt (TDEPFILES): Remove i386bsd-tdep.o. * Makefile.in (i386-tdep.o, i386-cygwin-tdep.o): Update dependencies.
2003-05-30 21:24:30 +02:00
return read_memory_unsigned_integer (sp + 8, 4);
}
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
/* Return the start address of the sigtramp routine. */
CORE_ADDR
i386bsd_sigtramp_start (CORE_ADDR pc)
{
return gdbarch_tdep (current_gdbarch)->sigtramp_start;
}
/* Return the end address of the sigtramp routine. */
CORE_ADDR
i386bsd_sigtramp_end (CORE_ADDR pc)
{
return gdbarch_tdep (current_gdbarch)->sigtramp_end;
}
/* Support for shared libraries. */
/* Return non-zero if we are in a shared library trampoline code stub. */
int
i386bsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
{
return (name && !strcmp (name, "_DYNAMIC"));
}
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
/* Traditional BSD (4.3 BSD, still used for BSDI and 386BSD). */
/* From <machine/signal.h>. */
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
int i386bsd_sc_reg_offset[I386_NUM_GREGS] =
{
-1, /* %eax */
-1, /* %ecx */
-1, /* %edx */
-1, /* %ebx */
8 + 0 * 4, /* %esp */
8 + 1 * 4, /* %ebp */
-1, /* %esi */
-1, /* %edi */
8 + 3 * 4, /* %eip */
8 + 4 * 4, /* %eflags */
-1, /* %cs */
-1, /* %ss */
-1, /* %ds */
-1, /* %es */
-1, /* %fs */
-1 /* %gs */
};
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
void
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
set_gdbarch_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
/* Allow the recognition of sigtramps as a function named <sigtramp>. */
set_gdbarch_sigtramp_start (gdbarch, i386bsd_sigtramp_start);
set_gdbarch_sigtramp_end (gdbarch, i386bsd_sigtramp_end);
/* Assume SunOS-style shared libraries. */
set_gdbarch_in_solib_call_trampoline (gdbarch,
i386bsd_aout_in_solib_call_trampoline);
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
tdep->jb_pc_offset = 0;
tdep->sigtramp_start = 0xfdbfdfc0;
tdep->sigtramp_end = 0xfdbfe000;
tdep->sigcontext_addr = i386bsd_sigcontext_addr;
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
tdep->sc_reg_offset = i386bsd_sc_reg_offset;
tdep->sc_num_regs = I386_NUM_GREGS;
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
}
/* FreeBSD 3.0-RELEASE or later. */
CORE_ADDR i386fbsd_sigtramp_start = 0xbfbfdf20;
CORE_ADDR i386fbsd_sigtramp_end = 0xbfbfdff0;
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
/* From <machine/signal.h>. */
int i386fbsd_sc_reg_offset[I386_NUM_GREGS] =
{
8 + 14 * 4, /* %eax */
8 + 13 * 4, /* %ecx */
8 + 12 * 4, /* %edx */
8 + 11 * 4, /* %ebx */
8 + 0 * 4, /* %esp */
8 + 1 * 4, /* %ebp */
8 + 10 * 4, /* %esi */
8 + 9 * 4, /* %edi */
8 + 3 * 4, /* %eip */
8 + 4 * 4, /* %eflags */
8 + 7 * 4, /* %cs */
8 + 8 * 4, /* %ss */
8 + 6 * 4, /* %ds */
8 + 5 * 4, /* %es */
8 + 15 * 4, /* %fs */
8 + 16 * 4 /* %gs */
};
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
static void
i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Obviously FreeBSD is BSD-based. */
i386bsd_init_abi (info, gdbarch);
/* FreeBSD uses -freg-struct-return by default. */
tdep->struct_return = reg_struct_return;
/* FreeBSD uses a different memory layout. */
tdep->sigtramp_start = i386fbsd_sigtramp_start;
tdep->sigtramp_end = i386fbsd_sigtramp_end;
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
/* FreeBSD has a more complete `struct sigcontext'. */
tdep->sc_reg_offset = i386fbsd_sc_reg_offset;
tdep->sc_num_regs = I386_NUM_GREGS;
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
}
static void
i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
/* It's almost identical to FreeBSD a.out. */
i386fbsdaout_init_abi (info, gdbarch);
/* Except that it uses ELF. */
i386_elf_init_abi (info, gdbarch);
/* FreeBSD ELF uses SVR4-style shared libraries. */
set_gdbarch_in_solib_call_trampoline (gdbarch,
generic_in_solib_call_trampoline);
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
}
/* FreeBSD 4.0-RELEASE or later. */
/* From <machine/signal.h>. */
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
int i386fbsd4_sc_reg_offset[I386_NUM_GREGS] =
{
20 + 11 * 4, /* %eax */
20 + 10 * 4, /* %ecx */
20 + 9 * 4, /* %edx */
20 + 8 * 4, /* %ebx */
20 + 17 * 4, /* %esp */
20 + 6 * 4, /* %ebp */
20 + 5 * 4, /* %esi */
20 + 4 * 4, /* %edi */
20 + 14 * 4, /* %eip */
20 + 16 * 4, /* %eflags */
20 + 15 * 4, /* %cs */
20 + 18 * 4, /* %ss */
20 + 3 * 4, /* %ds */
20 + 2 * 4, /* %es */
20 + 1 * 4, /* %fs */
20 + 0 * 4 /* %gs */
};
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
static void
i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Inherit stuff from older releases. We assume that FreeBSD
4.0-RELEASE always uses ELF. */
i386fbsd_init_abi (info, gdbarch);
/* FreeBSD 4.0 introduced a new `struct sigcontext'. */
From Michal Ludvig <mludvig@suse.cz>: * i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
2003-05-31 18:08:06 +02:00
tdep->sc_reg_offset = i386fbsd4_sc_reg_offset;
tdep->sc_num_regs = I386_NUM_GREGS;
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
}
static enum gdb_osabi
i386bsd_aout_osabi_sniffer (bfd *abfd)
{
if (strcmp (bfd_get_target (abfd), "a.out-i386-netbsd") == 0)
return GDB_OSABI_NETBSD_AOUT;
if (strcmp (bfd_get_target (abfd), "a.out-i386-freebsd") == 0)
return GDB_OSABI_FREEBSD_AOUT;
return GDB_OSABI_UNKNOWN;
}
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_i386bsd_tdep (void);
void
_initialize_i386bsd_tdep (void)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour,
i386bsd_aout_osabi_sniffer);
* osabi.c: Include "gdb_assert.h" and "gdb_string.h". (struct gdb_osabi_handler): Remove member `arch'. Add member `arch_info'. (gdbarch_register_osabi): Add new argument `machine'. Use ot to construct a `struct bfd_arch_info' and store it in the `struct gdb_osabi_handler' that is created. (gdbarch_init_osabi): Check for compatibility based on machine type and architecture. * osabi.h (gdbarch_register_osabi): Adjust prototype and update comment. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as second argument in call to gdbarch_register_osabi. * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. * arm-tdep.c (_initialize_arm_tdep): Likewise. * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. * i386-tdep.c (_initialize_i386_tdep): Likewise. * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from _initialize_i386bsd_tdep and updated likewise. * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise.
2002-12-21 20:58:07 +01:00
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT,
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
i386fbsdaout_init_abi);
* osabi.c: Include "gdb_assert.h" and "gdb_string.h". (struct gdb_osabi_handler): Remove member `arch'. Add member `arch_info'. (gdbarch_register_osabi): Add new argument `machine'. Use ot to construct a `struct bfd_arch_info' and store it in the `struct gdb_osabi_handler' that is created. (gdbarch_init_osabi): Check for compatibility based on machine type and architecture. * osabi.h (gdbarch_register_osabi): Adjust prototype and update comment. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as second argument in call to gdbarch_register_osabi. * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. * arm-tdep.c (_initialize_arm_tdep): Likewise. * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. * i386-tdep.c (_initialize_i386_tdep): Likewise. * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from _initialize_i386bsd_tdep and updated likewise. * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise.
2002-12-21 20:58:07 +01:00
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF,
* config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. Move these to ... * config/i386/i386sol2.mh: ... here. * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. (SIGCONTEXT_PC_OFFSET): Remove define. (IN_SIGTRAMP): Remove define. * i386-sol2-tdep.c: New file. * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. * config/i386/tm-i386nw.h: Removed. * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, USE_STRUCT_CONVENTION): Remove defines. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (IN_SIGTRAMP): Remove define. (i386bsd_in_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a function. Update comment accordingly (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. (FRAME_SAVED_PC): Remove define. (i386bsd_frame_saved_pc): Remove prototype. * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove prototype. * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove declaration. (_initialize_i386bsd_nat): Revise logic to determine some constants at compile time when compiling a native GDB. Warn if things don't match up with what we expect. * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove variables. (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite to use date stored in `struct gdbarch_tdep'. (i386bsd_sigcontext_offset): Remove varaible. (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data stored in `struct gdbarch_tdep'. (i386bsd_frame_saved_pc): Make static. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, i386fbsd4_sc_pc_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New functions. (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New functions. * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. Modify the value of i386fbsd_sigtramp_start and i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and i386fbsd_sigtramp_end. * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove function. * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move define to i386-linux-tdep.h. (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove defines. (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size): Remove prototypes. (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, TARGET_WRITE_PC): Remove defines. (i386_linux_in_sigtramp, i386_linux_frame_chain, i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, i386_linux_write_pc): Remove prototypes. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-linux-tdep.h: New file. * i386-linux-nat.c: Include "i386-linux-tdep.h". * i386-linux-tdep.c: Include "i386-tdep.h" and "i386-linux-tdep.h". (i386_linux_register_name, i386_linux_register_byte, i386_linux_register_raw_size, i386_linux_in_sigtramp, i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): Make static. (i386_linux_init_abi): New function. (_initialize_i386_linux_tdep): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. (i386_saved_pc_after_call): Remove prototype. (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. (i386_register_name, i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Remove prototypes. (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, SIZEOF_SSE_REGS): Remove defines. (REGISTER_BYTES): Remove define. (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. (i386_register_byte, i386_register_raw_size): Remove prototypes. (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, JB_EDX, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. (sigtramp_saved_pc): Remove define. (i386v4_sigtramp_saved_pc): Remove prototype. * config/i386/tm-go32.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. (i386go32_frame_saved_pc): Remove prototype. (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. (get_longjmp_target): Remove prototype. * i386-tdep.h: Include "osabi.h". (enum i386_abi): Removed. (enum struct_return): New enum. (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and sc_pc_offset members. (i386_gdbarch_register_os_abi): Remove prototype. (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, I386_SSE_NUM_REGS): New defines. (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, I386_SSE_SIZEOF_REGS): New defines. (i386_register_name, i386_register_byte, i386_register_raw_size): New prototypes. (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. (i386bsd_sigtramp_saved_pc): New prototype. * i386-tdep.c: Don't include "elf-bfd.h". (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, i386_frame_chain, i386_saved_pc_after_call): Make static. (i386_frame_saved_pc): Rewrite to call architecture dependent function to deal with signal handlers. Make static. (i386go32_frame_saved_pc): Removed. [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): Removed. (i386_get_longjmp_target): New function. (default_struct_convention, pcc_struct_convention, reg_struct_convention, valid_conventions, struct_convention): New variables. (i386_use_struct_convention): New function. (i386v4_sigtramp_saved_pc): Renamed to i386_svr4_sigtramp_saved_pc. Made static. Moved. (i386_pc_in_sigtramp): New function. (i386_abi_names): Removed. (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): Removed. (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, i386_gdbarch_register_os_abi): Removed. (struct i386_abi_handler): Removed. (i386_abi_handler_list): Removed. (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New functions. (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, i386_nw_init_abi): New functions. (i386_gdbarch_init): Rewritten to use generic OS ABI framework. Use set_gdbarch_xxx() calls instead of relying on macros for a number of calls. (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. (_initialize_i386_tdep): Add new 'struct-convcention' command. Register the various architecture variants defined in this file.
2002-06-14 21:42:20 +02:00
i386fbsd4_init_abi);
}