* arm-tdep.h (struct gdbarch_tdep): Add fields for breakpoint
[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 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
26 override the default little-endian breakpoint. */
27 static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6};
28
29 static void
30 arm_netbsd_init_abi_common (struct gdbarch_info info,
31 struct gdbarch *gdbarch)
32 {
33 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
34
35 tdep->lowest_pc = 0x8000;
36 tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;
37 tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint);
38 }
39
40 static void
41 arm_netbsd_aout_init_abi (struct gdbarch_info info,
42 struct gdbarch *gdbarch)
43 {
44 arm_netbsd_init_abi_common (info, gdbarch);
45 }
46
47 static void
48 arm_netbsd_elf_init_abi (struct gdbarch_info info,
49 struct gdbarch *gdbarch)
50 {
51 arm_netbsd_init_abi_common (info, gdbarch);
52 }
53
54 void
55 _initialize_arm_netbsd_tdep (void)
56 {
57 arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_AOUT, arm_netbsd_aout_init_abi);
58 arm_gdbarch_register_os_abi (ARM_ABI_NETBSD_ELF, arm_netbsd_elf_init_abi);
59 }