* top.c (gdb_rl_operate_and_get_next): Make sure
[deliverable/binutils-gdb.git] / gdb / i386-sol2-tdep.c
CommitLineData
8201327c
MK
1/* Target-dependent code for Solaris x86.
2 Copyright 2002 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#include "defs.h"
52e9098c 22#include "value.h"
8201327c
MK
23
24#include "i386-tdep.h"
25
26static int
27i386_sol2_pc_in_sigtramp (CORE_ADDR pc, char *name)
28{
29 /* Signal handler frames under Solaris 2 are recognized by a return
30 address of 0xffffffff. */
31 return (pc == 0xffffffff);
32}
33
34/* Solaris 2. */
35
36static void
37i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
38{
39 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
40
41 /* Solaris is SVR4-based. */
42 i386_svr4_init_abi (info, gdbarch);
43
44 /* Signal trampolines are different from SVR4, in fact they're
45 rather similar to BSD. */
46 set_gdbarch_pc_in_sigtramp (gdbarch, i386_sol2_pc_in_sigtramp);
21d0e8a4 47 tdep->sigcontext_addr = i386bsd_sigcontext_addr;
8201327c 48 tdep->sc_pc_offset = 36 + 14 * 4;
1d34db41 49 tdep->sc_sp_offset = 36 + 17 * 4;
52e9098c
MK
50
51 /* Assume that the prototype flag can be trusted. */
52 set_gdbarch_coerce_float_to_double (gdbarch,
53 standard_coerce_float_to_double);
8201327c
MK
54}
55\f
56
6e157172
MK
57static enum gdb_osabi
58i386_sol2_osabi_sniffer (bfd *abfd)
59{
60 /* If we have a section named .SUNW_version, then it is almost
61 certainly Solaris 2. */
62 if (bfd_get_section_by_name (abfd, ".SUNW_version"))
63 return GDB_OSABI_SOLARIS;
64
65 return GDB_OSABI_UNKNOWN;
66}
67
8201327c
MK
68/* Provide a prototype to silence -Wmissing-prototypes. */
69void _initialize_i386_sol2_tdep (void);
70
71void
72_initialize_i386_sol2_tdep (void)
73{
6e157172
MK
74 /* Register and ELF OS ABI sniffer for Solaris 2 binaries. */
75 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
76 i386_sol2_osabi_sniffer);
77
8201327c
MK
78 gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SOLARIS,
79 i386_sol2_init_abi);
80}
This page took 0.042272 seconds and 4 git commands to generate.