Johns release
[deliverable/binutils-gdb.git] / gdb / tm-sun3.h
1 /* Parameters for execution on a Sun, for GDB, the GNU debugger.
2 Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 GDB 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 1, or (at your option)
9 any later version.
10
11 GDB 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.
15
16 You should have received a copy of the GNU General Public License
17 along with GDB; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #define HAVE_68881
21
22 #include "tm-68k.h"
23
24 /* Define this if the C compiler puts an underscore at the front
25 of external names before giving them to the linker. */
26
27 #define NAMES_HAVE_UNDERSCORE
28
29 /* Debugger information will be in DBX format. */
30
31 #define READ_DBX_FORMAT
32
33 /* Address of the end of stack space. We get this from the system
34 include files. */
35 #include <sys/types.h>
36 #include <machine/vmparam.h>
37 #define STACK_END_ADDR USRSTACK
38 \f
39 /* Things needed for making the inferior call functions. */
40
41 /* Push an empty stack frame, to record the current PC, etc. */
42
43 #define PUSH_DUMMY_FRAME \
44 { register CORE_ADDR sp = read_register (SP_REGNUM); \
45 register int regnum; \
46 char raw_buffer[12]; \
47 sp = push_word (sp, read_register (PC_REGNUM)); \
48 sp = push_word (sp, read_register (FP_REGNUM)); \
49 write_register (FP_REGNUM, sp); \
50 for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--) \
51 { read_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12); \
52 sp = push_bytes (sp, raw_buffer, 12); } \
53 for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \
54 sp = push_word (sp, read_register (regnum)); \
55 sp = push_word (sp, read_register (PS_REGNUM)); \
56 write_register (SP_REGNUM, sp); }
57
58 /* Discard from the stack the innermost frame,
59 restoring all saved registers. */
60
61 #define POP_FRAME \
62 { register FRAME frame = get_current_frame (); \
63 register CORE_ADDR fp; \
64 register int regnum; \
65 struct frame_saved_regs fsr; \
66 struct frame_info *fi; \
67 char raw_buffer[12]; \
68 fi = get_frame_info (frame); \
69 fp = fi->frame; \
70 get_frame_saved_regs (fi, &fsr); \
71 for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--) \
72 if (fsr.regs[regnum]) \
73 { read_memory (fsr.regs[regnum], raw_buffer, 12); \
74 write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12); }\
75 for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \
76 if (fsr.regs[regnum]) \
77 write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
78 if (fsr.regs[PS_REGNUM]) \
79 write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \
80 write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
81 write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
82 write_register (SP_REGNUM, fp + 8); \
83 flush_cached_frames (); \
84 set_current_frame (create_new_frame (read_register (FP_REGNUM), \
85 read_pc ())); }
86
87 /* This sequence of words is the instructions
88 fmovem 0xff,-(sp)
89 moveml 0xfffc,-(sp)
90 clrw -(sp)
91 movew ccr,-(sp)
92 /..* The arguments are pushed at this point by GDB;
93 no code is needed in the dummy for this.
94 The CALL_DUMMY_START_OFFSET gives the position of
95 the following jsr instruction. *../
96 jsr @#32323232
97 addl #69696969,sp
98 trap #15
99 nop
100 Note this is 28 bytes.
101 We actually start executing at the jsr, since the pushing of the
102 registers is done by PUSH_DUMMY_FRAME. If this were real code,
103 the arguments for the function called by the jsr would be pushed
104 between the moveml and the jsr, and we could allow it to execute through.
105 But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is done,
106 and we cannot allow the moveml to push the registers again lest they be
107 taken for the arguments. */
108
109 #define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, 0x4e4f4e71}
110
111 #define CALL_DUMMY_LENGTH 28
112
113 #define CALL_DUMMY_START_OFFSET 12
114
115 /* Insert the specified number of args and function address
116 into a call sequence of the above form stored at DUMMYNAME. */
117
118 #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
119 { *(int *)((char *) dummyname + 20) = nargs * 4; \
120 *(int *)((char *) dummyname + 14) = fun; }
This page took 0.032382 seconds and 4 git commands to generate.