1 /* Target-dependent code for Solaris x86.
2 Copyright 2002, 2003 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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. */
25 #include "i386-tdep.h"
27 /* From <ia32/sys/reg.h>. */
28 static int i386_sol2_gregset_reg_offset
[] =
49 i386_sol2_pc_in_sigtramp (CORE_ADDR pc
, char *name
)
51 /* Signal handler frames under Solaris 2 are recognized by a return
52 address of 0xffffffff. */
53 return (pc
== 0xffffffff);
59 i386_sol2_init_abi (struct gdbarch_info info
, struct gdbarch
*gdbarch
)
61 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
63 /* Solaris is SVR4-based. */
64 i386_svr4_init_abi (info
, gdbarch
);
66 /* Solaris reserves space for its FPU emulator in `fpregset_t'.
67 There is also some space reserved for the registers of a Weitek
69 tdep
->gregset_reg_offset
= i386_sol2_gregset_reg_offset
;
70 tdep
->gregset_num_regs
= ARRAY_SIZE (i386_sol2_gregset_reg_offset
);
71 tdep
->sizeof_gregset
= 19 * 4;
72 tdep
->sizeof_fpregset
= 380;
74 /* Signal trampolines are slightly different from SVR4. */
75 set_gdbarch_pc_in_sigtramp (gdbarch
, i386_sol2_pc_in_sigtramp
);
80 i386_sol2_osabi_sniffer (bfd
*abfd
)
82 /* If we have a section named .SUNW_version, then it is almost
83 certainly Solaris 2. */
84 if (bfd_get_section_by_name (abfd
, ".SUNW_version"))
85 return GDB_OSABI_SOLARIS
;
87 return GDB_OSABI_UNKNOWN
;
90 /* Provide a prototype to silence -Wmissing-prototypes. */
91 void _initialize_i386_sol2_tdep (void);
94 _initialize_i386_sol2_tdep (void)
96 /* Register an ELF OS ABI sniffer for Solaris 2 binaries. */
97 gdbarch_register_osabi_sniffer (bfd_arch_i386
, bfd_target_elf_flavour
,
98 i386_sol2_osabi_sniffer
);
100 gdbarch_register_osabi (bfd_arch_i386
, 0, GDB_OSABI_SOLARIS
,