OLD | NEW |
1 /* Common target dependent code for GDB on ARM systems. | 1 /* Common target dependent code for GDB on ARM systems. |
2 | 2 |
3 Copyright (C) 1988-1989, 1991-1993, 1995-1996, 1998-2012 Free | 3 Copyright (C) 1988-1989, 1991-1993, 1995-1996, 1998-2012 Free |
4 Software Foundation, Inc. | 4 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 22 matching lines...) Expand all Loading... |
33 #include "value.h" | 33 #include "value.h" |
34 #include "arch-utils.h" | 34 #include "arch-utils.h" |
35 #include "osabi.h" | 35 #include "osabi.h" |
36 #include "frame-unwind.h" | 36 #include "frame-unwind.h" |
37 #include "frame-base.h" | 37 #include "frame-base.h" |
38 #include "trad-frame.h" | 38 #include "trad-frame.h" |
39 #include "objfiles.h" | 39 #include "objfiles.h" |
40 #include "dwarf2-frame.h" | 40 #include "dwarf2-frame.h" |
41 #include "gdbtypes.h" | 41 #include "gdbtypes.h" |
42 #include "prologue-value.h" | 42 #include "prologue-value.h" |
| 43 #include "remote.h" |
43 #include "target-descriptions.h" | 44 #include "target-descriptions.h" |
44 #include "user-regs.h" | 45 #include "user-regs.h" |
45 #include "observer.h" | 46 #include "observer.h" |
46 | 47 |
47 #include "arm-tdep.h" | 48 #include "arm-tdep.h" |
48 #include "gdb/sim-arm.h" | 49 #include "gdb/sim-arm.h" |
49 | 50 |
50 #include "elf-bfd.h" | 51 #include "elf-bfd.h" |
51 #include "coff/internal.h" | 52 #include "coff/internal.h" |
52 #include "elf/arm.h" | 53 #include "elf/arm.h" |
53 | 54 |
54 #include "gdb_assert.h" | 55 #include "gdb_assert.h" |
55 #include "vec.h" | 56 #include "vec.h" |
56 | 57 |
| 58 #include "record.h" |
| 59 |
57 #include "features/arm-with-m.c" | 60 #include "features/arm-with-m.c" |
| 61 #include "features/arm-with-m-fpa-layout.c" |
| 62 #include "features/arm-with-m-vfp-d16.c" |
58 #include "features/arm-with-iwmmxt.c" | 63 #include "features/arm-with-iwmmxt.c" |
59 #include "features/arm-with-vfpv2.c" | 64 #include "features/arm-with-vfpv2.c" |
60 #include "features/arm-with-vfpv3.c" | 65 #include "features/arm-with-vfpv3.c" |
61 #include "features/arm-with-neon.c" | 66 #include "features/arm-with-neon.c" |
62 | 67 |
63 static int arm_debug; | 68 static int arm_debug; |
64 | 69 |
65 /* Macros for setting and testing a bit in a minimal symbol that marks | 70 /* Macros for setting and testing a bit in a minimal symbol that marks |
66 it as Thumb function. The MSB of the minimal symbol's "info" field | 71 it as Thumb function. The MSB of the minimal symbol's "info" field |
67 is used for this purpose. | 72 is used for this purpose. |
(...skipping 22 matching lines...) Expand all Loading... |
90 { | 95 { |
91 VEC(arm_mapping_symbol_s) **section_maps; | 96 VEC(arm_mapping_symbol_s) **section_maps; |
92 }; | 97 }; |
93 | 98 |
94 /* The list of available "set arm ..." and "show arm ..." commands. */ | 99 /* The list of available "set arm ..." and "show arm ..." commands. */ |
95 static struct cmd_list_element *setarmcmdlist = NULL; | 100 static struct cmd_list_element *setarmcmdlist = NULL; |
96 static struct cmd_list_element *showarmcmdlist = NULL; | 101 static struct cmd_list_element *showarmcmdlist = NULL; |
97 | 102 |
98 /* The type of floating-point to use. Keep this in sync with enum | 103 /* The type of floating-point to use. Keep this in sync with enum |
99 arm_float_model, and the help string in _initialize_arm_tdep. */ | 104 arm_float_model, and the help string in _initialize_arm_tdep. */ |
100 static const char *fp_model_strings[] = | 105 static const char *const fp_model_strings[] = |
101 { | 106 { |
102 "auto", | 107 "auto", |
103 "softfpa", | 108 "softfpa", |
104 "fpa", | 109 "fpa", |
105 "softvfp", | 110 "softvfp", |
106 "vfp", | 111 "vfp", |
107 NULL | 112 NULL |
108 }; | 113 }; |
109 | 114 |
110 /* A variable that can be configured by the user. */ | 115 /* A variable that can be configured by the user. */ |
111 static enum arm_float_model arm_fp_model = ARM_FLOAT_AUTO; | 116 static enum arm_float_model arm_fp_model = ARM_FLOAT_AUTO; |
112 static const char *current_fp_model = "auto"; | 117 static const char *current_fp_model = "auto"; |
113 | 118 |
114 /* The ABI to use. Keep this in sync with arm_abi_kind. */ | 119 /* The ABI to use. Keep this in sync with arm_abi_kind. */ |
115 static const char *arm_abi_strings[] = | 120 static const char *const arm_abi_strings[] = |
116 { | 121 { |
117 "auto", | 122 "auto", |
118 "APCS", | 123 "APCS", |
119 "AAPCS", | 124 "AAPCS", |
120 NULL | 125 NULL |
121 }; | 126 }; |
122 | 127 |
123 /* A variable that can be configured by the user. */ | 128 /* A variable that can be configured by the user. */ |
124 static enum arm_abi_kind arm_abi_global = ARM_ABI_AUTO; | 129 static enum arm_abi_kind arm_abi_global = ARM_ABI_AUTO; |
125 static const char *arm_abi_string = "auto"; | 130 static const char *arm_abi_string = "auto"; |
126 | 131 |
127 /* The execution mode to assume. */ | 132 /* The execution mode to assume. */ |
128 static const char *arm_mode_strings[] = | 133 static const char *const arm_mode_strings[] = |
129 { | 134 { |
130 "auto", | 135 "auto", |
131 "arm", | 136 "arm", |
132 "thumb", | 137 "thumb", |
133 NULL | 138 NULL |
134 }; | 139 }; |
135 | 140 |
136 static const char *arm_fallback_mode_string = "auto"; | 141 static const char *arm_fallback_mode_string = "auto"; |
137 static const char *arm_force_mode_string = "auto"; | 142 static const char *arm_force_mode_string = "auto"; |
138 | 143 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 return 0; | 373 return 0; |
369 } | 374 } |
370 | 375 |
371 /* Determine if the program counter specified in MEMADDR is in a Thumb | 376 /* Determine if the program counter specified in MEMADDR is in a Thumb |
372 function. This function should be called for addresses unrelated to | 377 function. This function should be called for addresses unrelated to |
373 any executing frame; otherwise, prefer arm_frame_is_thumb. */ | 378 any executing frame; otherwise, prefer arm_frame_is_thumb. */ |
374 | 379 |
375 int | 380 int |
376 arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) | 381 arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) |
377 { | 382 { |
378 struct obj_section *sec; | |
379 struct minimal_symbol *sym; | 383 struct minimal_symbol *sym; |
380 char type; | 384 char type; |
381 struct displaced_step_closure* dsc | 385 struct displaced_step_closure* dsc |
382 = get_displaced_step_closure_by_addr(memaddr); | 386 = get_displaced_step_closure_by_addr(memaddr); |
383 | 387 |
384 /* If checking the mode of displaced instruction in copy area, the mode | 388 /* If checking the mode of displaced instruction in copy area, the mode |
385 should be determined by instruction on the original address. */ | 389 should be determined by instruction on the original address. */ |
386 if (dsc) | 390 if (dsc) |
387 { | 391 { |
388 if (debug_displaced) | 392 if (debug_displaced) |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 | 1277 |
1274 Since ldr/str is a very popular instruction, we can't use them as | 1278 Since ldr/str is a very popular instruction, we can't use them as |
1275 'fingerprint' or 'signature' of stack protector sequence. Here we choose | 1279 'fingerprint' or 'signature' of stack protector sequence. Here we choose |
1276 sequence {movw/movt, ldr}/ldr/str plus symbol __stack_chk_guard, if not | 1280 sequence {movw/movt, ldr}/ldr/str plus symbol __stack_chk_guard, if not |
1277 stripped, as the 'fingerprint' of a stack protector cdoe sequence. */ | 1281 stripped, as the 'fingerprint' of a stack protector cdoe sequence. */ |
1278 | 1282 |
1279 static CORE_ADDR | 1283 static CORE_ADDR |
1280 arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) | 1284 arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) |
1281 { | 1285 { |
1282 enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); | 1286 enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); |
1283 unsigned int address, basereg; | 1287 unsigned int basereg; |
1284 struct minimal_symbol *stack_chk_guard; | 1288 struct minimal_symbol *stack_chk_guard; |
1285 int offset; | 1289 int offset; |
1286 int is_thumb = arm_pc_is_thumb (gdbarch, pc); | 1290 int is_thumb = arm_pc_is_thumb (gdbarch, pc); |
1287 CORE_ADDR addr; | 1291 CORE_ADDR addr; |
1288 | 1292 |
1289 /* Try to parse the instructions in Step 1. */ | 1293 /* Try to parse the instructions in Step 1. */ |
1290 addr = arm_analyze_load_stack_chk_guard (pc, gdbarch, | 1294 addr = arm_analyze_load_stack_chk_guard (pc, gdbarch, |
1291 &basereg, &offset); | 1295 &basereg, &offset); |
1292 if (!addr) | 1296 if (!addr) |
1293 return pc; | 1297 return pc; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 [stfe f4, [sp, #-12]!] | 1369 [stfe f4, [sp, #-12]!] |
1366 sub fp, ip, #nn @@ nn == 20 or 4 depending on second insn. */ | 1370 sub fp, ip, #nn @@ nn == 20 or 4 depending on second insn. */ |
1367 | 1371 |
1368 static CORE_ADDR | 1372 static CORE_ADDR |
1369 arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) | 1373 arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) |
1370 { | 1374 { |
1371 enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); | 1375 enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); |
1372 unsigned long inst; | 1376 unsigned long inst; |
1373 CORE_ADDR skip_pc; | 1377 CORE_ADDR skip_pc; |
1374 CORE_ADDR func_addr, limit_pc; | 1378 CORE_ADDR func_addr, limit_pc; |
1375 struct symtab_and_line sal; | |
1376 | 1379 |
1377 /* See if we can determine the end of the prologue via the symbol table. | 1380 /* See if we can determine the end of the prologue via the symbol table. |
1378 If so, then return either PC, or the PC after the prologue, whichever | 1381 If so, then return either PC, or the PC after the prologue, whichever |
1379 is greater. */ | 1382 is greater. */ |
1380 if (find_pc_partial_function (pc, NULL, &func_addr, NULL)) | 1383 if (find_pc_partial_function (pc, NULL, &func_addr, NULL)) |
1381 { | 1384 { |
1382 CORE_ADDR post_prologue_pc | 1385 CORE_ADDR post_prologue_pc |
1383 = skip_prologue_using_sal (gdbarch, func_addr); | 1386 = skip_prologue_using_sal (gdbarch, func_addr); |
1384 struct symtab *s = find_pc_symtab (func_addr); | 1387 struct symtab *s = find_pc_symtab (func_addr); |
1385 | 1388 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 The comments for thumb_skip_prolog() describe the algorithm we use | 1527 The comments for thumb_skip_prolog() describe the algorithm we use |
1525 to detect the end of the prolog. */ | 1528 to detect the end of the prolog. */ |
1526 /* *INDENT-ON* */ | 1529 /* *INDENT-ON* */ |
1527 | 1530 |
1528 static void | 1531 static void |
1529 thumb_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR prev_pc, | 1532 thumb_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR prev_pc, |
1530 CORE_ADDR block_addr, struct arm_prologue_cache *cache) | 1533 CORE_ADDR block_addr, struct arm_prologue_cache *cache) |
1531 { | 1534 { |
1532 CORE_ADDR prologue_start; | 1535 CORE_ADDR prologue_start; |
1533 CORE_ADDR prologue_end; | 1536 CORE_ADDR prologue_end; |
1534 CORE_ADDR current_pc; | |
1535 | 1537 |
1536 if (find_pc_partial_function (block_addr, NULL, &prologue_start, | 1538 if (find_pc_partial_function (block_addr, NULL, &prologue_start, |
1537 &prologue_end)) | 1539 &prologue_end)) |
1538 { | 1540 { |
1539 /* See comment in arm_scan_prologue for an explanation of | 1541 /* See comment in arm_scan_prologue for an explanation of |
1540 this heuristics. */ | 1542 this heuristics. */ |
1541 if (prologue_end > prologue_start + 64) | 1543 if (prologue_end > prologue_start + 64) |
1542 { | 1544 { |
1543 prologue_end = prologue_start + 64; | 1545 prologue_end = prologue_start + 64; |
1544 } | 1546 } |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 found_stack_adjust = 1; | 3210 found_stack_adjust = 1; |
3209 else if ((insn & 0x0df0f000) == 0x0040d000) | 3211 else if ((insn & 0x0df0f000) == 0x0040d000) |
3210 /* SUB SP (register or immediate). */ | 3212 /* SUB SP (register or immediate). */ |
3211 found_stack_adjust = 1; | 3213 found_stack_adjust = 1; |
3212 else if ((insn & 0x0ffffff0) == 0x01a0d000) | 3214 else if ((insn & 0x0ffffff0) == 0x01a0d000) |
3213 /* MOV SP. */ | 3215 /* MOV SP. */ |
3214 found_stack_adjust = 1; | 3216 found_stack_adjust = 1; |
3215 else if ((insn & 0x0fff0000) == 0x08bd0000) | 3217 else if ((insn & 0x0fff0000) == 0x08bd0000) |
3216 /* POP (LDMIA). */ | 3218 /* POP (LDMIA). */ |
3217 found_stack_adjust = 1; | 3219 found_stack_adjust = 1; |
| 3220 else if ((insn & 0x0fff0000) == 0x049d0000) |
| 3221 /* POP of a single register. */ |
| 3222 found_stack_adjust = 1; |
3218 } | 3223 } |
3219 | 3224 |
3220 if (found_stack_adjust) | 3225 if (found_stack_adjust) |
3221 return 1; | 3226 return 1; |
3222 | 3227 |
3223 return 0; | 3228 return 0; |
3224 } | 3229 } |
3225 | 3230 |
3226 | 3231 |
3227 /* When arguments must be pushed onto the stack, they go on in reverse | 3232 /* When arguments must be pushed onto the stack, they go on in reverse |
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5120 } | 5125 } |
5121 | 5126 |
5122 /* Given BUF, which is OLD_LEN bytes ending at ENDADDR, expand | 5127 /* Given BUF, which is OLD_LEN bytes ending at ENDADDR, expand |
5123 the buffer to be NEW_LEN bytes ending at ENDADDR. Return | 5128 the buffer to be NEW_LEN bytes ending at ENDADDR. Return |
5124 NULL if an error occurs. BUF is freed. */ | 5129 NULL if an error occurs. BUF is freed. */ |
5125 | 5130 |
5126 static gdb_byte * | 5131 static gdb_byte * |
5127 extend_buffer_earlier (gdb_byte *buf, CORE_ADDR endaddr, | 5132 extend_buffer_earlier (gdb_byte *buf, CORE_ADDR endaddr, |
5128 int old_len, int new_len) | 5133 int old_len, int new_len) |
5129 { | 5134 { |
5130 gdb_byte *new_buf, *middle; | 5135 gdb_byte *new_buf; |
5131 int bytes_to_read = new_len - old_len; | 5136 int bytes_to_read = new_len - old_len; |
5132 | 5137 |
5133 new_buf = xmalloc (new_len); | 5138 new_buf = xmalloc (new_len); |
5134 memcpy (new_buf + bytes_to_read, buf, old_len); | 5139 memcpy (new_buf + bytes_to_read, buf, old_len); |
5135 xfree (buf); | 5140 xfree (buf); |
5136 if (target_read_memory (endaddr - new_len, new_buf, bytes_to_read) != 0) | 5141 if (target_read_memory (endaddr - new_len, new_buf, bytes_to_read) != 0) |
5137 { | 5142 { |
5138 xfree (new_buf); | 5143 xfree (new_buf); |
5139 return NULL; | 5144 return NULL; |
5140 } | 5145 } |
(...skipping 12 matching lines...) Expand all Loading... |
5153 | 5158 |
5154 /* Adjust a breakpoint's address to move breakpoints out of IT blocks. | 5159 /* Adjust a breakpoint's address to move breakpoints out of IT blocks. |
5155 A breakpoint in an IT block may not be hit, depending on the | 5160 A breakpoint in an IT block may not be hit, depending on the |
5156 condition flags. */ | 5161 condition flags. */ |
5157 static CORE_ADDR | 5162 static CORE_ADDR |
5158 arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) | 5163 arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) |
5159 { | 5164 { |
5160 gdb_byte *buf; | 5165 gdb_byte *buf; |
5161 char map_type; | 5166 char map_type; |
5162 CORE_ADDR boundary, func_start; | 5167 CORE_ADDR boundary, func_start; |
5163 int buf_len, buf2_len; | 5168 int buf_len; |
5164 enum bfd_endian order = gdbarch_byte_order_for_code (gdbarch); | 5169 enum bfd_endian order = gdbarch_byte_order_for_code (gdbarch); |
5165 int i, any, last_it, last_it_count; | 5170 int i, any, last_it, last_it_count; |
5166 | 5171 |
5167 /* If we are using BKPT breakpoints, none of this is necessary. */ | 5172 /* If we are using BKPT breakpoints, none of this is necessary. */ |
5168 if (gdbarch_tdep (gdbarch)->thumb2_breakpoint == NULL) | 5173 if (gdbarch_tdep (gdbarch)->thumb2_breakpoint == NULL) |
5169 return bpaddr; | 5174 return bpaddr; |
5170 | 5175 |
5171 /* ARM mode does not have this problem. */ | 5176 /* ARM mode does not have this problem. */ |
5172 if (!arm_pc_is_thumb (gdbarch, bpaddr)) | 5177 if (!arm_pc_is_thumb (gdbarch, bpaddr)) |
5173 return bpaddr; | 5178 return bpaddr; |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6853 the registers in the transferred list into a contiguous range r0...rX (to | 6858 the registers in the transferred list into a contiguous range r0...rX (to |
6854 avoid loading PC directly and losing control of the debugged program), so we | 6859 avoid loading PC directly and losing control of the debugged program), so we |
6855 must undo that here. */ | 6860 must undo that here. */ |
6856 | 6861 |
6857 static void | 6862 static void |
6858 cleanup_block_load_pc (struct gdbarch *gdbarch, | 6863 cleanup_block_load_pc (struct gdbarch *gdbarch, |
6859 struct regcache *regs, | 6864 struct regcache *regs, |
6860 struct displaced_step_closure *dsc) | 6865 struct displaced_step_closure *dsc) |
6861 { | 6866 { |
6862 uint32_t status = displaced_read_reg (regs, dsc, ARM_PS_REGNUM); | 6867 uint32_t status = displaced_read_reg (regs, dsc, ARM_PS_REGNUM); |
6863 int load_executed = condition_true (dsc->u.block.cond, status), i; | 6868 int load_executed = condition_true (dsc->u.block.cond, status); |
6864 unsigned int mask = dsc->u.block.regmask, write_reg = ARM_PC_REGNUM; | 6869 unsigned int mask = dsc->u.block.regmask, write_reg = ARM_PC_REGNUM; |
6865 unsigned int regs_loaded = bitcount (mask); | 6870 unsigned int regs_loaded = bitcount (mask); |
6866 unsigned int num_to_shuffle = regs_loaded, clobbered; | 6871 unsigned int num_to_shuffle = regs_loaded, clobbered; |
6867 | 6872 |
6868 /* The method employed here will fail if the register list is fully populated | 6873 /* The method employed here will fail if the register list is fully populated |
6869 (we need to avoid loading PC directly). */ | 6874 (we need to avoid loading PC directly). */ |
6870 gdb_assert (num_to_shuffle < 16); | 6875 gdb_assert (num_to_shuffle < 16); |
6871 | 6876 |
6872 if (!load_executed) | 6877 if (!load_executed) |
6873 return; | 6878 return; |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8695 { | 8700 { |
8696 *lenptr = tdep->arm_breakpoint_size; | 8701 *lenptr = tdep->arm_breakpoint_size; |
8697 return tdep->arm_breakpoint; | 8702 return tdep->arm_breakpoint; |
8698 } | 8703 } |
8699 } | 8704 } |
8700 | 8705 |
8701 static void | 8706 static void |
8702 arm_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, | 8707 arm_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, |
8703 int *kindptr) | 8708 int *kindptr) |
8704 { | 8709 { |
8705 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | |
8706 | |
8707 arm_breakpoint_from_pc (gdbarch, pcptr, kindptr); | 8710 arm_breakpoint_from_pc (gdbarch, pcptr, kindptr); |
8708 | 8711 |
8709 if (arm_pc_is_thumb (gdbarch, *pcptr) && *kindptr == 4) | 8712 if (arm_pc_is_thumb (gdbarch, *pcptr) && *kindptr == 4) |
8710 /* The documented magic value for a 32-bit Thumb-2 breakpoint, so | 8713 /* The documented magic value for a 32-bit Thumb-2 breakpoint, so |
8711 that this is not confused with a 32-bit ARM breakpoint. */ | 8714 that this is not confused with a 32-bit ARM breakpoint. */ |
8712 *kindptr = 3; | 8715 *kindptr = 3; |
8713 } | 8716 } |
8714 | 8717 |
8715 /* Extract from an array REGBUF containing the (raw) register state a | 8718 /* Extract from an array REGBUF containing the (raw) register state a |
8716 function return value of type TYPE, and copy that, in virtual | 8719 function return value of type TYPE, and copy that, in virtual |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8999 len -= INT_REGISTER_SIZE; | 9002 len -= INT_REGISTER_SIZE; |
9000 valbuf += INT_REGISTER_SIZE; | 9003 valbuf += INT_REGISTER_SIZE; |
9001 } | 9004 } |
9002 } | 9005 } |
9003 } | 9006 } |
9004 | 9007 |
9005 | 9008 |
9006 /* Handle function return values. */ | 9009 /* Handle function return values. */ |
9007 | 9010 |
9008 static enum return_value_convention | 9011 static enum return_value_convention |
9009 arm_return_value (struct gdbarch *gdbarch, struct type *func_type, | 9012 arm_return_value (struct gdbarch *gdbarch, struct value *function, |
9010 struct type *valtype, struct regcache *regcache, | 9013 struct type *valtype, struct regcache *regcache, |
9011 gdb_byte *readbuf, const gdb_byte *writebuf) | 9014 gdb_byte *readbuf, const gdb_byte *writebuf) |
9012 { | 9015 { |
9013 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 9016 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
| 9017 struct type *func_type = function ? value_type (function) : NULL; |
9014 enum arm_vfp_cprc_base_type vfp_base_type; | 9018 enum arm_vfp_cprc_base_type vfp_base_type; |
9015 int vfp_base_count; | 9019 int vfp_base_count; |
9016 | 9020 |
9017 if (arm_vfp_abi_for_function (gdbarch, func_type) | 9021 if (arm_vfp_abi_for_function (gdbarch, func_type) |
9018 && arm_vfp_call_candidate (valtype, &vfp_base_type, &vfp_base_count)) | 9022 && arm_vfp_call_candidate (valtype, &vfp_base_type, &vfp_base_count)) |
9019 { | 9023 { |
9020 int reg_char = arm_vfp_cprc_reg_char (vfp_base_type); | 9024 int reg_char = arm_vfp_cprc_reg_char (vfp_base_type); |
9021 int unit_length = arm_vfp_cprc_unit_length (vfp_base_type); | 9025 int unit_length = arm_vfp_cprc_unit_length (vfp_base_type); |
9022 int i; | 9026 int i; |
9023 for (i = 0; i < vfp_base_count; i++) | 9027 for (i = 0; i < vfp_base_count; i++) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9094 *pc = extract_unsigned_integer (buf, INT_REGISTER_SIZE, byte_order); | 9098 *pc = extract_unsigned_integer (buf, INT_REGISTER_SIZE, byte_order); |
9095 return 1; | 9099 return 1; |
9096 } | 9100 } |
9097 | 9101 |
9098 /* Recognize GCC and GNU ld's trampolines. If we are in a trampoline, | 9102 /* Recognize GCC and GNU ld's trampolines. If we are in a trampoline, |
9099 return the target PC. Otherwise return 0. */ | 9103 return the target PC. Otherwise return 0. */ |
9100 | 9104 |
9101 CORE_ADDR | 9105 CORE_ADDR |
9102 arm_skip_stub (struct frame_info *frame, CORE_ADDR pc) | 9106 arm_skip_stub (struct frame_info *frame, CORE_ADDR pc) |
9103 { | 9107 { |
9104 char *name; | 9108 const char *name; |
9105 int namelen; | 9109 int namelen; |
9106 CORE_ADDR start_addr; | 9110 CORE_ADDR start_addr; |
9107 | 9111 |
9108 /* Find the starting address and name of the function containing the PC. */ | 9112 /* Find the starting address and name of the function containing the PC. */ |
9109 if (find_pc_partial_function (pc, &name, &start_addr, NULL) == 0) | 9113 if (find_pc_partial_function (pc, &name, &start_addr, NULL) == 0) |
9110 return 0; | 9114 return 0; |
9111 | 9115 |
9112 /* If PC is in a Thumb call or return stub, return the address of the | 9116 /* If PC is in a Thumb call or return stub, return the address of the |
9113 target PC, which is in a register. The thunk functions are called | 9117 target PC, which is in a register. The thunk functions are called |
9114 _call_via_xx, where x is the register name. The possible names | 9118 _call_via_xx, where x is the register name. The possible names |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9270 arm_abi_strings[tdep->arm_abi]); | 9274 arm_abi_strings[tdep->arm_abi]); |
9271 else | 9275 else |
9272 fprintf_filtered (file, _("The current ARM ABI is \"%s\".\n"), | 9276 fprintf_filtered (file, _("The current ARM ABI is \"%s\".\n"), |
9273 arm_abi_string); | 9277 arm_abi_string); |
9274 } | 9278 } |
9275 | 9279 |
9276 static void | 9280 static void |
9277 arm_show_fallback_mode (struct ui_file *file, int from_tty, | 9281 arm_show_fallback_mode (struct ui_file *file, int from_tty, |
9278 struct cmd_list_element *c, const char *value) | 9282 struct cmd_list_element *c, const char *value) |
9279 { | 9283 { |
9280 struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch); | |
9281 | |
9282 fprintf_filtered (file, | 9284 fprintf_filtered (file, |
9283 _("The current execution mode assumed " | 9285 _("The current execution mode assumed " |
9284 "(when symbols are unavailable) is \"%s\".\n"), | 9286 "(when symbols are unavailable) is \"%s\".\n"), |
9285 arm_fallback_mode_string); | 9287 arm_fallback_mode_string); |
9286 } | 9288 } |
9287 | 9289 |
9288 static void | 9290 static void |
9289 arm_show_force_mode (struct ui_file *file, int from_tty, | 9291 arm_show_force_mode (struct ui_file *file, int from_tty, |
9290 struct cmd_list_element *c, const char *value) | 9292 struct cmd_list_element *c, const char *value) |
9291 { | 9293 { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9558 } | 9560 } |
9559 | 9561 |
9560 /* Store the contents of BUF to a NEON quad register, by writing to | 9562 /* Store the contents of BUF to a NEON quad register, by writing to |
9561 two double registers. This is used to implement the quad pseudo | 9563 two double registers. This is used to implement the quad pseudo |
9562 registers, and for argument passing in case the quad registers are | 9564 registers, and for argument passing in case the quad registers are |
9563 missing; vectors are passed in quad registers when using the VFP | 9565 missing; vectors are passed in quad registers when using the VFP |
9564 ABI, even if a NEON unit is not present. REGNUM is the index | 9566 ABI, even if a NEON unit is not present. REGNUM is the index |
9565 of the quad register, in [0, 15]. */ | 9567 of the quad register, in [0, 15]. */ |
9566 | 9568 |
9567 static void | 9569 static void |
error: old chunk mismatch |
None
OLD | NEW |