binutils-gdb/gdb/i386-linux-tdep.c

674 lines
24 KiB
C
Raw Normal View History

/* Target-dependent code for GNU/Linux i386.
2002-02-24 23:31:19 +01:00
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "gdbcore.h"
#include "frame.h"
#include "value.h"
#include "regcache.h"
#include "inferior.h"
2003-11-09 18:32:32 +01:00
#include "osabi.h"
#include "reggroups.h"
#include "dwarf2-frame.h"
2003-11-09 18:32:32 +01:00
#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"
#include "i386-linux-tdep.h"
2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/ * target.h (enum target_object): Add new TARGET_OBJECT_SIGNAL_INFO. * infrun.c (siginfo_value_read, siginfo_value_write): New. (siginfo_value_funcs): New. (siginfo_make_value): New. (_initialize_infrun): Create the $_siginfo convenience variable. * gdbtypes.h (append_composite_type_field_aligned): Declare. * gdbtypes.c (append_composite_type_field): Rename to... (append_composite_type_field_aligned): ... this. Add ALIGNMENT argument. Handle it. (append_composite_type_field): Rewrite on top of append_composite_type_field_aligned. * value.h (internalvar_make_value): New typedef. (struct internalvar) <make_value>: New field. (create_internalvar_type_lazy): Declare. * value.c (create_internalvar): Clear make_value. (create_internalvar_type_lazy): New. (value_of_internalvar): If make_value is set use it. (preserve_values): Skip internal variables that don't have a value. * gdbarch.sh (get_siginfo_type): New. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.h, linux-tdep.c: New. * amd64-linux-tdep.c: Include "linux-tdep.h". (amd64_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * i386-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * arm-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * linux-nat.c (linux_xfer_siginfo): New. (linux_nat_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. * remote.c (PACKET_qXfer_siginfo_read) (PACKET_qXfer_siginfo_write): New. (feature remote_protocol_features): Add "qXfer:siginfo:read" and "qXfer:siginfo:write" features. (remote_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. (_initialize_remote): Add "set/show remote read-siginfo-object" and "set/show remote write-siginfo-object" commands. * Makefile.in (ALL_TARGET_OBS): Add linux-tdep.o. (HFILES_NO_SRCDIR): Add linux-tdep.h. (ALLDEPFILES): Add linux-tdep.c. * configure.tgt (arm*-*-linux* | arm*-*-uclinux*) (i[34567]86-*-linux*, x86_64-*-linux*): Add linux-tdep.o to gdb_target_obs. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/gdbserver/ * server.c (handle_query): Report qXfer:siginfo:read and qXfer:siginfo:write as supported and handle them. * target.h (struct target_ops) <qxfer_siginfo>: New field. * linux-low.c (linux_xfer_siginfo): New. (linux_target_ops): Set it. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/doc/ * gdb.texinfo (Signals): Document $_siginfo. (Convenience Variables): Mention $_siginfo. (Remote Configuration): Document qXfer:siginfo:read, qXfer:siginfo:write packets, and the read-siginfo-object, write-siginfo-object commands. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * gdb.base/siginfo-obj.c, gdb.base/siginfo-obj.exp: New.
2009-02-06 23:59:01 +01:00
#include "linux-tdep.h"
2003-11-09 18:32:32 +01:00
#include "glibc-tdep.h"
#include "solib-svr4.h"
* config/tm-linux.h: Delete file. * config/alpha/alpha-linux.mt (DEPRECATED_TM_FILE): Set to tm-alpha.h. * config/alpha/tm-alphalinux.h: Delete file. * config/arm/linux.mt (DEPRECATED_TM_FILE): Set to tm-arm.h * config/arm/tm-linux.h: Delete file. * config/i386/tm-linux.h: Do not include "config/tm-linux.h". * config/ia64/tm-linux.h: Do not include "config/tm-linux.h". * config/m32r/linux.mt (DEPRECATED_TM_FILE): Remove. * config/mips/tm-linux.h: Do not include "config/tm-linux.h". * config/pa/linux.mt (DEPRECATED_TM_FILE): Set to tm-hppa.h. * config/pa/tm-linux.h: Delete file. * config/powerpc/tm-linux.h: Do not include "config/tm-linux.h". * config/s390/linux.mt (DEPRECATED_TM_FILE): Remove. * config/sh/linux.mt (DEPRECATED_TM_FILE): Set to tm-sh.h. * config/sh/tm-linux.h: Delete file. * alpha-linux-tdep.c: Include "symtab.h". (alpha_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * i386-linux-tdep.c: Include "symtab.h". (i386_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * ia64-linux-tdep.c: Include "symtab.h". (ia64_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * m32r-linux-tdep.c: Include "symtab.h". (m32r_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * mips-linux-tdep.c: Include "symtab.h". (mips_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * sh-linux-tdep.c: Include "symtab.h". (sh_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * s390-tdep.c (s390_gdbarch_init): Call set_gdbarch_skip_trampoline_code. * s390-nat.c: Do not include "tm.h". * Makefile.in (alpha-linux-tdep.o): Add dependency on $(symtab_h). (i386-linux-tdep.o): Likewise. (ia64-linux-tdep.o): Likewise. (m32r-linux-tdep.o): Likewise. (mips-linux-tdep.o): Likewise. (sh-linux-tdep.o): Likewise. (s390-nat.o): Remove dependency on $(tm_h).
2006-11-28 22:41:03 +01:00
#include "symtab.h"
Implement displaced stepping. gdb/ * gdbarch.sh (max_insn_length): New 'variable'. (displaced_step_copy, displaced_step_fixup) (displaced_step_free_closure, displaced_step_location): New functions. (struct displaced_step_closure): Add forward declaration. * gdbarch.c, gdbarch.h: Regenerated. * arch-utils.c: #include "objfiles.h". (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New functions. * arch-utils.h (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New prototypes. * i386-tdep.c (I386_MAX_INSN_LEN): Rename to... (I386_MAX_MATCHED_INSN_LEN): ... this. (i386_absolute_jmp_p, i386_absolute_call_p) (i386_ret_p, i386_call_p, i386_breakpoint_p, i386_syscall_p) (i386_displaced_step_fixup): New functions. (struct i386_insn, i386_match_insn): Update. (i386_gdbarch_init): Set gdbarch_max_insn_length. * i386-tdep.h (I386_MAX_INSN_LEN): New. (i386_displaced_step_fixup): New prototype. * i386-linux-tdep.c (i386_linux_init_abi): Include "arch-utils.h". Register gdbarch_displaced_step_copy, gdbarch_displaced_step_fixup, gdbarch_displaced_step_free_closure, and gdbarch_displaced_step_location functions. * infrun.c (debug_displaced): New variable. (show_debug_displaced): New function. (struct displaced_step_request): New struct. (displaced_step_request_queue, displaced_step_ptid) (displaced_step_gdbarch, displaced_step_closure) (displaced_step_original, displaced_step_copy) (displaced_step_saved_copy, can_use_displaced_stepping): New variables. (show_can_use_displaced_stepping, use_displaced_stepping) (displaced_step_clear, cleanup_displaced_step_closure) (displaced_step_dump_bytes, displaced_step_prepare) (displaced_step_clear_cleanup, write_memory_ptid) (displaced_step_fixup): New functions. (resume): Call displaced_step_prepare. (proceed): Call read_pc once, and remember the value. If using displaced stepping, don't remove breakpoints. (handle_inferior_event): Call displaced_step_fixup. Add some debugging output. When we try to step over a breakpoint, but get a signal to deliver to the thread instead, ensure the step-resume breakpoint is actually inserted. If a thread hop is needed, and displaced stepping is enabled, don't remove breakpoints. (init_wait_for_inferior): Call displaced_step_clear. (_initialize_infrun): Add "set debug displaced" command. Add "maint set can-use-displaced-stepping" command. Clear displaced_step_ptid. * inferior.h (debug_displaced): Declare variable. (displaced_step_dump_bytes): Declare function. * Makefile.in (arch-utils.o, i386-linux-tdep.o): Update dependencies. gdb/testsuite/ * gdb.asm/asmsrc1.s: Add scratch space. gdb/doc/ * gdb.texinfo (Debugging Output): Document "set/show debug displaced". (Maintenance Commands): Document "maint set/show can-use-displaced-stepping".
2008-05-02 18:49:54 +02:00
#include "arch-utils.h"
#include "regset.h"
#include "record.h"
#include "linux-record.h"
#include <stdint.h>
/* Supported register note sections. */
static struct core_regset_section i386_linux_regset_sections[] =
{
{ ".reg", 144 },
{ ".reg2", 108 },
{ ".reg-xfp", 512 },
{ NULL, 0 }
};
* 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 name of register REG. */
static const char *
2007-11-02 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (register_name): Add gdbarch parameter. * gdbarch.{c,h}: Regenerate. * target-descriptions.c (tdesc_register_name): Add gdbarch parameter. (tdesc_register_name): Replace current_gdbarch by gdbarch. * target-descriptions.h (tdesc_register_name): Add gdbarch parameter. * xstormy16-tdep.c (xstormy16_register_name): Add gdbarch parameter. * vax-tdep.c (vax_register_name): Add gdbarch parameter. * spu-tdep.c (spu_register_name): Add gdbarch parameter. * s390-tdep.c (s390_register_name): Add gdbarch parameter. * mt-tdep.c (mt_register_name): Add gdbarch parameter. (mt_registers_info): Replace current_gdbarch by gdbarch. (mt_register_reggroup_p): Add gdbarch to mt_register_name call. * mips-tdep.c (mips_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (mips_register_name): Add gdbarch to tdesc_register_name call. * mep-tdep.c (mep_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (mep_register_reggroup_p): Add gdbarch to mep_register_name call. * m32c-tdep.c (m32c_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. * m88k-tdep.c (m88k_register_name): Add gdbarch parameter. * m68k-tdep.c (m68k_register_name): Add gdbarch parameter. * m32r-tdep.c (m32r_register_name): Add gdbarch parameter. (m32r_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. * iq2000-tdep.c (iq2000_register_name): Add gdbarch parameter. * ia64-tdep.c (ia64_register_name): Add gdbarch parameter. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Add gdbarch parameter. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Add gdbarch parameter. * cris-tdep.c (cris_register_name, crisv32_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (cris_gdbarch_init): Replace current_gdbarch by gdbarch (comment). * avr-tdep.c (avr_register_name): Add gdbarch parameter. * arm-tdep.c (arm_register_name): Add gdbarch paramete * amd64-tdep.c (amd64_register_name): Add gdbarch parameter. Update caller. * amd64-tdep.h (amd64_register_name): Add gdbarch parameter. * amd64-linux-tdep.c (amd64_linux_register_name): Add gdbarch parameter. * alpha-tdep.c (alpha_register_name): Add gdbarch parameter. (alpha_cannot_fetch_register, alpha_cannot_store_register): Update call of alpha_register_name. * frv-tdep.c (frv_register_name): Add gdbarch parameter. * i386-tdep.c (i386_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (i386_register_type): Replace ?current_gdbarch by gdbarch. * i386-tdep.h (i386_register_name): Add gdbarch parameter. * i386-linux-tdep.c (i386_linux_register_name): Add gdbarch parameter. * m68hc11-tdep.c (m68hc11_register_name): Add gdbarch parameter. (m68hc11_register_reggroup_p): Add gdbarch to call of m68hc11_register_name. * mn10300-tdep.c (mn10300_generic_register_name, am33_register_name) (am33_2_register_name): Add gdbarch parameter. (mn10300_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. (mn10300_dump_tdep): Replace current_gdbarch by gdbarch. * rs6000-tdep.c (rs6000_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. * score-tdep.c (score_register_name): Add gdbarch parameter. (score_return_value, score_push_dummy_call): Replace current_gdbarch by gdbarch. * sh64-tdep.c (sh64_register_name): Add gdbarch parameter. (sh64_compact_reg_base_num, sh64_register_convert_to_virtual) (sh64_register_convert_to_raw, sh64_fv_reg_base_num) (sh64_dr_reg_base_num, sh64_fpp_reg_base_num): Add gdbarch parameter and update caller. Replace current_gdbarch by gdbarch. (sh64_extract_return_value, sh64_store_return_value): Use get_regcache_arch to get at the current architecture by regcache. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name, sh_sh2a_register_name) (sh_sh2a_nofpu_register_name, sh_sh_dsp_register_name) (sh_sh3_dsp_register_name, sh_sh4_register_name) (sh_sh4_nofpu_register_name, sh_sh4al_dsp_register_name): Add gdbarch parameter. (fv_reg_base_num, dr_reg_base_num, sh_justify_value_in_reg) (sh_next_flt_argreg): Add gdbarch parameter and update caller. Replace current_gdbarch by gdbarch. (sh_extract_return_value_fpu, sh_store_return_value_fpu): Use get_regcache_arch to get at the current architecture by regcache. * sparc-tdep.c (sparc32_register_name): Add gdbarch parameter. * sparc64-tdep.c (sparc64_register_name): Add gdbarch parameter. * v850-tdep.c (v850_register_name, v850e_register_name): Add gdbarch parameter. (v850_unwind_sp, v850_unwind_pc): Replace current_gdbarch by gdbarch. * xtensa-tdep.c (xtensa_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (xtensa_pseudo_register_read, xtensa_pseudo_register_write) (xtensa_frame_prev_register): Add gdbarch parameter to xtensa_register_name call.
2007-11-02 15:27:15 +01:00
i386_linux_register_name (struct gdbarch *gdbarch, int reg)
{
/* Deal with the extra "orig_eax" pseudo register. */
if (reg == I386_LINUX_ORIG_EAX_REGNUM)
return "orig_eax";
2007-11-02 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (register_name): Add gdbarch parameter. * gdbarch.{c,h}: Regenerate. * target-descriptions.c (tdesc_register_name): Add gdbarch parameter. (tdesc_register_name): Replace current_gdbarch by gdbarch. * target-descriptions.h (tdesc_register_name): Add gdbarch parameter. * xstormy16-tdep.c (xstormy16_register_name): Add gdbarch parameter. * vax-tdep.c (vax_register_name): Add gdbarch parameter. * spu-tdep.c (spu_register_name): Add gdbarch parameter. * s390-tdep.c (s390_register_name): Add gdbarch parameter. * mt-tdep.c (mt_register_name): Add gdbarch parameter. (mt_registers_info): Replace current_gdbarch by gdbarch. (mt_register_reggroup_p): Add gdbarch to mt_register_name call. * mips-tdep.c (mips_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (mips_register_name): Add gdbarch to tdesc_register_name call. * mep-tdep.c (mep_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (mep_register_reggroup_p): Add gdbarch to mep_register_name call. * m32c-tdep.c (m32c_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. * m88k-tdep.c (m88k_register_name): Add gdbarch parameter. * m68k-tdep.c (m68k_register_name): Add gdbarch parameter. * m32r-tdep.c (m32r_register_name): Add gdbarch parameter. (m32r_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. * iq2000-tdep.c (iq2000_register_name): Add gdbarch parameter. * ia64-tdep.c (ia64_register_name): Add gdbarch parameter. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Add gdbarch parameter. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Add gdbarch parameter. * cris-tdep.c (cris_register_name, crisv32_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (cris_gdbarch_init): Replace current_gdbarch by gdbarch (comment). * avr-tdep.c (avr_register_name): Add gdbarch parameter. * arm-tdep.c (arm_register_name): Add gdbarch paramete * amd64-tdep.c (amd64_register_name): Add gdbarch parameter. Update caller. * amd64-tdep.h (amd64_register_name): Add gdbarch parameter. * amd64-linux-tdep.c (amd64_linux_register_name): Add gdbarch parameter. * alpha-tdep.c (alpha_register_name): Add gdbarch parameter. (alpha_cannot_fetch_register, alpha_cannot_store_register): Update call of alpha_register_name. * frv-tdep.c (frv_register_name): Add gdbarch parameter. * i386-tdep.c (i386_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (i386_register_type): Replace ?current_gdbarch by gdbarch. * i386-tdep.h (i386_register_name): Add gdbarch parameter. * i386-linux-tdep.c (i386_linux_register_name): Add gdbarch parameter. * m68hc11-tdep.c (m68hc11_register_name): Add gdbarch parameter. (m68hc11_register_reggroup_p): Add gdbarch to call of m68hc11_register_name. * mn10300-tdep.c (mn10300_generic_register_name, am33_register_name) (am33_2_register_name): Add gdbarch parameter. (mn10300_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. (mn10300_dump_tdep): Replace current_gdbarch by gdbarch. * rs6000-tdep.c (rs6000_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. * score-tdep.c (score_register_name): Add gdbarch parameter. (score_return_value, score_push_dummy_call): Replace current_gdbarch by gdbarch. * sh64-tdep.c (sh64_register_name): Add gdbarch parameter. (sh64_compact_reg_base_num, sh64_register_convert_to_virtual) (sh64_register_convert_to_raw, sh64_fv_reg_base_num) (sh64_dr_reg_base_num, sh64_fpp_reg_base_num): Add gdbarch parameter and update caller. Replace current_gdbarch by gdbarch. (sh64_extract_return_value, sh64_store_return_value): Use get_regcache_arch to get at the current architecture by regcache. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name, sh_sh2a_register_name) (sh_sh2a_nofpu_register_name, sh_sh_dsp_register_name) (sh_sh3_dsp_register_name, sh_sh4_register_name) (sh_sh4_nofpu_register_name, sh_sh4al_dsp_register_name): Add gdbarch parameter. (fv_reg_base_num, dr_reg_base_num, sh_justify_value_in_reg) (sh_next_flt_argreg): Add gdbarch parameter and update caller. Replace current_gdbarch by gdbarch. (sh_extract_return_value_fpu, sh_store_return_value_fpu): Use get_regcache_arch to get at the current architecture by regcache. * sparc-tdep.c (sparc32_register_name): Add gdbarch parameter. * sparc64-tdep.c (sparc64_register_name): Add gdbarch parameter. * v850-tdep.c (v850_register_name, v850e_register_name): Add gdbarch parameter. (v850_unwind_sp, v850_unwind_pc): Replace current_gdbarch by gdbarch. * xtensa-tdep.c (xtensa_register_name): Add gdbarch parameter. Replace current_gdbarch by gdbarch. (xtensa_pseudo_register_read, xtensa_pseudo_register_write) (xtensa_frame_prev_register): Add gdbarch parameter to xtensa_register_name call.
2007-11-02 15:27:15 +01:00
return i386_register_name (gdbarch, reg);
}
/* Return non-zero, when the register is in the corresponding register
group. Put the LINUX_ORIG_EAX register in the system group. */
static int
i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
{
if (regnum == I386_LINUX_ORIG_EAX_REGNUM)
return (group == system_reggroup
|| group == save_reggroup
|| group == restore_reggroup);
return i386_register_reggroup_p (gdbarch, regnum, group);
}
/* Recognizing signal handler frames. */
2002-02-24 23:31:19 +01:00
/* GNU/Linux has two flavors of signals. Normal signal handlers, and
"realtime" (RT) signals. The RT signals can provide additional
information to the signal handler if the SA_SIGINFO flag is set
when establishing a signal handler using `sigaction'. It is not
2002-02-24 23:31:19 +01:00
unlikely that future versions of GNU/Linux will support SA_SIGINFO
for normal signals too. */
/* When the i386 Linux kernel calls a signal handler and the
SA_RESTORER flag isn't set, the return address points to a bit of
code on the stack. This function returns whether the PC appears to
be within this bit of code.
The instruction sequence for normal signals is
pop %eax
* 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
mov $0x77, %eax
int $0x80
or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
Checking for the code sequence should be somewhat reliable, because
the effect is to call the system call sigreturn. This is unlikely
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
to occur anywhere other than in a signal trampoline.
It kind of sucks that we have to read memory from the process in
order to identify a signal trampoline, but there doesn't seem to be
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
any other way. Therefore we only do the memory reads if no
function name could be identified, which should be the case since
the code is on the stack.
Detection of signal trampolines for handlers that set the
SA_RESTORER flag is in general not possible. Unfortunately this is
what the GNU C Library has been doing for quite some time now.
However, as of version 2.1.2, the GNU C Library uses signal
trampolines (named __restore and __restore_rt) that are identical
to the ones used by the kernel. Therefore, these trampolines are
supported too. */
* 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
#define LINUX_SIGTRAMP_INSN0 0x58 /* pop %eax */
#define LINUX_SIGTRAMP_OFFSET0 0
#define LINUX_SIGTRAMP_INSN1 0xb8 /* mov $NNNN, %eax */
#define LINUX_SIGTRAMP_OFFSET1 1
#define LINUX_SIGTRAMP_INSN2 0xcd /* int */
#define LINUX_SIGTRAMP_OFFSET2 6
static const gdb_byte linux_sigtramp_code[] =
{
LINUX_SIGTRAMP_INSN0, /* pop %eax */
* 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
LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77, %eax */
LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
};
#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* If THIS_FRAME is a sigtramp routine, return the address of the
start of the routine. Otherwise, return 0. */
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
i386_linux_sigtramp_start (struct frame_info *this_frame)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
gdb_byte buf[LINUX_SIGTRAMP_LEN];
/* We only recognize a signal trampoline if PC is at the start of
one of the three instructions. We optimize for finding the PC at
the start, as will be the case when the trampoline is not the
first frame on the stack. We assume that in the case where the
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
return 0;
if (buf[0] != LINUX_SIGTRAMP_INSN0)
{
int adjust;
switch (buf[0])
{
case LINUX_SIGTRAMP_INSN1:
adjust = LINUX_SIGTRAMP_OFFSET1;
break;
case LINUX_SIGTRAMP_INSN2:
adjust = LINUX_SIGTRAMP_OFFSET2;
break;
default:
return 0;
}
pc -= adjust;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
return 0;
}
if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
return 0;
return pc;
}
/* This function does the same for RT signals. Here the instruction
sequence is
* 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
mov $0xad, %eax
int $0x80
or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80.
The effect is to call the system call rt_sigreturn. */
* 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
#define LINUX_RT_SIGTRAMP_INSN0 0xb8 /* mov $NNNN, %eax */
#define LINUX_RT_SIGTRAMP_OFFSET0 0
#define LINUX_RT_SIGTRAMP_INSN1 0xcd /* int */
#define LINUX_RT_SIGTRAMP_OFFSET1 5
static const gdb_byte linux_rt_sigtramp_code[] =
{
* 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
LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */
LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */
};
#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* If THIS_FRAME is an RT sigtramp routine, return the address of the
start of the routine. Otherwise, return 0. */
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
i386_linux_rt_sigtramp_start (struct frame_info *this_frame)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
/* We only recognize a signal trampoline if PC is at the start of
one of the two instructions. We optimize for finding the PC at
the start, as will be the case when the trampoline is not the
first frame on the stack. We assume that in the case where the
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
return 0;
if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
{
if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
return 0;
pc -= LINUX_RT_SIGTRAMP_OFFSET1;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf,
LINUX_RT_SIGTRAMP_LEN))
return 0;
}
if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
return 0;
return pc;
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* Return whether THIS_FRAME corresponds to a GNU/Linux 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
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
i386_linux_sigtramp_p (struct frame_info *this_frame)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
char *name;
find_pc_partial_function (pc, &name, NULL, NULL);
/* If we have NAME, we can optimize the search. The trampolines are
named __restore and __restore_rt. However, they aren't dynamically
exported from the shared C library, so the trampoline may appear to
be part of the preceding function. This should always be sigaction,
__sigaction, or __libc_sigaction (all aliases to the same function). */
if (name == NULL || strstr (name, "sigaction") != NULL)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return (i386_linux_sigtramp_start (this_frame) != 0
|| i386_linux_rt_sigtramp_start (this_frame) != 0);
return (strcmp ("__restore", name) == 0
|| strcmp ("__restore_rt", name) == 0);
}
/* Return one if the PC of THIS_FRAME is in a signal trampoline which
may have DWARF-2 CFI. */
static int
i386_linux_dwarf_signal_frame_p (struct gdbarch *gdbarch,
struct frame_info *this_frame)
{
CORE_ADDR pc = get_frame_pc (this_frame);
char *name;
find_pc_partial_function (pc, &name, NULL, NULL);
/* If a vsyscall DSO is in use, the signal trampolines may have these
names. */
if (name && (strcmp (name, "__kernel_sigreturn") == 0
|| strcmp (name, "__kernel_rt_sigreturn") == 0))
return 1;
return 0;
}
* 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
/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* Assuming THIS_FRAME is a GNU/Linux sigtramp routine, return the
address of the associated sigcontext structure. */
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
i386_linux_sigcontext_addr (struct frame_info *this_frame)
{
CORE_ADDR pc;
* 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
CORE_ADDR sp;
gdb_byte 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
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
get_frame_register (this_frame, 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);
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
pc = i386_linux_sigtramp_start (this_frame);
if (pc)
{
* 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
/* The sigcontext structure lives on the stack, right after
the signum argument. We determine the address of the
sigcontext structure by looking at the frame's stack
pointer. Keep in mind that the first instruction of the
sigtramp code is "pop %eax". If the PC is after this
instruction, adjust the returned value accordingly. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (pc == get_frame_pc (this_frame))
return sp + 4;
return sp;
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
pc = i386_linux_rt_sigtramp_start (this_frame);
if (pc)
{
* 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
CORE_ADDR ucontext_addr;
/* The sigcontext structure is part of the user context. A
pointer to the user context is passed as the third argument
to the signal handler. */
read_memory (sp + 8, buf, 4);
ucontext_addr = 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 ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
}
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("Couldn't recognize signal trampoline."));
return 0;
}
/* Set the program counter for process PTID to PC. */
* 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
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
regcache_cooked_write_unsigned (regcache, I386_EIP_REGNUM, pc);
/* We must be careful with modifying the program counter. If we
just interrupted a system call, the kernel might try to restart
it when we resume the inferior. On restarting the system call,
the kernel will try backing up the program counter even though it
no longer points at the system call. This typically results in a
SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
"orig_eax" pseudo-register.
Note that "orig_eax" is saved when setting up a dummy call frame.
This means that it is properly restored when that frame is
popped, and that the interrupted system call will be restarted
when we resume the inferior on return from a function call from
within GDB. In all other cases the system call will not be
restarted. */
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
}
/* Parse the arguments of current system call instruction and record
the values of the registers and memory that will be changed into
"record_arch_list". This instruction is "int 0x80" (Linux
Kernel2.4) or "sysenter" (Linux Kernel 2.6).
Return -1 if something wrong. */
static struct linux_record_tdep i386_linux_record_tdep;
static int
i386_linux_intx80_sysenter_record (struct regcache *regcache)
{
int ret;
uint32_t tmpu32;
regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *)&tmpu32);
ret = record_linux_system_call (tmpu32, regcache,
&i386_linux_record_tdep);
if (ret)
return ret;
/* Record the return value of the system call. */
if (record_arch_list_add_reg (regcache, I386_EAX_REGNUM))
return -1;
return 0;
}
* 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
/* The register sets used in GNU/Linux ELF core-dumps are identical to
the register sets in `struct user' that are used for a.out
core-dumps. These are also used by ptrace(2). The corresponding
types are `elf_gregset_t' for the general-purpose registers (with
`elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
for the floating-point registers.
Those types used to be available under the names `gregset_t' and
`fpregset_t' too, and GDB used those names in the past. But those
names are now used for the register sets used in the `mcontext_t'
type, which have a different size and layout. */
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register cache layout. */
/* From <sys/reg.h>. */
static int i386_linux_gregset_reg_offset[] =
{
6 * 4, /* %eax */
1 * 4, /* %ecx */
2 * 4, /* %edx */
0 * 4, /* %ebx */
15 * 4, /* %esp */
5 * 4, /* %ebp */
3 * 4, /* %esi */
4 * 4, /* %edi */
12 * 4, /* %eip */
14 * 4, /* %eflags */
13 * 4, /* %cs */
16 * 4, /* %ss */
7 * 4, /* %ds */
8 * 4, /* %es */
9 * 4, /* %fs */
10 * 4, /* %gs */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1,
11 * 4 /* "orig_eax" */
};
/* Mapping between the general-purpose registers in `struct
sigcontext' format and GDB's register cache layout. */
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 <asm/sigcontext.h>. */
static int i386_linux_sc_reg_offset[] =
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
{
11 * 4, /* %eax */
10 * 4, /* %ecx */
9 * 4, /* %edx */
8 * 4, /* %ebx */
7 * 4, /* %esp */
6 * 4, /* %ebp */
5 * 4, /* %esi */
4 * 4, /* %edi */
14 * 4, /* %eip */
16 * 4, /* %eflags */
15 * 4, /* %cs */
18 * 4, /* %ss */
3 * 4, /* %ds */
2 * 4, /* %es */
1 * 4, /* %fs */
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
i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* GNU/Linux uses ELF. */
i386_elf_init_abi (info, gdbarch);
/* Since we have the extra "orig_eax" register on GNU/Linux, we have
to adjust a few things. */
set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
set_gdbarch_num_regs (gdbarch, I386_LINUX_NUM_REGS);
* 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
set_gdbarch_register_name (gdbarch, i386_linux_register_name);
set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p);
* 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->gregset_reg_offset = i386_linux_gregset_reg_offset;
tdep->gregset_num_regs = ARRAY_SIZE (i386_linux_gregset_reg_offset);
tdep->sizeof_gregset = 17 * 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
tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
tdep->sigtramp_p = i386_linux_sigtramp_p;
tdep->sigcontext_addr = i386_linux_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 = i386_linux_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
* 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
set_gdbarch_process_record (gdbarch, i386_process_record);
/* Initialize the i386_linux_record_tdep. */
/* These values are the size of the type that will be used in a system
call. They are obtained from Linux Kernel source. */
i386_linux_record_tdep.size__old_kernel_stat = 32;
i386_linux_record_tdep.size_tms = 16;
i386_linux_record_tdep.size_loff_t = 8;
i386_linux_record_tdep.size_flock = 16;
i386_linux_record_tdep.size_oldold_utsname = 45;
i386_linux_record_tdep.size_ustat = 20;
i386_linux_record_tdep.size_old_sigaction = 140;
i386_linux_record_tdep.size_old_sigset_t = 128;
i386_linux_record_tdep.size_rlimit = 8;
i386_linux_record_tdep.size_rusage = 72;
i386_linux_record_tdep.size_timeval = 8;
i386_linux_record_tdep.size_timezone = 8;
i386_linux_record_tdep.size_old_gid_t = 2;
i386_linux_record_tdep.size_old_uid_t = 2;
i386_linux_record_tdep.size_fd_set = 128;
i386_linux_record_tdep.size_dirent = 268;
i386_linux_record_tdep.size_dirent64 = 276;
i386_linux_record_tdep.size_statfs = 64;
i386_linux_record_tdep.size_statfs64 = 84;
i386_linux_record_tdep.size_sockaddr = 16;
i386_linux_record_tdep.size_int = 4;
i386_linux_record_tdep.size_long = 4;
i386_linux_record_tdep.size_ulong = 4;
i386_linux_record_tdep.size_msghdr = 28;
i386_linux_record_tdep.size_itimerval = 16;
i386_linux_record_tdep.size_stat = 88;
i386_linux_record_tdep.size_old_utsname = 325;
i386_linux_record_tdep.size_sysinfo = 64;
i386_linux_record_tdep.size_msqid_ds = 88;
i386_linux_record_tdep.size_shmid_ds = 84;
i386_linux_record_tdep.size_new_utsname = 390;
i386_linux_record_tdep.size_timex = 128;
i386_linux_record_tdep.size_mem_dqinfo = 24;
i386_linux_record_tdep.size_if_dqblk = 68;
i386_linux_record_tdep.size_fs_quota_stat = 68;
i386_linux_record_tdep.size_timespec = 8;
i386_linux_record_tdep.size_pollfd = 8;
i386_linux_record_tdep.size_NFS_FHSIZE = 32;
i386_linux_record_tdep.size_knfsd_fh = 132;
i386_linux_record_tdep.size_TASK_COMM_LEN = 16;
i386_linux_record_tdep.size_sigaction = 140;
i386_linux_record_tdep.size_sigset_t = 8;
i386_linux_record_tdep.size_siginfo_t = 128;
i386_linux_record_tdep.size_cap_user_data_t = 12;
i386_linux_record_tdep.size_stack_t = 12;
i386_linux_record_tdep.size_off_t = i386_linux_record_tdep.size_long;
i386_linux_record_tdep.size_stat64 = 96;
i386_linux_record_tdep.size_gid_t = 2;
i386_linux_record_tdep.size_uid_t = 2;
i386_linux_record_tdep.size_PAGE_SIZE = 4096;
i386_linux_record_tdep.size_flock64 = 24;
i386_linux_record_tdep.size_user_desc = 16;
i386_linux_record_tdep.size_io_event = 32;
i386_linux_record_tdep.size_iocb = 64;
i386_linux_record_tdep.size_epoll_event = 12;
i386_linux_record_tdep.size_itimerspec = i386_linux_record_tdep.size_timespec * 2;
i386_linux_record_tdep.size_mq_attr = 32;
i386_linux_record_tdep.size_siginfo = 128;
i386_linux_record_tdep.size_termios = 36;
i386_linux_record_tdep.size_termios2 = 44;
i386_linux_record_tdep.size_pid_t = 4;
i386_linux_record_tdep.size_winsize = 8;
i386_linux_record_tdep.size_serial_struct = 60;
i386_linux_record_tdep.size_serial_icounter_struct = 80;
i386_linux_record_tdep.size_hayes_esp_config = 12;
/* These values are the second argument of system call "sys_ioctl".
They are obtained from Linux Kernel source. */
i386_linux_record_tdep.ioctl_TCGETS = 0x5401;
i386_linux_record_tdep.ioctl_TCSETS = 0x5402;
i386_linux_record_tdep.ioctl_TCSETSW = 0x5403;
i386_linux_record_tdep.ioctl_TCSETSF = 0x5404;
i386_linux_record_tdep.ioctl_TCGETA = 0x5405;
i386_linux_record_tdep.ioctl_TCSETA = 0x5406;
i386_linux_record_tdep.ioctl_TCSETAW = 0x5407;
i386_linux_record_tdep.ioctl_TCSETAF = 0x5408;
i386_linux_record_tdep.ioctl_TCSBRK = 0x5409;
i386_linux_record_tdep.ioctl_TCXONC = 0x540A;
i386_linux_record_tdep.ioctl_TCFLSH = 0x540B;
i386_linux_record_tdep.ioctl_TIOCEXCL = 0x540C;
i386_linux_record_tdep.ioctl_TIOCNXCL = 0x540D;
i386_linux_record_tdep.ioctl_TIOCSCTTY = 0x540E;
i386_linux_record_tdep.ioctl_TIOCGPGRP = 0x540F;
i386_linux_record_tdep.ioctl_TIOCSPGRP = 0x5410;
i386_linux_record_tdep.ioctl_TIOCOUTQ = 0x5411;
i386_linux_record_tdep.ioctl_TIOCSTI = 0x5412;
i386_linux_record_tdep.ioctl_TIOCGWINSZ = 0x5413;
i386_linux_record_tdep.ioctl_TIOCSWINSZ = 0x5414;
i386_linux_record_tdep.ioctl_TIOCMGET = 0x5415;
i386_linux_record_tdep.ioctl_TIOCMBIS = 0x5416;
i386_linux_record_tdep.ioctl_TIOCMBIC = 0x5417;
i386_linux_record_tdep.ioctl_TIOCMSET = 0x5418;
i386_linux_record_tdep.ioctl_TIOCGSOFTCAR = 0x5419;
i386_linux_record_tdep.ioctl_TIOCSSOFTCAR = 0x541A;
i386_linux_record_tdep.ioctl_FIONREAD = 0x541B;
i386_linux_record_tdep.ioctl_TIOCINQ = i386_linux_record_tdep.ioctl_FIONREAD;
i386_linux_record_tdep.ioctl_TIOCLINUX = 0x541C;
i386_linux_record_tdep.ioctl_TIOCCONS = 0x541D;
i386_linux_record_tdep.ioctl_TIOCGSERIAL = 0x541E;
i386_linux_record_tdep.ioctl_TIOCSSERIAL = 0x541F;
i386_linux_record_tdep.ioctl_TIOCPKT = 0x5420;
i386_linux_record_tdep.ioctl_FIONBIO = 0x5421;
i386_linux_record_tdep.ioctl_TIOCNOTTY = 0x5422;
i386_linux_record_tdep.ioctl_TIOCSETD = 0x5423;
i386_linux_record_tdep.ioctl_TIOCGETD = 0x5424;
i386_linux_record_tdep.ioctl_TCSBRKP = 0x5425;
i386_linux_record_tdep.ioctl_TIOCTTYGSTRUCT = 0x5426;
i386_linux_record_tdep.ioctl_TIOCSBRK = 0x5427;
i386_linux_record_tdep.ioctl_TIOCCBRK = 0x5428;
i386_linux_record_tdep.ioctl_TIOCGSID = 0x5429;
i386_linux_record_tdep.ioctl_TCGETS2 = 0x802c542a;
i386_linux_record_tdep.ioctl_TCSETS2 = 0x402c542b;
i386_linux_record_tdep.ioctl_TCSETSW2 = 0x402c542c;
i386_linux_record_tdep.ioctl_TCSETSF2 = 0x402c542d;
i386_linux_record_tdep.ioctl_TIOCGPTN = 0x80045430;
i386_linux_record_tdep.ioctl_TIOCSPTLCK = 0x40045431;
i386_linux_record_tdep.ioctl_FIONCLEX = 0x5450;
i386_linux_record_tdep.ioctl_FIOCLEX = 0x5451;
i386_linux_record_tdep.ioctl_FIOASYNC = 0x5452;
i386_linux_record_tdep.ioctl_TIOCSERCONFIG = 0x5453;
i386_linux_record_tdep.ioctl_TIOCSERGWILD = 0x5454;
i386_linux_record_tdep.ioctl_TIOCSERSWILD = 0x5455;
i386_linux_record_tdep.ioctl_TIOCGLCKTRMIOS = 0x5456;
i386_linux_record_tdep.ioctl_TIOCSLCKTRMIOS = 0x5457;
i386_linux_record_tdep.ioctl_TIOCSERGSTRUCT = 0x5458;
i386_linux_record_tdep.ioctl_TIOCSERGETLSR = 0x5459;
i386_linux_record_tdep.ioctl_TIOCSERGETMULTI = 0x545A;
i386_linux_record_tdep.ioctl_TIOCSERSETMULTI = 0x545B;
i386_linux_record_tdep.ioctl_TIOCMIWAIT = 0x545C;
i386_linux_record_tdep.ioctl_TIOCGICOUNT = 0x545D;
i386_linux_record_tdep.ioctl_TIOCGHAYESESP = 0x545E;
i386_linux_record_tdep.ioctl_TIOCSHAYESESP = 0x545F;
i386_linux_record_tdep.ioctl_FIOQSIZE = 0x5460;
/* These values are the second argument of system call "sys_fcntl"
and "sys_fcntl64". They are obtained from Linux Kernel source. */
i386_linux_record_tdep.fcntl_F_GETLK = 5;
i386_linux_record_tdep.fcntl_F_GETLK64 = 12;
i386_linux_record_tdep.fcntl_F_SETLK64 = 13;
i386_linux_record_tdep.fcntl_F_SETLKW64 = 14;
i386_linux_record_tdep.arg1 = I386_EBX_REGNUM;
i386_linux_record_tdep.arg2 = I386_ECX_REGNUM;
i386_linux_record_tdep.arg3 = I386_EDX_REGNUM;
i386_linux_record_tdep.arg4 = I386_ESI_REGNUM;
i386_linux_record_tdep.arg5 = I386_EDI_REGNUM;
tdep->i386_intx80_record = i386_linux_intx80_sysenter_record;
tdep->i386_sysenter_record = i386_linux_intx80_sysenter_record;
* gdbarch.sh (sofun_address_maybe_missing): New gdbarch variable. * gdbarch.c, gdbarch.h: Regenerate. * dbxread.c (find_stab_function_addr): Define unconditionally. (read_dbx_symtab): Use gdbarch_sofun_address_maybe_missing instead of SOFUN_ADDRESS_MAYBE_MISSING. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_partial_symbols): Likewise. * symtab.h (struct minimal_symbol): Always define "filename" member. * elfread.c (elf_symtab_read): Use msym->filename unconditionally. * minsyms.c (lookup_minimal_symbol): Likewise. * symmisc.c (dump_msymbols): Likewise. * config/i386/i386sol2.mt (DEPRECATED_TM_FILE): Remove. * config/i386/linux.mt (DEPRECATED_TM_FILE): Remove. * config/i386/tm-i386sol2.h: Remove file. * config/i386/tm-linux.h: Remove file. * i386-linux-tdep.c (i386_linux_init_abi): Add call to set_gdbarch_sofun_address_maybe_missing. * i386-sol2-tdep.c (i386_sol2_init_abi): Likewise. * config/powerpc/linux.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/nbsd.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/obsd.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/ppc-eabi.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/ppc-sim.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/tm-ppc-eabi.h: Remove file. * rs6000-tdep.c (rs6000_gdbarch_init): Add call to set_gdbarch_sofun_address_maybe_missing. * config/sparc/sol2-64.mt (DEPRECATED_TM_FILE): Remove. * config/sparc/sol2.mt (DEPRECATED_TM_FILE): Remove. * config/sparc/tm-sol2.h: Remove file. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Add call to set_gdbarch_sofun_address_maybe_missing. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise. doc/ChangeLog: * gdbarch.texi (Target Conditionals): Remove documentation of SOFUN_ADDRESS_MAYBE_MISSING, replaced by ... (Compiler Characteristics): ... documentation of set_gdbarch_sofun_address_maybe_missing.
2007-10-19 14:26:35 +02:00
/* N_FUN symbols in shared libaries have 0 for their values and need
to be relocated. */
set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
/* GNU/Linux uses SVR4-style shared libraries. */
* config/tm-linux.h: Delete file. * config/alpha/alpha-linux.mt (DEPRECATED_TM_FILE): Set to tm-alpha.h. * config/alpha/tm-alphalinux.h: Delete file. * config/arm/linux.mt (DEPRECATED_TM_FILE): Set to tm-arm.h * config/arm/tm-linux.h: Delete file. * config/i386/tm-linux.h: Do not include "config/tm-linux.h". * config/ia64/tm-linux.h: Do not include "config/tm-linux.h". * config/m32r/linux.mt (DEPRECATED_TM_FILE): Remove. * config/mips/tm-linux.h: Do not include "config/tm-linux.h". * config/pa/linux.mt (DEPRECATED_TM_FILE): Set to tm-hppa.h. * config/pa/tm-linux.h: Delete file. * config/powerpc/tm-linux.h: Do not include "config/tm-linux.h". * config/s390/linux.mt (DEPRECATED_TM_FILE): Remove. * config/sh/linux.mt (DEPRECATED_TM_FILE): Set to tm-sh.h. * config/sh/tm-linux.h: Delete file. * alpha-linux-tdep.c: Include "symtab.h". (alpha_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * i386-linux-tdep.c: Include "symtab.h". (i386_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * ia64-linux-tdep.c: Include "symtab.h". (ia64_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * m32r-linux-tdep.c: Include "symtab.h". (m32r_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * mips-linux-tdep.c: Include "symtab.h". (mips_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * sh-linux-tdep.c: Include "symtab.h". (sh_linux_init_abi): Call set_gdbarch_skip_trampoline_code. * s390-tdep.c (s390_gdbarch_init): Call set_gdbarch_skip_trampoline_code. * s390-nat.c: Do not include "tm.h". * Makefile.in (alpha-linux-tdep.o): Add dependency on $(symtab_h). (i386-linux-tdep.o): Likewise. (ia64-linux-tdep.o): Likewise. (m32r-linux-tdep.o): Likewise. (mips-linux-tdep.o): Likewise. (sh-linux-tdep.o): Likewise. (s390-nat.o): Remove dependency on $(tm_h).
2006-11-28 22:41:03 +01:00
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
/* GNU/Linux uses the dynamic linker included in the GNU C Library. */
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
Implement displaced stepping. gdb/ * gdbarch.sh (max_insn_length): New 'variable'. (displaced_step_copy, displaced_step_fixup) (displaced_step_free_closure, displaced_step_location): New functions. (struct displaced_step_closure): Add forward declaration. * gdbarch.c, gdbarch.h: Regenerated. * arch-utils.c: #include "objfiles.h". (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New functions. * arch-utils.h (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New prototypes. * i386-tdep.c (I386_MAX_INSN_LEN): Rename to... (I386_MAX_MATCHED_INSN_LEN): ... this. (i386_absolute_jmp_p, i386_absolute_call_p) (i386_ret_p, i386_call_p, i386_breakpoint_p, i386_syscall_p) (i386_displaced_step_fixup): New functions. (struct i386_insn, i386_match_insn): Update. (i386_gdbarch_init): Set gdbarch_max_insn_length. * i386-tdep.h (I386_MAX_INSN_LEN): New. (i386_displaced_step_fixup): New prototype. * i386-linux-tdep.c (i386_linux_init_abi): Include "arch-utils.h". Register gdbarch_displaced_step_copy, gdbarch_displaced_step_fixup, gdbarch_displaced_step_free_closure, and gdbarch_displaced_step_location functions. * infrun.c (debug_displaced): New variable. (show_debug_displaced): New function. (struct displaced_step_request): New struct. (displaced_step_request_queue, displaced_step_ptid) (displaced_step_gdbarch, displaced_step_closure) (displaced_step_original, displaced_step_copy) (displaced_step_saved_copy, can_use_displaced_stepping): New variables. (show_can_use_displaced_stepping, use_displaced_stepping) (displaced_step_clear, cleanup_displaced_step_closure) (displaced_step_dump_bytes, displaced_step_prepare) (displaced_step_clear_cleanup, write_memory_ptid) (displaced_step_fixup): New functions. (resume): Call displaced_step_prepare. (proceed): Call read_pc once, and remember the value. If using displaced stepping, don't remove breakpoints. (handle_inferior_event): Call displaced_step_fixup. Add some debugging output. When we try to step over a breakpoint, but get a signal to deliver to the thread instead, ensure the step-resume breakpoint is actually inserted. If a thread hop is needed, and displaced stepping is enabled, don't remove breakpoints. (init_wait_for_inferior): Call displaced_step_clear. (_initialize_infrun): Add "set debug displaced" command. Add "maint set can-use-displaced-stepping" command. Clear displaced_step_ptid. * inferior.h (debug_displaced): Declare variable. (displaced_step_dump_bytes): Declare function. * Makefile.in (arch-utils.o, i386-linux-tdep.o): Update dependencies. gdb/testsuite/ * gdb.asm/asmsrc1.s: Add scratch space. gdb/doc/ * gdb.texinfo (Debugging Output): Document "set/show debug displaced". (Maintenance Commands): Document "maint set/show can-use-displaced-stepping".
2008-05-02 18:49:54 +02:00
/* Install supported register note sections. */
set_gdbarch_core_regset_sections (gdbarch, i386_linux_regset_sections);
Implement displaced stepping. gdb/ * gdbarch.sh (max_insn_length): New 'variable'. (displaced_step_copy, displaced_step_fixup) (displaced_step_free_closure, displaced_step_location): New functions. (struct displaced_step_closure): Add forward declaration. * gdbarch.c, gdbarch.h: Regenerated. * arch-utils.c: #include "objfiles.h". (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New functions. * arch-utils.h (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New prototypes. * i386-tdep.c (I386_MAX_INSN_LEN): Rename to... (I386_MAX_MATCHED_INSN_LEN): ... this. (i386_absolute_jmp_p, i386_absolute_call_p) (i386_ret_p, i386_call_p, i386_breakpoint_p, i386_syscall_p) (i386_displaced_step_fixup): New functions. (struct i386_insn, i386_match_insn): Update. (i386_gdbarch_init): Set gdbarch_max_insn_length. * i386-tdep.h (I386_MAX_INSN_LEN): New. (i386_displaced_step_fixup): New prototype. * i386-linux-tdep.c (i386_linux_init_abi): Include "arch-utils.h". Register gdbarch_displaced_step_copy, gdbarch_displaced_step_fixup, gdbarch_displaced_step_free_closure, and gdbarch_displaced_step_location functions. * infrun.c (debug_displaced): New variable. (show_debug_displaced): New function. (struct displaced_step_request): New struct. (displaced_step_request_queue, displaced_step_ptid) (displaced_step_gdbarch, displaced_step_closure) (displaced_step_original, displaced_step_copy) (displaced_step_saved_copy, can_use_displaced_stepping): New variables. (show_can_use_displaced_stepping, use_displaced_stepping) (displaced_step_clear, cleanup_displaced_step_closure) (displaced_step_dump_bytes, displaced_step_prepare) (displaced_step_clear_cleanup, write_memory_ptid) (displaced_step_fixup): New functions. (resume): Call displaced_step_prepare. (proceed): Call read_pc once, and remember the value. If using displaced stepping, don't remove breakpoints. (handle_inferior_event): Call displaced_step_fixup. Add some debugging output. When we try to step over a breakpoint, but get a signal to deliver to the thread instead, ensure the step-resume breakpoint is actually inserted. If a thread hop is needed, and displaced stepping is enabled, don't remove breakpoints. (init_wait_for_inferior): Call displaced_step_clear. (_initialize_infrun): Add "set debug displaced" command. Add "maint set can-use-displaced-stepping" command. Clear displaced_step_ptid. * inferior.h (debug_displaced): Declare variable. (displaced_step_dump_bytes): Declare function. * Makefile.in (arch-utils.o, i386-linux-tdep.o): Update dependencies. gdb/testsuite/ * gdb.asm/asmsrc1.s: Add scratch space. gdb/doc/ * gdb.texinfo (Debugging Output): Document "set/show debug displaced". (Maintenance Commands): Document "maint set/show can-use-displaced-stepping".
2008-05-02 18:49:54 +02:00
/* Displaced stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch,
simple_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, i386_displaced_step_fixup);
set_gdbarch_displaced_step_free_closure (gdbarch,
simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
displaced_step_at_entry_point);
2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/ * target.h (enum target_object): Add new TARGET_OBJECT_SIGNAL_INFO. * infrun.c (siginfo_value_read, siginfo_value_write): New. (siginfo_value_funcs): New. (siginfo_make_value): New. (_initialize_infrun): Create the $_siginfo convenience variable. * gdbtypes.h (append_composite_type_field_aligned): Declare. * gdbtypes.c (append_composite_type_field): Rename to... (append_composite_type_field_aligned): ... this. Add ALIGNMENT argument. Handle it. (append_composite_type_field): Rewrite on top of append_composite_type_field_aligned. * value.h (internalvar_make_value): New typedef. (struct internalvar) <make_value>: New field. (create_internalvar_type_lazy): Declare. * value.c (create_internalvar): Clear make_value. (create_internalvar_type_lazy): New. (value_of_internalvar): If make_value is set use it. (preserve_values): Skip internal variables that don't have a value. * gdbarch.sh (get_siginfo_type): New. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.h, linux-tdep.c: New. * amd64-linux-tdep.c: Include "linux-tdep.h". (amd64_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * i386-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * arm-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * linux-nat.c (linux_xfer_siginfo): New. (linux_nat_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. * remote.c (PACKET_qXfer_siginfo_read) (PACKET_qXfer_siginfo_write): New. (feature remote_protocol_features): Add "qXfer:siginfo:read" and "qXfer:siginfo:write" features. (remote_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. (_initialize_remote): Add "set/show remote read-siginfo-object" and "set/show remote write-siginfo-object" commands. * Makefile.in (ALL_TARGET_OBS): Add linux-tdep.o. (HFILES_NO_SRCDIR): Add linux-tdep.h. (ALLDEPFILES): Add linux-tdep.c. * configure.tgt (arm*-*-linux* | arm*-*-uclinux*) (i[34567]86-*-linux*, x86_64-*-linux*): Add linux-tdep.o to gdb_target_obs. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/gdbserver/ * server.c (handle_query): Report qXfer:siginfo:read and qXfer:siginfo:write as supported and handle them. * target.h (struct target_ops) <qxfer_siginfo>: New field. * linux-low.c (linux_xfer_siginfo): New. (linux_target_ops): Set it. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/doc/ * gdb.texinfo (Signals): Document $_siginfo. (Convenience Variables): Mention $_siginfo. (Remote Configuration): Document qXfer:siginfo:read, qXfer:siginfo:write packets, and the read-siginfo-object, write-siginfo-object commands. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * gdb.base/siginfo-obj.c, gdb.base/siginfo-obj.exp: New.
2009-02-06 23:59:01 +01:00
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
* 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
}
/* Provide a prototype to silence -Wmissing-prototypes. */
extern void _initialize_i386_linux_tdep (void);
void
_initialize_i386_linux_tdep (void)
{
* 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_LINUX,
* 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
i386_linux_init_abi);
}