7f6e63992e20d523aaaed586bcb4db3bbca0d39e
[deliverable/binutils-gdb.git] / gdb / armnbsd-tdep.c
1 /* Target-specific functions for ARM running under NetBSD.
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"
22
23 #include "arm-tdep.h"
24
25 /* Description of the longjmp buffer. */
26 #define JB_PC 24
27 #define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
28
29 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
30 override the default little-endian breakpoint. */
31 static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6};
32
33 static int
34 arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
35 {
36 if (strcmp (name, "_PROCEDURE_LINKAGE_TABLE_") == 0)
37 return 1;
38
39 return 0;
40 }
41
42 static void
43 arm_netbsd_init_abi_common (struct gdbarch_info info,
44 struct gdbarch *gdbarch)
45 {
46 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
47
48 tdep->lowest_pc = 0x8000;
49 tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;
50 tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint);
51
52 tdep->jb_pc = JB_PC;
53 tdep->jb_elt_size = JB_ELEMENT_SIZE;
54 }
55
56 static void
57 arm_netbsd_aout_init_abi (struct gdbarch_info info,
58 struct gdbarch *gdbarch)
59 {
60 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
61
62 arm_netbsd_init_abi_common (info, gdbarch);
63
64 set_gdbarch_in_solib_call_trampoline
65 (gdbarch, arm_netbsd_aout_in_solib_call_trampoline);
66 tdep->fp_model = ARM_FLOAT_SOFT;
67 }
68
69 static void
70 arm_netbsd_elf_init_abi (struct gdbarch_info info,
71 struct gdbarch *gdbarch)
72 {
73 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
74
75 arm_netbsd_init_abi_common (info, gdbarch);
76
77 tdep->fp_model = ARM_FLOAT_SOFT_VFP;
78 }
79
80 void
81 _initialize_arm_netbsd_tdep (void)
82 {
83 arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_AOUT, arm_netbsd_aout_init_abi);
84 arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_ELF, arm_netbsd_elf_init_abi);
85 }
This page took 0.031059 seconds and 4 git commands to generate.