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