Commit | Line | Data |
---|---|---|
68070c10 PA |
1 | /* Target-dependent code for Windows CE running on ARM processors, |
2 | for GDB. | |
3 | ||
4 | Copyright (C) 2007 Free Software Foundation, Inc. | |
5 | ||
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
68070c10 PA |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
68070c10 PA |
20 | |
21 | #include "defs.h" | |
22 | #include "osabi.h" | |
23 | #include "solib-svr4.h" | |
24 | #include "target.h" | |
25 | ||
26 | #include "gdb_string.h" | |
27 | ||
28 | #include "arm-tdep.h" | |
29 | ||
30 | static const char arm_wince_le_breakpoint[] = { 0x10, 0x00, 0x00, 0xe6 }; | |
190dce09 | 31 | static const char arm_wince_thumb_le_breakpoint[] = { 0xfe, 0xdf }; |
68070c10 PA |
32 | |
33 | /* Description of the longjmp buffer. */ | |
34 | #define ARM_WINCE_JB_ELEMENT_SIZE INT_REGISTER_SIZE | |
35 | #define ARM_WINCE_JB_PC 21 | |
36 | ||
37 | static void | |
38 | arm_wince_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | |
39 | { | |
40 | struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | |
41 | ||
42 | tdep->arm_breakpoint = arm_wince_le_breakpoint; | |
43 | tdep->arm_breakpoint_size = sizeof (arm_wince_le_breakpoint); | |
190dce09 UW |
44 | tdep->thumb_breakpoint = arm_wince_thumb_le_breakpoint; |
45 | tdep->thumb_breakpoint_size = sizeof (arm_wince_thumb_le_breakpoint); | |
68070c10 PA |
46 | tdep->struct_return = pcc_struct_return; |
47 | ||
48 | tdep->fp_model = ARM_FLOAT_SOFT_VFP; | |
49 | ||
50 | tdep->jb_pc = ARM_WINCE_JB_PC; | |
51 | tdep->jb_elt_size = ARM_WINCE_JB_ELEMENT_SIZE; | |
52 | ||
53 | /* On ARM WinCE char defaults to signed. */ | |
54 | set_gdbarch_char_signed (gdbarch, 1); | |
55 | ||
68070c10 PA |
56 | /* Shared library handling. */ |
57 | set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | |
190dce09 UW |
58 | |
59 | /* Single stepping. */ | |
60 | set_gdbarch_software_single_step (gdbarch, arm_software_single_step); | |
68070c10 PA |
61 | } |
62 | ||
63 | static enum gdb_osabi | |
64 | arm_wince_osabi_sniffer (bfd *abfd) | |
65 | { | |
66 | const char *target_name = bfd_get_target (abfd); | |
67 | ||
68 | if (strcmp (target_name, "pei-arm-wince-little") == 0) | |
69 | return GDB_OSABI_WINCE; | |
70 | ||
71 | return GDB_OSABI_UNKNOWN; | |
72 | } | |
73 | ||
74 | /* Provide a prototype to silence -Wmissing-prototypes. */ | |
75 | void _initialize_arm_wince_tdep (void); | |
76 | ||
77 | void | |
78 | _initialize_arm_wince_tdep (void) | |
79 | { | |
80 | gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour, | |
81 | arm_wince_osabi_sniffer); | |
82 | ||
83 | gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE, | |
84 | arm_wince_init_abi); | |
85 | } |