1999-04-16 09:35:26 +08:00
|
|
|
/* Target definitions for delta68.
|
2000-03-25 01:55:13 +08:00
|
|
|
Copyright 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This file is part of GDB.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08: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-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08: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-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08: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. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2001-03-15 07:23:16 +08:00
|
|
|
#include "regcache.h"
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
/* Define BPT_VECTOR if it is different than the default.
|
|
|
|
This is the vector number used by traps to indicate a breakpoint. */
|
|
|
|
|
|
|
|
#define BPT_VECTOR 0x1
|
|
|
|
|
|
|
|
#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%"
|
|
|
|
#define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%"
|
|
|
|
|
|
|
|
/* Amount PC must be decremented by after a breakpoint.
|
|
|
|
On the Delta, the kernel decrements it for us. */
|
|
|
|
|
|
|
|
#define DECR_PC_AFTER_BREAK 0
|
|
|
|
|
|
|
|
/* Not sure what happens if we try to store this register, but
|
|
|
|
phdm@info.ucl.ac.be says we need this define. */
|
|
|
|
|
|
|
|
#define CANNOT_STORE_REGISTER(regno) (regno == FPI_REGNUM)
|
|
|
|
|
|
|
|
/* Extract from an array REGBUF containing the (raw) register state
|
|
|
|
a function return value of type TYPE, and copy that, in virtual format,
|
|
|
|
into VALBUF. */
|
|
|
|
|
|
|
|
/* When it returns a float/double value, use fp0 in sysV68. */
|
|
|
|
/* When it returns a pointer value, use a0 in sysV68. */
|
|
|
|
|
2002-06-15 06:55:51 +08:00
|
|
|
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
1999-04-16 09:35:26 +08:00
|
|
|
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
|
|
|
|
REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
|
|
|
|
®BUF[REGISTER_BYTE (FP0_REGNUM)], \
|
|
|
|
VALBUF); \
|
|
|
|
else \
|
|
|
|
memcpy ((VALBUF), \
|
|
|
|
(char *) ((REGBUF) + \
|
|
|
|
(TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : \
|
|
|
|
(TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \
|
|
|
|
TYPE_LENGTH(TYPE))
|
|
|
|
|
|
|
|
/* Write into appropriate registers a function return value
|
|
|
|
of type TYPE, given in virtual format. */
|
|
|
|
|
|
|
|
/* When it returns a float/double value, use fp0 in sysV68. */
|
|
|
|
/* When it returns a pointer value, use a0 in sysV68. */
|
|
|
|
|
2002-08-24 08:21:37 +08:00
|
|
|
#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
|
1999-04-16 09:35:26 +08:00
|
|
|
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
|
|
|
|
{ \
|
|
|
|
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
|
|
|
|
REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 08:25:05 +08:00
|
|
|
deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
|
1999-04-16 09:35:26 +08:00
|
|
|
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
|
|
|
|
} \
|
|
|
|
else \
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 08:25:05 +08:00
|
|
|
deprecated_write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
|
1999-04-16 09:35:26 +08:00
|
|
|
VALBUF, TYPE_LENGTH (TYPE))
|
|
|
|
|
|
|
|
/* Return number of args passed to a frame.
|
|
|
|
Can return -1, meaning no way to tell. */
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int delta68_frame_num_args (struct frame_info *fi);
|
1999-06-08 03:19:32 +08:00
|
|
|
#define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
|
|
|
|
the processor's instruction cache as it should. */
|
|
|
|
#define CLEAR_INSN_CACHE() clear_insn_cache()
|
|
|
|
|
|
|
|
#include "m68k/tm-m68k.h"
|
|
|
|
|
|
|
|
/* Extract from an array REGBUF containing the (raw) register state
|
|
|
|
the address in which a function should return its structure value,
|
|
|
|
as a CORE_ADDR (or an expression that can be used as one). */
|
|
|
|
|
2002-06-15 06:55:51 +08:00
|
|
|
#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
|
|
|
|
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
|
1999-04-16 09:35:26 +08:00
|
|
|
(*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4))
|
* m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L
and P_LINK_W.
(P_PEA_FP, P_MOVL_SP_FP): New macros.
(P_MOVL, P_LEAL, P_MOVML): Macros renamed from P_MOV_L, P_LEA_L and
P_MOVM_L.
(altos_skip_prologue, isi_skip_prologue): Use P_* macros, not octal
constants.
(delta68_in_sigtramp): New function.
(delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
(m68k_skip_prologue): Use P_* macros, not hex constants.
(m68k_find_saved_regs): Do not expect a fixed sequence of register save
instructions, but accept them in any order; use P_* macros, not octal
or hex constants; recognize also `fmovemx to (fp + displacement)' and
`moveml to (fp + displacement)'.
* m68/tm-delta68.h (IN_SIGTRAMP): New macro.
(FRAME_SAVED_PC, FRAME_ARGS_ADDRESS): Ditto.
2000-03-24 19:12:11 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
|
* m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L
and P_LINK_W.
(P_PEA_FP, P_MOVL_SP_FP): New macros.
(P_MOVL, P_LEAL, P_MOVML): Macros renamed from P_MOV_L, P_LEA_L and
P_MOVM_L.
(altos_skip_prologue, isi_skip_prologue): Use P_* macros, not octal
constants.
(delta68_in_sigtramp): New function.
(delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
(m68k_skip_prologue): Use P_* macros, not hex constants.
(m68k_find_saved_regs): Do not expect a fixed sequence of register save
instructions, but accept them in any order; use P_* macros, not octal
or hex constants; recognize also `fmovemx to (fp + displacement)' and
`moveml to (fp + displacement)'.
* m68/tm-delta68.h (IN_SIGTRAMP): New macro.
(FRAME_SAVED_PC, FRAME_ARGS_ADDRESS): Ditto.
2000-03-24 19:12:11 +08:00
|
|
|
#define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name)
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi);
|
* m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L
and P_LINK_W.
(P_PEA_FP, P_MOVL_SP_FP): New macros.
(P_MOVL, P_LEAL, P_MOVML): Macros renamed from P_MOV_L, P_LEA_L and
P_MOVM_L.
(altos_skip_prologue, isi_skip_prologue): Use P_* macros, not octal
constants.
(delta68_in_sigtramp): New function.
(delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
(m68k_skip_prologue): Use P_* macros, not hex constants.
(m68k_find_saved_regs): Do not expect a fixed sequence of register save
instructions, but accept them in any order; use P_* macros, not octal
or hex constants; recognize also `fmovemx to (fp + displacement)' and
`moveml to (fp + displacement)'.
* m68/tm-delta68.h (IN_SIGTRAMP): New macro.
(FRAME_SAVED_PC, FRAME_ARGS_ADDRESS): Ditto.
2000-03-24 19:12:11 +08:00
|
|
|
#undef FRAME_SAVED_PC
|
|
|
|
#define FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi);
|
* m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L
and P_LINK_W.
(P_PEA_FP, P_MOVL_SP_FP): New macros.
(P_MOVL, P_LEAL, P_MOVML): Macros renamed from P_MOV_L, P_LEA_L and
P_MOVM_L.
(altos_skip_prologue, isi_skip_prologue): Use P_* macros, not octal
constants.
(delta68_in_sigtramp): New function.
(delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
(m68k_skip_prologue): Use P_* macros, not hex constants.
(m68k_find_saved_regs): Do not expect a fixed sequence of register save
instructions, but accept them in any order; use P_* macros, not octal
or hex constants; recognize also `fmovemx to (fp + displacement)' and
`moveml to (fp + displacement)'.
* m68/tm-delta68.h (IN_SIGTRAMP): New macro.
(FRAME_SAVED_PC, FRAME_ARGS_ADDRESS): Ditto.
2000-03-24 19:12:11 +08:00
|
|
|
#undef FRAME_ARGS_ADDRESS
|
|
|
|
#define FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi)
|