1 /* Target-specific functions for ARM running under NetBSD.
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 "nbsd-tdep.h"
26 #include "solib-svr4.h"
28 /* Description of the longjmp buffer. */
29 #define ARM_NBSD_JB_PC 24
30 #define ARM_NBSD_JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
32 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
33 override the default little-endian breakpoint. */
34 static const char arm_nbsd_arm_le_breakpoint
[] = {0x11, 0x00, 0x00, 0xe6};
37 arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc
, char *name
)
39 if (strcmp (name
, "_PROCEDURE_LINKAGE_TABLE_") == 0)
46 arm_netbsd_init_abi_common (struct gdbarch_info info
,
47 struct gdbarch
*gdbarch
)
49 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
51 tdep
->lowest_pc
= 0x8000;
52 tdep
->arm_breakpoint
= arm_nbsd_arm_le_breakpoint
;
53 tdep
->arm_breakpoint_size
= sizeof (arm_nbsd_arm_le_breakpoint
);
55 tdep
->jb_pc
= ARM_NBSD_JB_PC
;
56 tdep
->jb_elt_size
= ARM_NBSD_JB_ELEMENT_SIZE
;
60 arm_netbsd_aout_init_abi (struct gdbarch_info info
,
61 struct gdbarch
*gdbarch
)
63 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
65 arm_netbsd_init_abi_common (info
, gdbarch
);
67 set_gdbarch_in_solib_call_trampoline
68 (gdbarch
, arm_netbsd_aout_in_solib_call_trampoline
);
69 tdep
->fp_model
= ARM_FLOAT_SOFT_FPA
;
73 arm_netbsd_elf_init_abi (struct gdbarch_info info
,
74 struct gdbarch
*gdbarch
)
76 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
78 arm_netbsd_init_abi_common (info
, gdbarch
);
80 set_solib_svr4_fetch_link_map_offsets (gdbarch
,
81 nbsd_ilp32_solib_svr4_fetch_link_map_offsets
);
83 tdep
->fp_model
= ARM_FLOAT_SOFT_VFP
;
87 arm_netbsd_aout_osabi_sniffer (bfd
*abfd
)
89 if (strcmp (bfd_get_target (abfd
), "a.out-arm-netbsd") == 0)
90 return GDB_OSABI_NETBSD_AOUT
;
92 return GDB_OSABI_UNKNOWN
;
96 _initialize_arm_netbsd_tdep (void)
98 gdbarch_register_osabi_sniffer (bfd_arch_arm
, bfd_target_aout_flavour
,
99 arm_netbsd_aout_osabi_sniffer
);
101 gdbarch_register_osabi (bfd_arch_arm
, 0, GDB_OSABI_NETBSD_AOUT
,
102 arm_netbsd_aout_init_abi
);
103 gdbarch_register_osabi (bfd_arch_arm
, 0, GDB_OSABI_NETBSD_ELF
,
104 arm_netbsd_elf_init_abi
);