]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/sparc/tm-sun4sol2.h
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / gdb / config / sparc / tm-sun4sol2.h
1 /* Macro definitions for GDB for a Sun 4 running Solaris 2
2 Copyright 1989, 1992, 1993, 1994, 1995, 1997, 1998
3 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
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.
11
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.
16
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, Boston, MA 02111-1307, USA. */
20
21 #include "sparc/tm-sparc.h"
22 #include "tm-sysv4.h"
23
24 /* There are two different signal handler trampolines in Solaris2. */
25 #define IN_SIGTRAMP(pc, name) \
26 ((name) \
27 && (STREQ ("sigacthandler", name) || STREQ ("ucbsigvechandler", name)))
28
29 /* The signal handler gets a pointer to an ucontext as third argument
30 if it is called from sigacthandler. This is the offset to the saved
31 PC within it. sparc_frame_saved_pc knows how to deal with
32 ucbsigvechandler. */
33 #define SIGCONTEXT_PC_OFFSET 44
34
35 #if 0 /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
36
37 /* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
38 comment in <machine/setjmp.h>! */
39
40 #define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
41
42 #define JB_ONSSTACK 0
43 #define JB_SIGMASK 1
44 #define JB_SP 2
45 #define JB_PC 3
46 #define JB_NPC 4
47 #define JB_PSR 5
48 #define JB_G1 6
49 #define JB_O0 7
50 #define JB_WBCNT 8
51
52 /* Figure out where the longjmp will land. We expect that we have just entered
53 longjmp and haven't yet setup the stack frame, so the args are still in the
54 output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
55 extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
56 This routine returns true on success */
57
58 extern int
59 get_longjmp_target PARAMS ((CORE_ADDR *));
60
61 #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
62 #endif /* 0 */
63
64 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
65 and for SunPRO 3.0, N_FUN symbols too. */
66 #define SOFUN_ADDRESS_MAYBE_MISSING
67
68 extern char *sunpro_static_transform_name PARAMS ((char *));
69 #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x)
70 #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '$')
71
72 #define FAULTED_USE_SIGINFO
73
74 /* Enable handling of shared libraries for a.out executables. */
75 #define HANDLE_SVR4_EXEC_EMULATORS
76
77 /* Macros to extract process id and thread id from a composite pid/tid */
78 #define PIDGET(pid) ((pid) & 0xffff)
79 #define TIDGET(pid) (((pid) >> 16) & 0xffff)
80
81 /* Macro to extract carry from given regset. */
82 #define PROCFS_GET_CARRY(regset) ((regset)[R_PSR] & PS_FLAG_CARRY)
83
84 #ifdef HAVE_THREAD_DB_LIB
85
86 extern char *solaris_pid_to_str PARAMS ((int pid));
87 #define target_pid_to_str(PID) solaris_pid_to_str (PID)
88
89 #else
90
91 extern char *procfs_pid_to_str PARAMS ((int pid));
92 #define target_pid_to_str(PID) procfs_pid_to_str (PID)
93
94 #endif