1 /* Sequent Symmetry target interface, for GDB.
2 Copyright (C) 1986, 1987, 1989, 1991, 1994 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* many 387-specific items of use taken from i386-dep.c */
28 #include <sys/param.h>
31 #include <sys/ioctl.h>
37 * Following macro translates i386 opcode register numbers to Symmetry
38 * register numbers. This is used by FRAME_FIND_SAVED_REGS.
40 * %eax %ecx %edx %ebx %esp %ebp %esi %edi
41 * i386 0 1 2 3 4 5 6 7
42 * Symmetry 0 2 1 5 14 15 6 7
45 #define I386_REGNO_TO_SYMMETRY(n) \
46 ((n)==0?0 :(n)==1?2 :(n)==2?1 :(n)==3?5 :(n)==4?14 :(n)==5?15 :(n))
49 symmetry_extract_return_value(type
, regbuf
, valbuf
)
58 struct minimal_symbol
*msymbol
;
61 if (TYPE_CODE_FLT
== TYPE_CODE(type
)) {
62 msymbol
= lookup_minimal_symbol ("1167_flt", (struct objfile
*) NULL
);
63 if (msymbol
!= NULL
) {
64 /* found "1167_flt" means 1167, %fp2-%fp3 */
65 /* float & double; 19= %fp2, 20= %fp3 */
66 /* no single precision on 1167 */
67 xd
.l
[1] = *((int *)®buf
[REGISTER_BYTE(19)]);
68 xd
.l
[0] = *((int *)®buf
[REGISTER_BYTE(20)]);
69 switch (TYPE_LENGTH(type
)) {
71 /* FIXME: broken for cross-debugging. */
73 memcpy (valbuf
, &f
, TYPE_LENGTH(type
));
76 /* FIXME: broken for cross-debugging. */
77 memcpy (valbuf
, &xd
.d
, TYPE_LENGTH(type
));
80 error("Unknown floating point size");
84 /* 387 %st(0), gcc uses this */
85 i387_to_double(((int *)®buf
[REGISTER_BYTE(3)]),
87 switch (TYPE_LENGTH(type
)) {
90 /* FIXME: broken for cross-debugging. */
91 memcpy (valbuf
, &f
, 4);
94 /* FIXME: broken for cross-debugging. */
95 memcpy (valbuf
, &xd
.d
, 8);
98 error("Unknown floating point size");
103 memcpy (valbuf
, regbuf
, TYPE_LENGTH (type
));
This page took 0.031503 seconds and 4 git commands to generate.