Catch error on close so runtest won't bomb.
[deliverable/binutils-gdb.git] / gdb / tm-news.h
CommitLineData
dd3b648e 1/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
58dbaabd 2 Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
dd3b648e
RP
3
4This file is part of GDB.
5
99a7de40 6This program is free software; you can redistribute it and/or modify
dd3b648e 7it under the terms of the GNU General Public License as published by
99a7de40
JG
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
dd3b648e 10
99a7de40 11This program is distributed in the hope that it will be useful,
dd3b648e
RP
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
99a7de40
JG
17along with this program; if not, write to the Free Software
18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
dd3b648e
RP
19
20/* See following cpu type determination macro to get the machine type.
21
22Here is an m-news.h file for gdb. It supports the 68881 registers.
23 by hikichi@srava.sra.junet
24
25* Support Sun assembly format instead of Motorola one.
26* Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
27* After NEWS OS version 3.2, some of ptrace's bug is fixed.
28 But we cannot change the floating register(see adb(1) in OS 3.2) yet. */
29
84d82b1c
FF
30#define HAVE_68881
31
dd3b648e
RP
32/* Use to compute STACK_END_ADDR. */
33#define TARGET_UPAGES 2
34#define TARGET_NBPG 4096
35
36/* Address of end of stack space. */
37
38#define STACK_END_ADDR (0x80000000 - TARGET_UPAGES * TARGET_NBPG)
39
40/* Extract from an array REGBUF containing the (raw) register state
41 a function return value of type TYPE, and copy that, in virtual format,
42 into VALBUF. */
43
44/* when it return the floating value, use the FP0 in NEWS. */
45#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
46 { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
47 { \
48 REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
49 &REGBUF[REGISTER_BYTE (FP0_REGNUM)], VALBUF); \
50 } \
51 else \
52 bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)); }
53
54/* Write into appropriate registers a function return value
55 of type TYPE, given in virtual format. */
56
57/* when it return the floating value, use the FP0 in NEWS. */
58#define STORE_RETURN_VALUE(TYPE,VALBUF) \
59 { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
60 { \
61 char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
62 REGISTER_CONVERT_TO_RAW (FP0_REGNUM, VALBUF, raw_buf); \
63 write_register_bytes (FP0_REGNUM, \
64 raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
65 } \
66 else \
67 write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
68
69/* Return number of args passed to a frame.
70 Can return -1, meaning no way to tell. */
71
72#define FRAME_NUM_ARGS(val, fi) \
73{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
74 register int insn = 0177777 & read_memory_integer (pc, 2); \
75 val = 0; \
76 if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
77 val = read_memory_integer (pc + 2, 2); \
78 else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
79 || (insn & 0170777) == 0050117) /* addqw */ \
80 { val = (insn >> 9) & 7; if (val == 0) val = 8; } \
81 else if (insn == 0157774) /* addal #WW, sp */ \
82 val = read_memory_integer (pc + 2, 4); \
83 val >>= 2; }
84
dd3b648e 85#include "tm-68k.h"
This page took 0.093537 seconds and 4 git commands to generate.