OLD | NEW |
1 /* Target-dependent code for Windows CE running on ARM processors, | 1 /* Target-dependent code for Windows CE running on ARM processors, |
2 for GDB. | 2 for GDB. |
3 | 3 |
4 Copyright (C) 2007-2012 Free Software Foundation, Inc. | 4 Copyright (C) 2007-2012 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GDB. | 6 This file is part of GDB. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 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 | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
(...skipping 26 matching lines...) Expand all Loading... |
37 #define ARM_WINCE_JB_ELEMENT_SIZE INT_REGISTER_SIZE | 37 #define ARM_WINCE_JB_ELEMENT_SIZE INT_REGISTER_SIZE |
38 #define ARM_WINCE_JB_PC 10 | 38 #define ARM_WINCE_JB_PC 10 |
39 | 39 |
40 static CORE_ADDR | 40 static CORE_ADDR |
41 arm_pe_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) | 41 arm_pe_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) |
42 { | 42 { |
43 struct gdbarch *gdbarch = get_frame_arch (frame); | 43 struct gdbarch *gdbarch = get_frame_arch (frame); |
44 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 44 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
45 ULONGEST indirect; | 45 ULONGEST indirect; |
46 struct minimal_symbol *indsym; | 46 struct minimal_symbol *indsym; |
47 char *symname; | 47 const char *symname; |
48 CORE_ADDR next_pc; | 48 CORE_ADDR next_pc; |
49 | 49 |
50 /* The format of an ARM DLL trampoline is: | 50 /* The format of an ARM DLL trampoline is: |
51 ldr ip, [pc] | 51 ldr ip, [pc] |
52 ldr pc, [ip] | 52 ldr pc, [ip] |
53 .dw __imp_<func> */ | 53 .dw __imp_<func> */ |
54 | 54 |
55 if (pc == 0 | 55 if (pc == 0 |
56 || read_memory_unsigned_integer (pc + 0, 4, byte_order) != 0xe59fc000 | 56 || read_memory_unsigned_integer (pc + 0, 4, byte_order) != 0xe59fc000 |
57 || read_memory_unsigned_integer (pc + 4, 4, byte_order) != 0xe59cf000) | 57 || read_memory_unsigned_integer (pc + 4, 4, byte_order) != 0xe59cf000) |
(...skipping 19 matching lines...) Expand all Loading... |
77 return arm_skip_stub (frame, pc); | 77 return arm_skip_stub (frame, pc); |
78 } | 78 } |
79 | 79 |
80 /* GCC emits a call to __gccmain in the prologue of main. | 80 /* GCC emits a call to __gccmain in the prologue of main. |
81 | 81 |
82 The function below examines the code pointed at by PC and checks to | 82 The function below examines the code pointed at by PC and checks to |
83 see if it corresponds to a call to __gccmain. If so, it returns | 83 see if it corresponds to a call to __gccmain. If so, it returns |
84 the address of the instruction following that call. Otherwise, it | 84 the address of the instruction following that call. Otherwise, it |
85 simply returns PC. */ | 85 simply returns PC. */ |
86 | 86 |
87 CORE_ADDR | 87 static CORE_ADDR |
88 arm_wince_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) | 88 arm_wince_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) |
89 { | 89 { |
90 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 90 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
91 ULONGEST this_instr; | 91 ULONGEST this_instr; |
92 | 92 |
93 this_instr = read_memory_unsigned_integer (pc, 4, byte_order); | 93 this_instr = read_memory_unsigned_integer (pc, 4, byte_order); |
94 | 94 |
95 /* bl offset <__gccmain> */ | 95 /* bl offset <__gccmain> */ |
96 if ((this_instr & 0xfff00000) == 0xeb000000) | 96 if ((this_instr & 0xfff00000) == 0xeb000000) |
97 { | 97 { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 void | 162 void |
163 _initialize_arm_wince_tdep (void) | 163 _initialize_arm_wince_tdep (void) |
164 { | 164 { |
165 gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour, | 165 gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour, |
166 arm_wince_osabi_sniffer); | 166 arm_wince_osabi_sniffer); |
167 | 167 |
168 gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE, | 168 gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE, |
169 arm_wince_init_abi); | 169 arm_wince_init_abi); |
170 } | 170 } |
OLD | NEW |