binutils-gdb/gdb/config/sparc/tm-sparclet.h

159 lines
5.6 KiB
C
Raw Normal View History

/* Target machine definitions for GDB for an embedded SPARC.
2001-03-06 09:22:02 +01:00
Copyright 1996, 1997, 2000 Free Software Foundation, Inc.
1999-07-07 22:19:36 +02:00
This file is part of GDB.
1999-07-07 22:19:36 +02:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
1999-07-07 22:19:36 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1999-07-07 22:19:36 +02:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
2001-03-15 00:23:16 +01:00
#include "regcache.h"
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com> Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). * sparc-tdep.c: include arch-utils.h. (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. (GDB_TARGET_IS_SPARC64): make into a runtime test. (struct frame_extra_info): Define, use instead of the macro. (Many places): Use alloca instead of statically allocated buffers that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. (sparc_extract_struct_value_address): Accept a pointer arg instead of an array sized by REGISTER_BYTES. (examine_prologue): Accept a pointer to an array of CORE_ADDR, instead of the defunct struct frame_saved_regs. Recognize new Sparc64 store instructions as part of the prologue. Ignore the destination of a frame store when parsing the prologue (so long as it's on the stack). (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR instead of the defunct struct frame_saved_regs. (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to supply_register. Provide 4-byte offset to compensate for diff between size of the prgreg_t elements on a 64-bit host and size of the registers for a 32-bit target. Fill all inaccessible regs with zero so they won't keep being requested again and again. (fill_gregset): Handle 32/64 size difference between registers and prgreg_t. Handle as many new 64-bit regs as possible. (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. (sparc_push_arguments): Rename to sparc32_push_arguments. Copy arguments into registers as well as onto stack, so that the CALL_DUMMY (code pushed onto the target stack) is not required. (sparc_extract_return_value): Rename to sparc32_extract_return_value. (sparc_store_return_value): Use memset instead of bzero. Use write_register_gen instead of write_register_bytes. (sparclet_store_return_value): New function. (_initialize_sparc_tdep): Call register_gdbarch_init to activate the gdbarch multi-architecture system. (sp64_push_arguments): Rename to sparc64_push_arguments. Extend to store arguments in general registers as well as on stack. (sparc64_extract_return_value): Rename to sp64_extract_return_value. Use as a private function, to be called by the new external function sparc64_extract_return_value. (sparclet_extract_return_value): New function. (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, sparc64_register_name, sparc_print_extra_frame_info, sparclite_register_name, sparclet_register_name, sparc_push_return_address, sparc64_use_struct_convention, sparc32_store_struct_return, sparc64_store_struct_return, sparc32_register_virtual_type, sparc64_register_virtual_type, sparc32_register_size, sparc64_register_size, sparc32_register_byte, sparc64_register_byte, sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, sparc_convert_to_raw, sparc_frame_init_saved_regs, sparc_frame_address, sparc_gdbarch_fix_call_dummy, sparc_coerce_float_to_double, sparc_call_dummy_address, sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, sparc_return_value_on_stack): New functions supporting multi-arch. (sparc_gdbarch_init): New function; initialize multi-arch. (struct gdbarch_tdep): Define, use for private multi-arch data. * config/sparc/tm-sparc.h: Move definitions around, enclose with #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate definitions. Add enums for register names, to help debugging gdb. This header file must work for non-multi-arch and for multi-arch. * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. Define GDB_MULTI_ARCH. * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). * config/sparc/tm-sparclite.h: Ditto. * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to avoid using deprecated REGISTER_NAMES macro. * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 22:07:25 +02:00
#define TARGET_SPARCLET 1 /* Still needed for non-multi-arch case */
#include "sparc/tm-sparc.h"
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com> Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). * sparc-tdep.c: include arch-utils.h. (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. (GDB_TARGET_IS_SPARC64): make into a runtime test. (struct frame_extra_info): Define, use instead of the macro. (Many places): Use alloca instead of statically allocated buffers that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. (sparc_extract_struct_value_address): Accept a pointer arg instead of an array sized by REGISTER_BYTES. (examine_prologue): Accept a pointer to an array of CORE_ADDR, instead of the defunct struct frame_saved_regs. Recognize new Sparc64 store instructions as part of the prologue. Ignore the destination of a frame store when parsing the prologue (so long as it's on the stack). (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR instead of the defunct struct frame_saved_regs. (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to supply_register. Provide 4-byte offset to compensate for diff between size of the prgreg_t elements on a 64-bit host and size of the registers for a 32-bit target. Fill all inaccessible regs with zero so they won't keep being requested again and again. (fill_gregset): Handle 32/64 size difference between registers and prgreg_t. Handle as many new 64-bit regs as possible. (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. (sparc_push_arguments): Rename to sparc32_push_arguments. Copy arguments into registers as well as onto stack, so that the CALL_DUMMY (code pushed onto the target stack) is not required. (sparc_extract_return_value): Rename to sparc32_extract_return_value. (sparc_store_return_value): Use memset instead of bzero. Use write_register_gen instead of write_register_bytes. (sparclet_store_return_value): New function. (_initialize_sparc_tdep): Call register_gdbarch_init to activate the gdbarch multi-architecture system. (sp64_push_arguments): Rename to sparc64_push_arguments. Extend to store arguments in general registers as well as on stack. (sparc64_extract_return_value): Rename to sp64_extract_return_value. Use as a private function, to be called by the new external function sparc64_extract_return_value. (sparclet_extract_return_value): New function. (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, sparc64_register_name, sparc_print_extra_frame_info, sparclite_register_name, sparclet_register_name, sparc_push_return_address, sparc64_use_struct_convention, sparc32_store_struct_return, sparc64_store_struct_return, sparc32_register_virtual_type, sparc64_register_virtual_type, sparc32_register_size, sparc64_register_size, sparc32_register_byte, sparc64_register_byte, sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, sparc_convert_to_raw, sparc_frame_init_saved_regs, sparc_frame_address, sparc_gdbarch_fix_call_dummy, sparc_coerce_float_to_double, sparc_call_dummy_address, sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, sparc_return_value_on_stack): New functions supporting multi-arch. (sparc_gdbarch_init): New function; initialize multi-arch. (struct gdbarch_tdep): Define, use for private multi-arch data. * config/sparc/tm-sparc.h: Move definitions around, enclose with #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate definitions. Add enums for register names, to help debugging gdb. This header file must work for non-multi-arch and for multi-arch. * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. Define GDB_MULTI_ARCH. * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). * config/sparc/tm-sparclite.h: Ditto. * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to avoid using deprecated REGISTER_NAMES macro. * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 22:07:25 +02:00
/* Note: we are not defining GDB_MULTI_ARCH for the sparclet target
at this time, because we have not figured out how to detect the
sparclet target from the bfd structure. */
/* Sparclet regs, for debugging purposes. */
enum {
CCSR_REGNUM = 72,
CCPR_REGNUM = 73,
CCCRCR_REGNUM = 74,
CCOR_REGNUM = 75,
CCOBR_REGNUM = 76,
CCIBR_REGNUM = 77,
CCIR_REGNUM = 78
};
/* Select the sparclet disassembler. Slightly different instruction set from
the V8 sparc. */
#undef TM_PRINT_INSN_MACH
#define TM_PRINT_INSN_MACH bfd_mach_sparc_sparclet
/* overrides of tm-sparc.h */
#undef TARGET_BYTE_ORDER
/* Sequence of bytes for breakpoint instruction (ta 1). */
#undef BREAKPOINT
#define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
#define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com> Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). * sparc-tdep.c: include arch-utils.h. (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. (GDB_TARGET_IS_SPARC64): make into a runtime test. (struct frame_extra_info): Define, use instead of the macro. (Many places): Use alloca instead of statically allocated buffers that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. (sparc_extract_struct_value_address): Accept a pointer arg instead of an array sized by REGISTER_BYTES. (examine_prologue): Accept a pointer to an array of CORE_ADDR, instead of the defunct struct frame_saved_regs. Recognize new Sparc64 store instructions as part of the prologue. Ignore the destination of a frame store when parsing the prologue (so long as it's on the stack). (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR instead of the defunct struct frame_saved_regs. (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to supply_register. Provide 4-byte offset to compensate for diff between size of the prgreg_t elements on a 64-bit host and size of the registers for a 32-bit target. Fill all inaccessible regs with zero so they won't keep being requested again and again. (fill_gregset): Handle 32/64 size difference between registers and prgreg_t. Handle as many new 64-bit regs as possible. (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. (sparc_push_arguments): Rename to sparc32_push_arguments. Copy arguments into registers as well as onto stack, so that the CALL_DUMMY (code pushed onto the target stack) is not required. (sparc_extract_return_value): Rename to sparc32_extract_return_value. (sparc_store_return_value): Use memset instead of bzero. Use write_register_gen instead of write_register_bytes. (sparclet_store_return_value): New function. (_initialize_sparc_tdep): Call register_gdbarch_init to activate the gdbarch multi-architecture system. (sp64_push_arguments): Rename to sparc64_push_arguments. Extend to store arguments in general registers as well as on stack. (sparc64_extract_return_value): Rename to sp64_extract_return_value. Use as a private function, to be called by the new external function sparc64_extract_return_value. (sparclet_extract_return_value): New function. (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, sparc64_register_name, sparc_print_extra_frame_info, sparclite_register_name, sparclet_register_name, sparc_push_return_address, sparc64_use_struct_convention, sparc32_store_struct_return, sparc64_store_struct_return, sparc32_register_virtual_type, sparc64_register_virtual_type, sparc32_register_size, sparc64_register_size, sparc32_register_byte, sparc64_register_byte, sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, sparc_convert_to_raw, sparc_frame_init_saved_regs, sparc_frame_address, sparc_gdbarch_fix_call_dummy, sparc_coerce_float_to_double, sparc_call_dummy_address, sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, sparc_return_value_on_stack): New functions supporting multi-arch. (sparc_gdbarch_init): New function; initialize multi-arch. (struct gdbarch_tdep): Define, use for private multi-arch data. * config/sparc/tm-sparc.h: Move definitions around, enclose with #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate definitions. Add enums for register names, to help debugging gdb. This header file must work for non-multi-arch and for multi-arch. * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. Define GDB_MULTI_ARCH. * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). * config/sparc/tm-sparclite.h: Ditto. * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to avoid using deprecated REGISTER_NAMES macro. * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 22:07:25 +02:00
#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
/*
* The following defines must go away for MULTI_ARCH.
*/
1999-07-07 22:19:36 +02:00
#undef NUM_REGS /* formerly "72" */
/* WIN FP CPU CCP ASR AWR APSR */
#define NUM_REGS (32 + 32 + 8 + 8 + 8/*+ 32 + 1*/)
1999-07-07 22:19:36 +02:00
#undef REGISTER_BYTES /* formerly "(32*4 + 32*4 + 8*4)" */
#define REGISTER_BYTES (32*4 + 32*4 + 8*4 + 8*4 + 8*4/* + 32*4 + 1*4*/)
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
/* Sparclet has no fp! */
/* Compiler maps types for floats by number, so can't
change the numbers here. */
#undef REGISTER_NAMES
#define REGISTER_NAMES \
{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
"o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
"i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \
\
"", "", "", "", "", "", "", "", /* no FPU regs */ \
"", "", "", "", "", "", "", "", \
"", "", "", "", "", "", "", "", \
"", "", "", "", "", "", "", "", \
/* no CPSR, FPSR */ \
"y", "psr", "wim", "tbr", "pc", "npc", "", "", \
\
"ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "", \
\
/* ASR15 ASR19 (don't display them) */ \
"asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22", \
/* \
"awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7", \
"awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15", \
"awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23", \
"awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31", \
"apsr", \
*/ \
}
/* Remove FP dependant code which was defined in tm-sparc.h */
1999-07-07 22:19:36 +02:00
#undef FP0_REGNUM /* Floating point register 0 */
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com> Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). * sparc-tdep.c: include arch-utils.h. (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. (GDB_TARGET_IS_SPARC64): make into a runtime test. (struct frame_extra_info): Define, use instead of the macro. (Many places): Use alloca instead of statically allocated buffers that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. (sparc_extract_struct_value_address): Accept a pointer arg instead of an array sized by REGISTER_BYTES. (examine_prologue): Accept a pointer to an array of CORE_ADDR, instead of the defunct struct frame_saved_regs. Recognize new Sparc64 store instructions as part of the prologue. Ignore the destination of a frame store when parsing the prologue (so long as it's on the stack). (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR instead of the defunct struct frame_saved_regs. (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to supply_register. Provide 4-byte offset to compensate for diff between size of the prgreg_t elements on a 64-bit host and size of the registers for a 32-bit target. Fill all inaccessible regs with zero so they won't keep being requested again and again. (fill_gregset): Handle 32/64 size difference between registers and prgreg_t. Handle as many new 64-bit regs as possible. (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. (sparc_push_arguments): Rename to sparc32_push_arguments. Copy arguments into registers as well as onto stack, so that the CALL_DUMMY (code pushed onto the target stack) is not required. (sparc_extract_return_value): Rename to sparc32_extract_return_value. (sparc_store_return_value): Use memset instead of bzero. Use write_register_gen instead of write_register_bytes. (sparclet_store_return_value): New function. (_initialize_sparc_tdep): Call register_gdbarch_init to activate the gdbarch multi-architecture system. (sp64_push_arguments): Rename to sparc64_push_arguments. Extend to store arguments in general registers as well as on stack. (sparc64_extract_return_value): Rename to sp64_extract_return_value. Use as a private function, to be called by the new external function sparc64_extract_return_value. (sparclet_extract_return_value): New function. (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, sparc64_register_name, sparc_print_extra_frame_info, sparclite_register_name, sparclet_register_name, sparc_push_return_address, sparc64_use_struct_convention, sparc32_store_struct_return, sparc64_store_struct_return, sparc32_register_virtual_type, sparc64_register_virtual_type, sparc32_register_size, sparc64_register_size, sparc32_register_byte, sparc64_register_byte, sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, sparc_convert_to_raw, sparc_frame_init_saved_regs, sparc_frame_address, sparc_gdbarch_fix_call_dummy, sparc_coerce_float_to_double, sparc_call_dummy_address, sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, sparc_return_value_on_stack): New functions supporting multi-arch. (sparc_gdbarch_init): New function; initialize multi-arch. (struct gdbarch_tdep): Define, use for private multi-arch data. * config/sparc/tm-sparc.h: Move definitions around, enclose with #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate definitions. Add enums for register names, to help debugging gdb. This header file must work for non-multi-arch and for multi-arch. * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. Define GDB_MULTI_ARCH. * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). * config/sparc/tm-sparclite.h: Ditto. * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to avoid using deprecated REGISTER_NAMES macro. * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 22:07:25 +02:00
#undef FPS_REGNUM /* Floating point status register */
1999-07-07 22:19:36 +02:00
#undef CPS_REGNUM /* Coprocessor status register */
/* sparclet register numbers */
#define CCSR_REGNUM 72
+ * gdbarch.sh (DEPRECATED_EXTRACT_RETURN_VALUE): Rename + EXTRACT_RETURN_VALUE. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Rename + EXTRACT_STRUCT_VALUE_ADDRESS. + * gdbarch.h, gdbarch.c: Regenerate. + + * values.c (value_being_returned): Handle + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. + (EXTRACT_RETURN_VALUE): Define as DEPRECATED_EXTRACT_RETURN_VALUE. + + * arm-linux-tdep.c (arm_linux_init_abi): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + + * config/arc/tm-arc.h: Update. + * config/d30v/tm-d30v.h: Update. + * config/fr30/tm-fr30.h: Update. + * config/h8300/tm-h8300.h: Update. * config/h8500/tm-h8500.h: Update. * config/i386/tm-i386.h: Update. * config/i386/tm-ptx.h: Update. * config/i386/tm-symmetry.h: Update. * config/i960/tm-i960.h: Update. * config/m32r/tm-m32r.h: Update. * config/m68k/tm-delta68.h: Update. * config/m68k/tm-linux.h: Update. * config/m68k/tm-m68k.h: Update. * config/m88k/tm-m88k.h: Update. * config/mcore/tm-mcore.h: Update. * config/mips/tm-mips.h: Update. * config/mn10200/tm-mn10200.h: Update. * config/pa/tm-hppa.h: Update. * config/pa/tm-hppa64.h: Update. * config/sparc/tm-sp64.h: Update. * config/sparc/tm-sparc.h: Update. * config/sparc/tm-sparclet.h: Update. * config/z8k/tm-z8k.h: Update.
2002-06-15 00:55:51 +02:00
#undef DEPRECATED_EXTRACT_RETURN_VALUE
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ \
memcpy ((VALBUF), \
(char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \
(TYPE_LENGTH(TYPE) >= REGISTER_RAW_SIZE (O0_REGNUM) \
? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \
TYPE_LENGTH(TYPE)); \
}
Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.3144 diff -u -r1.3144 ChangeLog --- ChangeLog 23 Aug 2002 23:05:38 -0000 1.3144 +++ ChangeLog 23 Aug 2002 23:14:45 -0000 @@ -1,3 +1,53 @@ 2002-08-23 Andrew Cagney <cagney@redhat.com> * gdbarch.sh (STORE_RETURN_VALUE): Add regcache parameter. (DEPRECATED_STORE_RETURN_VALUE): New method. (EXTRACT_RETURN_VALUE): Make buffer parameter a void pointer. * gdbarch.h, gdbarch.c: Re-generate. * values.c (set_return_value): Pass current_regcache to STORE_RETURN_VALUE. * arch-utils.h (legacy_store_return_value): Declare. * arch-utils.c (legacy_store_return_value): New function. (legacy_extract_return_value): Update parameters. * config/pa/tm-hppa.h (DEPRECATED_STORE_RETURN_VALUE): Rename STORE_RETURN_VALUE. * config/pa/tm-hppa64.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/z8k/tm-z8k.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/sparc/tm-sparclet.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/mn10200/tm-mn10200.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/m68k/tm-linux.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/m68k/tm-delta68.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/m32r/tm-m32r.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/h8500/tm-h8500.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * config/h8300/tm-h8300.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. * i386-tdep.c (i386_extract_return_value): Update. * arch-utils.c (legacy_extract_return_value): Update. * frv-tdep.c (frv_gdbarch_init): Update. * cris-tdep.c (cris_gdbarch_init): Update. * d10v-tdep.c (d10v_gdbarch_init): Update. * rs6000-tdep.c (rs6000_gdbarch_init): Update. * m68k-tdep.c (m68k_gdbarch_init): Update. * mcore-tdep.c (mcore_gdbarch_init): Update. * mn10300-tdep.c (mn10300_gdbarch_init): Update. * s390-tdep.c (s390_gdbarch_init): Update. * sparc-tdep.c (sparc_gdbarch_init): Update. * sh-tdep.c (sh_gdbarch_init): Update. * x86-64-tdep.c (x86_64_gdbarch_init): Update. * v850-tdep.c (v850_gdbarch_init): Update. * avr-tdep.c (avr_gdbarch_init): Update. * ia64-tdep.c (ia64_gdbarch_init): Update. * ns32k-tdep.c (ns32k_gdbarch_init): Update. * vax-tdep.c (vax_gdbarch_init): Update. * alpha-tdep.c (alpha_gdbarch_init): Update. * arm-tdep.c (arm_gdbarch_init): Update. * mips-tdep.c (mips_gdbarch_init): Update. * i386-tdep.c (i386_gdbarch_init): Update. Index: doc/ChangeLog 2002-08-21 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Update STORE_RETURN_VALUE, mention regcache.
2002-08-24 02:21:37 +02:00
#undef DEPRECATED_STORE_RETURN_VALUE
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
/* Other values are returned in register %o0. */ \
deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
TYPE_LENGTH (TYPE)); \
}
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com> Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). * sparc-tdep.c: include arch-utils.h. (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. (GDB_TARGET_IS_SPARC64): make into a runtime test. (struct frame_extra_info): Define, use instead of the macro. (Many places): Use alloca instead of statically allocated buffers that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. (sparc_extract_struct_value_address): Accept a pointer arg instead of an array sized by REGISTER_BYTES. (examine_prologue): Accept a pointer to an array of CORE_ADDR, instead of the defunct struct frame_saved_regs. Recognize new Sparc64 store instructions as part of the prologue. Ignore the destination of a frame store when parsing the prologue (so long as it's on the stack). (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR instead of the defunct struct frame_saved_regs. (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to supply_register. Provide 4-byte offset to compensate for diff between size of the prgreg_t elements on a 64-bit host and size of the registers for a 32-bit target. Fill all inaccessible regs with zero so they won't keep being requested again and again. (fill_gregset): Handle 32/64 size difference between registers and prgreg_t. Handle as many new 64-bit regs as possible. (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. (sparc_push_arguments): Rename to sparc32_push_arguments. Copy arguments into registers as well as onto stack, so that the CALL_DUMMY (code pushed onto the target stack) is not required. (sparc_extract_return_value): Rename to sparc32_extract_return_value. (sparc_store_return_value): Use memset instead of bzero. Use write_register_gen instead of write_register_bytes. (sparclet_store_return_value): New function. (_initialize_sparc_tdep): Call register_gdbarch_init to activate the gdbarch multi-architecture system. (sp64_push_arguments): Rename to sparc64_push_arguments. Extend to store arguments in general registers as well as on stack. (sparc64_extract_return_value): Rename to sp64_extract_return_value. Use as a private function, to be called by the new external function sparc64_extract_return_value. (sparclet_extract_return_value): New function. (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, sparc64_register_name, sparc_print_extra_frame_info, sparclite_register_name, sparclet_register_name, sparc_push_return_address, sparc64_use_struct_convention, sparc32_store_struct_return, sparc64_store_struct_return, sparc32_register_virtual_type, sparc64_register_virtual_type, sparc32_register_size, sparc64_register_size, sparc32_register_byte, sparc64_register_byte, sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, sparc_convert_to_raw, sparc_frame_init_saved_regs, sparc_frame_address, sparc_gdbarch_fix_call_dummy, sparc_coerce_float_to_double, sparc_call_dummy_address, sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, sparc_return_value_on_stack): New functions supporting multi-arch. (sparc_gdbarch_init): New function; initialize multi-arch. (struct gdbarch_tdep): Define, use for private multi-arch data. * config/sparc/tm-sparc.h: Move definitions around, enclose with #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate definitions. Add enums for register names, to help debugging gdb. This header file must work for non-multi-arch and for multi-arch. * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. Define GDB_MULTI_ARCH. * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). * config/sparc/tm-sparclite.h: Ditto. * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to avoid using deprecated REGISTER_NAMES macro. * Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 22:07:25 +02:00
#endif /* GDB_MULTI_ARCH */
extern void sparclet_do_registers_info (int regnum, int all);
#undef DEPRECATED_DO_REGISTERS_INFO
#define DEPRECATED_DO_REGISTERS_INFO(REGNUM,ALL) sparclet_do_registers_info (REGNUM, ALL)
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
comment in <machine/setjmp.h>! */
#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
#define JB_ONSSTACK 0
#define JB_SIGMASK 1
#define JB_SP 2
#define JB_PC 3
#define JB_NPC 4
#define JB_PSR 5
#define JB_G1 6
#define JB_O0 7
#define JB_WBCNT 8
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
2000-05-28 03:12:42 +02:00
extern int get_longjmp_target (CORE_ADDR *);
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)