1993-03-23 01:19:58 +00:00
|
|
|
/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
|
|
|
|
Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
1995-08-02 03:41:12 +00:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1993-03-23 01:19:58 +00:00
|
|
|
|
|
|
|
/* See following cpu type determination macro to get the machine type.
|
More gcc lint:
* exec.c (ignore): Return 0.
* stack.c (return_command): Fetch lazy value directly, not via
VALUE_CONTENTS, to avoid "value computed is not used".
* inflow.c (new_tty): Move osigttou inside #if.
* remote.c (remote_fetch_registers): If remote reply is short, just
note that fact and keep going (reading extra registers as all bits 0).
(remote_store_registers): Send number of registers that were found
by remote_fetch_registers.
* m68k-tdep.c, config/m68k/tm-m68k.h, config/m68k/tm-*.h: Remove
HAVE_68881. Define CANNOT_STORE_REGISTER if ptrace() can't write
floating registers.
* config/m68k/{tm-m68k-nofp.h,m68k-nofp.mt,tm-m68k-fp.h,m68k-fp.mt}:
Remove, replaced by {tm-m68k-em.h,m68k-em.mt}.
* Makefile.in, configure.in: Change accordingly.
1993-09-09 18:33:44 +00:00
|
|
|
|
1993-03-23 01:19:58 +00:00
|
|
|
Here is an m-news.h file for gdb. It supports the 68881 registers.
|
|
|
|
by hikichi@srava.sra.junet
|
More gcc lint:
* exec.c (ignore): Return 0.
* stack.c (return_command): Fetch lazy value directly, not via
VALUE_CONTENTS, to avoid "value computed is not used".
* inflow.c (new_tty): Move osigttou inside #if.
* remote.c (remote_fetch_registers): If remote reply is short, just
note that fact and keep going (reading extra registers as all bits 0).
(remote_store_registers): Send number of registers that were found
by remote_fetch_registers.
* m68k-tdep.c, config/m68k/tm-m68k.h, config/m68k/tm-*.h: Remove
HAVE_68881. Define CANNOT_STORE_REGISTER if ptrace() can't write
floating registers.
* config/m68k/{tm-m68k-nofp.h,m68k-nofp.mt,tm-m68k-fp.h,m68k-fp.mt}:
Remove, replaced by {tm-m68k-em.h,m68k-em.mt}.
* Makefile.in, configure.in: Change accordingly.
1993-09-09 18:33:44 +00:00
|
|
|
|
1993-03-23 01:19:58 +00:00
|
|
|
* Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
|
|
|
|
* After NEWS OS version 3.2, some of ptrace's bug is fixed.
|
|
|
|
But we cannot change the floating register(see adb(1) in OS 3.2) yet. */
|
|
|
|
|
|
|
|
/* 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 return the floating value, use the FP0 in NEWS. */
|
|
|
|
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
|
|
|
{ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
|
|
|
|
{ \
|
1998-02-10 20:14:43 +00:00
|
|
|
REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
|
* findvar.c (value_of_register, value_from_register),
hppa-tdep.c (pa_print_fp_reg), infcmd.c (do_registers_info),
valops.c (value_assign): Use REGISTER_CONVERT_TO_* only if
REGISTER_CONVERTIBLE is defined, otherwise just copy the content.
Pass desired type to REGISTER_CONVERT_TO_*.
* config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*):
Pass length of desired type to store/extract_floating.
* config/i386/tm-arm.h, config/i386/tm-i386aix.h,
config/i386/tm-sun386.h, config/i386/tm-symmetry.h,
config/m88k/tm-m88k.h config/rs6000/tm-rs6000.h (REGISTER_CONVERT_*):
Use extract_floating and store_floating with length of desired type.
* config/m68k/tm-news.h (STORE,EXTRACT_RETURN_VALUE): Add type
parameter to REGISTER_CONVERT_*.
* config/a29k/tm-a29k.h, config/convex/tm-convex.h,
config/gould/tm-np1.h, config/gould/tm-pn.h, config/h8300/tm-h8300.h,
config/h8500/tm-h8500.h, config/i386/tm-i386v.h,
config/mips/tm-mips.h, config/ns32k/tm-merlin.h,
config/ns32k/tm-umax.h, config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
config/sh/tm-sh.h, config/sparc/tm-sparc.h, config/tahoe/tm-tahoe.h,
config/vax/tm-vax.h, config/z8k/tm-z8k.h (REGISTER_CONVERTIBLE,
REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Remove
versions for which REGISTER_CONVERTIBLE is always false.
* z8k-tdep.c (register_convert_to_virtual, register_convert_to_raw):
Remove, no longer used.
* alpha-tdep.c (alpha_register_convert_to_raw,
alpha_register_convert_to_virtual): New routines to handle
the different raw formats in alpha floating point registers.
* config/alpha/tm-alpha.h (REGISTER_CONVERTIBLE,
REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use them.
1993-11-02 21:51:10 +00:00
|
|
|
®BUF[REGISTER_BYTE (FP0_REGNUM)], \
|
|
|
|
VALBUF); \
|
1993-03-23 01:19:58 +00:00
|
|
|
} \
|
|
|
|
else \
|
1993-09-01 20:37:15 +00:00
|
|
|
memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)); }
|
1993-03-23 01:19:58 +00:00
|
|
|
|
|
|
|
/* Write into appropriate registers a function return value
|
|
|
|
of type TYPE, given in virtual format. */
|
|
|
|
|
|
|
|
/* when it return the floating value, use the FP0 in NEWS. */
|
|
|
|
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
|
|
|
{ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
|
|
|
|
{ \
|
|
|
|
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
|
1998-02-10 20:14:43 +00:00
|
|
|
REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
|
|
|
|
write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
|
1993-03-23 01:19:58 +00:00
|
|
|
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
|
|
|
|
|
|
|
|
/* Return number of args passed to a frame.
|
|
|
|
Can return -1, meaning no way to tell. */
|
|
|
|
|
|
|
|
#define FRAME_NUM_ARGS(val, fi) \
|
|
|
|
{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
|
|
|
|
register int insn = 0177777 & read_memory_integer (pc, 2); \
|
|
|
|
val = 0; \
|
|
|
|
if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
|
|
|
|
val = read_memory_integer (pc + 2, 2); \
|
|
|
|
else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
|
|
|
|
|| (insn & 0170777) == 0050117) /* addqw */ \
|
|
|
|
{ val = (insn >> 9) & 7; if (val == 0) val = 8; } \
|
|
|
|
else if (insn == 0157774) /* addal #WW, sp */ \
|
|
|
|
val = read_memory_integer (pc + 2, 4); \
|
|
|
|
val >>= 2; }
|
|
|
|
|
* config/m68k/tm-m68k.h: Renamed from config/m68k/tm-68k.h.
* m68k/{tm-3b1.h, tm-altos.h, tm-amix.h, tm-es1800.h,
tm-hp300bsd.h, tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-os68k.h,
tm-st2000.h, tm-sun2.h, tm-sun3.h, tm-vx68.h}: Include tm-m68k.h
instead of tm-68k.h.
* Makefile.in (HFILES): tm-68k.h renamed to tm-m68k.h.
* README, a29k-pinsn.c, m68k-pinsn.c, m68k-stub.c, remote-vx.c,
m68k/{altos.mh, altos.mt, apollo68b.mh, nm-apollo68b.h,
nm-hp300bsd.h, config/m68k/xm-apollo68b.h}: Map '68k' to 'm68k'.
* a29k/tm-a29k.h, doc/gdbint.texinfo: Account for renaming of
tm-68k.h to tm-m68k.h.
* m68k/m68k-fp.mt (TM_FILE): tm-68k-fp.h renamed to tm-m68k-fp.h.
* m68k/m68k-nofp.mt (TM_FILE): tm-68k-nofp.h renamed to
tm-m68k-nofp.h.
1993-03-30 00:33:44 +00:00
|
|
|
#include "m68k/tm-m68k.h"
|