Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger. |
2 | Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc. | |
3 | ||
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
c906108c | 10 | |
c5aa993b JM |
11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
c906108c | 15 | |
c5aa993b JM |
16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
20 | |
21 | /* See following cpu type determination macro to get the machine type. | |
22 | ||
c5aa993b JM |
23 | Here is an m-news.h file for gdb. It supports the 68881 registers. |
24 | by hikichi@srava.sra.junet | |
c906108c | 25 | |
c5aa993b JM |
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. */ | |
c906108c SS |
29 | |
30 | /* Extract from an array REGBUF containing the (raw) register state | |
31 | a function return value of type TYPE, and copy that, in virtual format, | |
32 | into VALBUF. */ | |
33 | ||
34 | /* when it return the floating value, use the FP0 in NEWS. */ | |
35 | #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ | |
36 | { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ | |
37 | { \ | |
38 | REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \ | |
39 | ®BUF[REGISTER_BYTE (FP0_REGNUM)], \ | |
40 | VALBUF); \ | |
41 | } \ | |
42 | else \ | |
43 | memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)); } | |
44 | ||
45 | /* Write into appropriate registers a function return value | |
46 | of type TYPE, given in virtual format. */ | |
47 | ||
48 | /* when it return the floating value, use the FP0 in NEWS. */ | |
49 | #define STORE_RETURN_VALUE(TYPE,VALBUF) \ | |
50 | { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ | |
51 | { \ | |
52 | char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ | |
53 | REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \ | |
54 | write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \ | |
55 | raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \ | |
56 | } \ | |
57 | else \ | |
58 | write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); } | |
59 | ||
60 | /* Return number of args passed to a frame. | |
61 | Can return -1, meaning no way to tell. */ | |
62 | ||
c5aa993b | 63 | extern int news_frame_num_args PARAMS ((struct frame_info * fi)); |
cce74817 | 64 | #define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi))) |
c906108c SS |
65 | |
66 | #include "m68k/tm-m68k.h" |