Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gdb / gdb / config / i386 / tm-i386sol2.h
1 /* Macro definitions for GDB on an Intel i386 running Solaris 2.
2    Copyright (C) 1998 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, Boston, MA 02111-1307, USA.  */
19
20 #ifndef TM_I386SOL2_H
21 #define TM_I386SOL2_H 1
22
23 #include "i386/tm-i386v4.h"
24  
25 /* Signal handler frames under Solaris 2 are recognized by a return address
26    of 0xFFFFFFFF, the third parameter on the signal handler stack is
27    a pointer to an ucontext.  */
28 #undef sigtramp_saved_pc
29 #undef I386V4_SIGTRAMP_SAVED_PC
30 #define SIGCONTEXT_PC_OFFSET (36 + 14 * 4)
31 #undef IN_SIGTRAMP
32 #define IN_SIGTRAMP(pc, name) (pc == 0xFFFFFFFF)
33
34 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
35    and for SunPRO 3.0, N_FUN symbols too.  */
36 #define SOFUN_ADDRESS_MAYBE_MISSING
37
38 extern char *sunpro_static_transform_name PARAMS ((char *));
39 #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x)
40 #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '.')
41
42 #define FAULTED_USE_SIGINFO
43
44 /* Macros to extract process id and thread id from a composite pid/tid */
45 #define PIDGET(pid) ((pid) & 0xffff)
46 #define TIDGET(pid) (((pid) >> 16) & 0xffff)
47
48 /* Macro to extract carry from given regset.  */
49 #define PS_FLAG_CARRY 0x1       /* Carry bit in PS */
50 #define PROCFS_GET_CARRY(regset) ((regset)[EFL] & PS_FLAG_CARRY)
51
52 #ifdef HAVE_THREAD_DB_LIB
53
54 extern char *solaris_pid_to_str PARAMS ((int pid));
55 #define target_pid_to_str(PID) solaris_pid_to_str (PID)
56
57 #else
58
59 extern char *procfs_pid_to_str PARAMS ((int pid));
60 #define target_pid_to_str(PID) procfs_pid_to_str (PID)
61
62 #endif
63
64 #endif  /* ifndef TM_I386SOL2_H */