2003-03-30 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / i386-cygwin-tdep.c
CommitLineData
1762d96d
CV
1/* Target-dependent code for Cygwin running on i386's, for GDB.
2 Copyright 2003 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
20#include "defs.h"
21
22#include "gdb_string.h"
23#include "i386-tdep.h"
24#include "osabi.h"
25
26static void
27i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
28{
29 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
30
31 tdep->struct_return = reg_struct_return;
32}
33
34static enum gdb_osabi
35i386_cygwin_osabi_sniffer (bfd * abfd)
36{
37 char *target_name = bfd_get_target (abfd);
38
39 /* Interix also uses pei-i386.
40 We need a way to distinguish between the two. */
41 if (strcmp (target_name, "pei-i386") == 0)
42 return GDB_OSABI_CYGWIN;
43
44 return GDB_OSABI_UNKNOWN;
45}
46
47void
48_initialize_i386_cygwin_tdep (void)
49{
50 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
51 i386_cygwin_osabi_sniffer);
52
53 gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_CYGWIN,
54 i386_cygwin_init_abi);
55}
This page took 0.025528 seconds and 4 git commands to generate.