1 /* Target-specific functions for ARM running under NetBSD.
2 Copyright 2002 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. */
24 #include "nbsd-tdep.h"
25 #include "solib-svr4.h"
27 /* Description of the longjmp buffer. */
29 #define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
31 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
32 override the default little-endian breakpoint. */
33 static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6};
36 arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
38 if (strcmp (name, "_PROCEDURE_LINKAGE_TABLE_") == 0)
45 arm_netbsd_init_abi_common (struct gdbarch_info info,
46 struct gdbarch *gdbarch)
48 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
50 tdep->lowest_pc = 0x8000;
51 tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;
52 tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint);
55 tdep->jb_elt_size = JB_ELEMENT_SIZE;
59 arm_netbsd_aout_init_abi (struct gdbarch_info info,
60 struct gdbarch *gdbarch)
62 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
64 arm_netbsd_init_abi_common (info, gdbarch);
66 set_gdbarch_in_solib_call_trampoline
67 (gdbarch, arm_netbsd_aout_in_solib_call_trampoline);
68 tdep->fp_model = ARM_FLOAT_SOFT;
72 arm_netbsd_elf_init_abi (struct gdbarch_info info,
73 struct gdbarch *gdbarch)
75 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
77 arm_netbsd_init_abi_common (info, gdbarch);
79 set_solib_svr4_fetch_link_map_offsets (gdbarch,
80 nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
82 tdep->fp_model = ARM_FLOAT_SOFT_VFP;
86 arm_netbsd_aout_osabi_sniffer (bfd *abfd)
88 if (strcmp (bfd_get_target (abfd), "a.out-arm-netbsd") == 0)
89 return GDB_OSABI_NETBSD_AOUT;
91 return GDB_OSABI_UNKNOWN;
95 _initialize_arm_netbsd_tdep (void)
97 gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_aout_flavour,
98 arm_netbsd_aout_osabi_sniffer);
100 gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_AOUT,
101 arm_netbsd_aout_init_abi);
102 gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_ELF,
103 arm_netbsd_elf_init_abi);