]>
Commit | Line | Data |
---|---|---|
5076de82 FF |
1 | /* Parameters for execution on a Sun, for GDB, the GNU debugger. |
2 | Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
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. | |
10 | ||
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. | |
15 | ||
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 | |
6c9638b4 | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
5076de82 | 19 | |
9a13e99e SG |
20 | #ifndef TM_SUN3_H |
21 | #define TM_SUN3_H | |
5076de82 | 22 | |
9a13e99e SG |
23 | /* Sun3 status includes fpflags, which shows whether the FPU has been used |
24 | by the process, and whether the FPU was done with an instruction or | |
25 | was interrupted in the middle of a long instruction. See | |
26 | <machine/reg.h>. */ | |
27 | /* a&d, pc,sr, fp, fpstat, fpflags */ | |
28 | ||
29 | #define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4) | |
30 | ||
31 | #define NUM_REGS 31 | |
32 | ||
33 | #define REGISTER_BYTES_OK(b) \ | |
34 | ((b) == REGISTER_BYTES \ | |
35 | || (b) == REGISTER_BYTES_FP \ | |
36 | || (b) == REGISTER_BYTES_NOFP) | |
37 | ||
38 | /* If PC contains this instruction, then we know what we are in a system | |
39 | call stub, and the return PC is is at SP+4, instead of SP. */ | |
40 | ||
41 | #define SYSCALL_TRAP 0x4e40 /* trap #0 */ | |
42 | #define SYSCALL_TRAP_OFFSET 0 /* PC points at trap instruction */ | |
5076de82 | 43 | |
2225eb85 | 44 | #include "m68k/tm-m68k.h" |
5076de82 | 45 | |
537eba71 SG |
46 | /* Disable alternate breakpoint mechanism needed by 68k stub. */ |
47 | #undef REMOTE_BREAKPOINT | |
48 | ||
5076de82 FF |
49 | /* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least |
50 | documented in a comment in <machine/setjmp.h>! */ | |
51 | ||
52 | #define JB_ELEMENT_SIZE 4 | |
53 | ||
54 | #define JB_ONSSTACK 0 | |
55 | #define JB_SIGMASK 1 | |
56 | #define JB_SP 2 | |
57 | #define JB_PC 3 | |
58 | #define JB_PSL 4 | |
59 | #define JB_D2 5 | |
60 | #define JB_D3 6 | |
61 | #define JB_D4 7 | |
62 | #define JB_D5 8 | |
63 | #define JB_D6 9 | |
64 | #define JB_D7 10 | |
65 | #define JB_A2 11 | |
66 | #define JB_A3 12 | |
67 | #define JB_A4 13 | |
68 | #define JB_A5 14 | |
69 | #define JB_A6 15 | |
70 | ||
71 | /* Figure out where the longjmp will land. Slurp the args out of the stack. | |
72 | We expect the first arg to be a pointer to the jmp_buf structure from which | |
73 | we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. | |
74 | This routine returns true on success */ | |
75 | ||
76 | #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) | |
81a80f32 | 77 | extern int get_longjmp_target PARAMS ((CORE_ADDR *)); |
5076de82 | 78 | |
9a13e99e SG |
79 | /* If sun3 pcc says that a parameter is a short, it's a short. */ |
80 | #define BELIEVE_PCC_PROMOTION_TYPE | |
bc447a39 | 81 | |
d568b76a JK |
82 | /* Can't define BELIEVE_PCC_PROMOTION for SunOS /bin/cc of SunOS 4.1.1. |
83 | Apparently Sun fixed this for the sparc but not the sun3. */ | |
eed6de01 | 84 | |
bc447a39 JK |
85 | /* The code which tries to deal with this bug is never harmful on a sun3. */ |
86 | #define SUN_FIXED_LBRAC_BUG (0) | |
c67d08e8 PS |
87 | |
88 | /* On the sun3 the kernel pushes a sigcontext on the user stack and then | |
89 | `calls' _sigtramp in user code. _sigtramp saves the floating point status | |
90 | on the stack and calls the signal handler function. The stack does not | |
91 | contain enough information to allow a normal backtrace, but sigcontext | |
92 | contains the saved user pc/sp. FRAME_CHAIN and friends in tm-m68k.h and | |
93 | m68k_find_saved_regs deal with this situation by manufacturing a fake frame | |
94 | for _sigtramp. | |
95 | SIG_PC_FP_OFFSET is the offset from the signal handler frame to the | |
96 | saved pc in sigcontext. | |
97 | SIG_SP_FP_OFFSET is the offset from the signal handler frame to the end | |
98 | of sigcontext which is identical to the saved sp at SIG_PC_FP_OFFSET - 4. | |
99 | ||
100 | Please note that it is impossible to correctly backtrace from a breakpoint | |
101 | in _sigtramp as _sigtramp modifies the stack pointer a few times. */ | |
102 | ||
103 | #undef SIG_PC_FP_OFFSET | |
104 | #define SIG_PC_FP_OFFSET 324 | |
105 | #define SIG_SP_FP_OFFSET 332 | |
9a13e99e SG |
106 | |
107 | #endif /* TM_SUN3_H */ |