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