X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Farm-tdep.c;h=53eee769263279a5a98a48528b94113255e3c930;hb=b926417afaea99ed17663e06d6654d0048536017;hp=2eb7bb1535396a04f74401107b818330d8979703;hpb=9fde51ed303ea3ecbaa7c0084ea417e775a5db29;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 2eb7bb1535..53eee76926 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1,6 +1,6 @@ /* Common target dependent code for GDB on ARM systems. - Copyright (C) 1988-2016 Free Software Foundation, Inc. + Copyright (C) 1988-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -27,9 +27,10 @@ #include "gdbcmd.h" #include "gdbcore.h" #include "dis-asm.h" /* For register styles. */ +#include "disasm.h" #include "regcache.h" #include "reggroups.h" -#include "doublest.h" +#include "target-float.h" #include "value.h" #include "arch-utils.h" #include "osabi.h" @@ -43,7 +44,7 @@ #include "remote.h" #include "target-descriptions.h" #include "user-regs.h" -#include "observer.h" +#include "observable.h" #include "arch/arm.h" #include "arch/arm-get-next-pcs.h" @@ -58,14 +59,19 @@ #include "record.h" #include "record-full.h" - -#include "features/arm-with-m.c" -#include "features/arm-with-m-fpa-layout.c" -#include "features/arm-with-m-vfp-d16.c" -#include "features/arm-with-iwmmxt.c" -#include "features/arm-with-vfpv2.c" -#include "features/arm-with-vfpv3.c" -#include "features/arm-with-neon.c" +#include + +#include "features/arm/arm-with-m.c" +#include "features/arm/arm-with-m-fpa-layout.c" +#include "features/arm/arm-with-m-vfp-d16.c" +#include "features/arm/arm-with-iwmmxt.c" +#include "features/arm/arm-with-vfpv2.c" +#include "features/arm/arm-with-vfpv3.c" +#include "features/arm/arm-with-neon.c" + +#if GDB_SELF_TEST +#include "selftest.h" +#endif static int arm_debug; @@ -143,16 +149,6 @@ static const char *const arm_mode_strings[] = static const char *arm_fallback_mode_string = "auto"; static const char *arm_force_mode_string = "auto"; -/* Internal override of the execution mode. -1 means no override, - 0 means override to ARM mode, 1 means override to Thumb mode. - The effect is the same as if arm_force_mode has been set by the - user (except the internal override has precedence over a user's - arm_force_mode override). */ -static int arm_override_mode = -1; - -/* Number of different reg name sets (options). */ -static int num_disassembly_options; - /* The standard register names, and all the valid aliases for them. Note that `fp', `sp' and `pc' are not added in this alias list, because they have been added as builtin user registers in @@ -213,6 +209,9 @@ static const char *const arm_register_names[] = "f4", "f5", "f6", "f7", /* 20 21 22 23 */ "fps", "cpsr" }; /* 24 25 */ +/* Holds the current set of options to be passed to the disassembler. */ +static char *arm_disassembler_options; + /* Valid register name styles. */ static const char **valid_disassembly_styles; @@ -221,17 +220,14 @@ static const char *disassembly_style; /* This is used to keep the bfd arch_info in sync with the disassembly style. */ -static void set_disassembly_style_sfunc(char *, int, +static void set_disassembly_style_sfunc (const char *, int, struct cmd_list_element *); -static void set_disassembly_style (void); - -static void convert_from_extended (const struct floatformat *, const void *, - void *, int); -static void convert_to_extended (const struct floatformat *, void *, - const void *, int); +static void show_disassembly_style_sfunc (struct ui_file *, int, + struct cmd_list_element *, + const char *); static enum register_status arm_neon_quad_read (struct gdbarch *gdbarch, - struct regcache *regcache, + readable_regcache *regcache, int regnum, gdb_byte *buf); static void arm_neon_quad_write (struct gdbarch *gdbarch, struct regcache *regcache, @@ -301,7 +297,7 @@ int arm_is_thumb (struct regcache *regcache) { ULONGEST cpsr; - ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regcache)); + ULONGEST t_bit = arm_psr_thumb_bit (regcache->arch ()); cpsr = regcache_raw_get_unsigned (regcache, ARM_PS_REGNUM); @@ -403,8 +399,9 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) { struct bound_minimal_symbol sym; char type; - struct displaced_step_closure* dsc - = get_displaced_step_closure_by_addr(memaddr); + arm_displaced_step_closure *dsc + = ((arm_displaced_step_closure * ) + get_displaced_step_closure_by_addr (memaddr)); /* If checking the mode of displaced instruction in copy area, the mode should be determined by instruction on the original address. */ @@ -422,10 +419,6 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) if (IS_THUMB_ADDR (memaddr)) return 1; - /* Respect internal mode override if active. */ - if (arm_override_mode != -1) - return arm_override_mode; - /* If the user wants to override the symbol table, let him. */ if (strcmp (arm_force_mode_string, "arm") == 0) return 0; @@ -464,6 +457,62 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) return 0; } +/* Determine if the address specified equals any of these magic return + values, called EXC_RETURN, defined by the ARM v6-M and v7-M + architectures. + + From ARMv6-M Reference Manual B1.5.8 + Table B1-5 Exception return behavior + + EXC_RETURN Return To Return Stack + 0xFFFFFFF1 Handler mode Main + 0xFFFFFFF9 Thread mode Main + 0xFFFFFFFD Thread mode Process + + From ARMv7-M Reference Manual B1.5.8 + Table B1-8 EXC_RETURN definition of exception return behavior, no FP + + EXC_RETURN Return To Return Stack + 0xFFFFFFF1 Handler mode Main + 0xFFFFFFF9 Thread mode Main + 0xFFFFFFFD Thread mode Process + + Table B1-9 EXC_RETURN definition of exception return behavior, with + FP + + EXC_RETURN Return To Return Stack Frame Type + 0xFFFFFFE1 Handler mode Main Extended + 0xFFFFFFE9 Thread mode Main Extended + 0xFFFFFFED Thread mode Process Extended + 0xFFFFFFF1 Handler mode Main Basic + 0xFFFFFFF9 Thread mode Main Basic + 0xFFFFFFFD Thread mode Process Basic + + For more details see "B1.5.8 Exception return behavior" + in both ARMv6-M and ARMv7-M Architecture Reference Manuals. */ + +static int +arm_m_addr_is_magic (CORE_ADDR addr) +{ + switch (addr) + { + /* Values from Tables in B1.5.8 the EXC_RETURN definitions of + the exception return behavior. */ + case 0xffffffe1: + case 0xffffffe9: + case 0xffffffed: + case 0xfffffff1: + case 0xfffffff9: + case 0xfffffffd: + /* Address is magic. */ + return 1; + + default: + /* Address is not magic. */ + return 0; + } +} + /* Remove useless bits from addresses in a running program. */ static CORE_ADDR arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val) @@ -471,7 +520,7 @@ arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val) /* On M-profile devices, do not strip the low bit from EXC_RETURN (the magic exception return address). */ if (gdbarch_tdep (gdbarch)->is_m - && (val & 0xfffffff0) == 0xfffffff0) + && arm_m_addr_is_magic (val)) return val; if (arm_apcs_32) @@ -524,9 +573,9 @@ skip_prologue_function (struct gdbarch *gdbarch, CORE_ADDR pc, int is_thumb) implementation (this is hand-written ARM assembler in glibc). */ if (!is_thumb - && read_memory_unsigned_integer (pc, 4, byte_order_for_code) + && read_code_unsigned_integer (pc, 4, byte_order_for_code) == 0xe3e00a0f /* mov r0, #0xffff0fff */ - && read_memory_unsigned_integer (pc + 4, 4, byte_order_for_code) + && read_code_unsigned_integer (pc + 4, 4, byte_order_for_code) == 0xe240f01f) /* sub pc, r0, #31 */ return 1; } @@ -599,28 +648,25 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); int i; pv_t regs[16]; - struct pv_area *stack; - struct cleanup *back_to; CORE_ADDR offset; CORE_ADDR unrecognized_pc = 0; for (i = 0; i < 16; i++) regs[i] = pv_register (i, 0); - stack = make_pv_area (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch)); - back_to = make_cleanup_free_pv_area (stack); + pv_area stack (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch)); while (start < limit) { unsigned short insn; - insn = read_memory_unsigned_integer (start, 2, byte_order_for_code); + insn = read_code_unsigned_integer (start, 2, byte_order_for_code); if ((insn & 0xfe00) == 0xb400) /* push { rlist } */ { int regno; int mask; - if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM])) + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) break; /* Bits 0-7 contain a mask for registers R0-R7. Bit 8 says @@ -633,7 +679,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, { regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -4); - pv_area_store (stack, regs[ARM_SP_REGNUM], 4, regs[regno]); + stack.store (regs[ARM_SP_REGNUM], 4, regs[regno]); } } else if ((insn & 0xff80) == 0xb080) /* sub sp, #imm */ @@ -687,10 +733,10 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, offset = (insn & 0xff) << 2; addr = pv_add_constant (regs[ARM_SP_REGNUM], offset); - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; - pv_area_store (stack, addr, 4, regs[regno]); + stack.store (addr, 4, regs[regno]); } else if ((insn & 0xf800) == 0x6000) /* str rd, [rn, #off] */ { @@ -701,10 +747,10 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, offset = bits (insn, 6, 10) << 2; addr = pv_add_constant (regs[rn], offset); - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; - pv_area_store (stack, addr, 4, regs[rd]); + stack.store (addr, 4, regs[rd]); } else if (((insn & 0xf800) == 0x7000 /* strb Rd, [Rn, #off] */ || (insn & 0xf800) == 0x8000) /* strh Rd, [Rn, #off] */ @@ -744,8 +790,8 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, { unsigned short inst2; - inst2 = read_memory_unsigned_integer (start + 2, 2, - byte_order_for_code); + inst2 = read_code_unsigned_integer (start + 2, 2, + byte_order_for_code); if ((insn & 0xf800) == 0xf000 && (inst2 & 0xe800) == 0xe800) { @@ -780,7 +826,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, pv_t addr = regs[bits (insn, 0, 3)]; int regno; - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; /* Calculate offsets of saved registers. */ @@ -788,7 +834,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, if (inst2 & (1 << regno)) { addr = pv_add_constant (addr, -4); - pv_area_store (stack, addr, 4, regs[regno]); + stack.store (addr, 4, regs[regno]); } if (insn & 0x0020) @@ -809,12 +855,12 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, else addr = pv_add_constant (addr, -offset); - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; - pv_area_store (stack, addr, 4, regs[regno1]); - pv_area_store (stack, pv_add_constant (addr, 4), - 4, regs[regno2]); + stack.store (addr, 4, regs[regno1]); + stack.store (pv_add_constant (addr, 4), + 4, regs[regno2]); if (insn & 0x0020) regs[bits (insn, 0, 3)] = addr; @@ -833,10 +879,10 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, else addr = pv_add_constant (addr, -offset); - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; - pv_area_store (stack, addr, 4, regs[regno]); + stack.store (addr, 4, regs[regno]); if (inst2 & 0x0100) regs[bits (insn, 0, 3)] = addr; @@ -851,10 +897,10 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, offset = inst2 & 0xfff; addr = pv_add_constant (regs[bits (insn, 0, 3)], offset); - if (pv_area_store_would_trash (stack, addr)) + if (stack.store_would_trash (addr)) break; - pv_area_store (stack, addr, 4, regs[regno]); + stack.store (addr, 4, regs[regno]); } else if ((insn & 0xffd0) == 0xf880 /* str{bh}.w Rt,[Rn,#imm] */ @@ -1037,10 +1083,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, unrecognized_pc = start; if (cache == NULL) - { - do_cleanups (back_to); - return unrecognized_pc; - } + return unrecognized_pc; if (pv_is_register (regs[ARM_FP_REGNUM], ARM_SP_REGNUM)) { @@ -1062,10 +1105,9 @@ thumb_analyze_prologue (struct gdbarch *gdbarch, } for (i = 0; i < 16; i++) - if (pv_area_find_reg (stack, gdbarch, i, &offset)) + if (stack.find_reg (gdbarch, i, &offset)) cache->saved_regs[i].addr = offset; - do_cleanups (back_to); return unrecognized_pc; } @@ -1088,7 +1130,7 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch, if (is_thumb) { unsigned short insn1 - = read_memory_unsigned_integer (pc, 2, byte_order_for_code); + = read_code_unsigned_integer (pc, 2, byte_order_for_code); if ((insn1 & 0xf800) == 0x4800) /* ldr Rd, #immed */ { @@ -1101,14 +1143,14 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch, else if ((insn1 & 0xfbf0) == 0xf240) /* movw Rd, #const */ { unsigned short insn2 - = read_memory_unsigned_integer (pc + 2, 2, byte_order_for_code); + = read_code_unsigned_integer (pc + 2, 2, byte_order_for_code); low = EXTRACT_MOVW_MOVT_IMM_T (insn1, insn2); insn1 - = read_memory_unsigned_integer (pc + 4, 2, byte_order_for_code); + = read_code_unsigned_integer (pc + 4, 2, byte_order_for_code); insn2 - = read_memory_unsigned_integer (pc + 6, 2, byte_order_for_code); + = read_code_unsigned_integer (pc + 6, 2, byte_order_for_code); /* movt Rd, #const */ if ((insn1 & 0xfbc0) == 0xf2c0) @@ -1123,7 +1165,7 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch, else { unsigned int insn - = read_memory_unsigned_integer (pc, 4, byte_order_for_code); + = read_code_unsigned_integer (pc, 4, byte_order_for_code); if ((insn & 0x0e5f0000) == 0x041f0000) /* ldr Rd, [PC, #immed] */ { @@ -1139,7 +1181,7 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch, low = EXTRACT_MOVW_MOVT_IMM_A (insn); insn - = read_memory_unsigned_integer (pc + 4, 4, byte_order_for_code); + = read_code_unsigned_integer (pc + 4, 4, byte_order_for_code); if ((insn & 0x0ff00000) == 0x03400000) /* movt Rd, #const */ { @@ -1211,7 +1253,7 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) { unsigned int destreg; unsigned short insn - = read_memory_unsigned_integer (pc + offset, 2, byte_order_for_code); + = read_code_unsigned_integer (pc + offset, 2, byte_order_for_code); /* Step 2: ldr Rd, [Rn, #immed], encoding T1. */ if ((insn & 0xf800) != 0x6800) @@ -1220,8 +1262,8 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) return pc; destreg = bits (insn, 0, 2); - insn = read_memory_unsigned_integer (pc + offset + 2, 2, - byte_order_for_code); + insn = read_code_unsigned_integer (pc + offset + 2, 2, + byte_order_for_code); /* Step 3: str Rd, [Rn, #immed], encoding T1. */ if ((insn & 0xf800) != 0x6000) return pc; @@ -1232,7 +1274,7 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) { unsigned int destreg; unsigned int insn - = read_memory_unsigned_integer (pc + offset, 4, byte_order_for_code); + = read_code_unsigned_integer (pc + offset, 4, byte_order_for_code); /* Step 2: ldr Rd, [Rn, #immed], encoding A1. */ if ((insn & 0x0e500000) != 0x04100000) @@ -1241,7 +1283,7 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) return pc; destreg = bits (insn, 12, 15); /* Step 3: str Rd, [Rn, #immed], encoding A1. */ - insn = read_memory_unsigned_integer (pc + offset + 4, + insn = read_code_unsigned_integer (pc + offset + 4, 4, byte_order_for_code); if ((insn & 0x0e500000) != 0x04000000) return pc; @@ -1393,7 +1435,7 @@ thumb_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR prev_pc, function is. */ return; - prologue_end = min (prologue_end, prev_pc); + prologue_end = std::min (prologue_end, prev_pc); thumb_analyze_prologue (gdbarch, prologue_start, prologue_end, cache); } @@ -1441,8 +1483,6 @@ arm_analyze_prologue (struct gdbarch *gdbarch, int regno; CORE_ADDR offset, current_pc; pv_t regs[ARM_FPS_REGNUM]; - struct pv_area *stack; - struct cleanup *back_to; CORE_ADDR unrecognized_pc = 0; /* Search the prologue looking for instructions that set up the @@ -1457,15 +1497,14 @@ arm_analyze_prologue (struct gdbarch *gdbarch, for (regno = 0; regno < ARM_FPS_REGNUM; regno++) regs[regno] = pv_register (regno, 0); - stack = make_pv_area (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch)); - back_to = make_cleanup_free_pv_area (stack); + pv_area stack (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch)); for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 4) { unsigned int insn - = read_memory_unsigned_integer (current_pc, 4, byte_order_for_code); + = read_code_unsigned_integer (current_pc, 4, byte_order_for_code); if (insn == 0xe1a0c00d) /* mov ip, sp */ { @@ -1495,11 +1534,11 @@ arm_analyze_prologue (struct gdbarch *gdbarch, else if ((insn & 0xffff0fff) == 0xe52d0004) /* str Rd, [sp, #-4]! */ { - if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM])) + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) break; regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -4); - pv_area_store (stack, regs[ARM_SP_REGNUM], 4, - regs[bits (insn, 12, 15)]); + stack.store (regs[ARM_SP_REGNUM], 4, + regs[bits (insn, 12, 15)]); continue; } else if ((insn & 0xffff0000) == 0xe92d0000) @@ -1509,7 +1548,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, { int mask = insn & 0xffff; - if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM])) + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) break; /* Calculate offsets of saved registers. */ @@ -1518,7 +1557,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, { regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -4); - pv_area_store (stack, regs[ARM_SP_REGNUM], 4, regs[regno]); + stack.store (regs[ARM_SP_REGNUM], 4, regs[regno]); } } else if ((insn & 0xffff0000) == 0xe54b0000 /* strb rx,[r11,#-n] */ @@ -1560,12 +1599,12 @@ arm_analyze_prologue (struct gdbarch *gdbarch, [sp, -#c]! */ && gdbarch_tdep (gdbarch)->have_fpa_registers) { - if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM])) + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) break; regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -12); regno = ARM_F0_REGNUM + ((insn >> 12) & 0x07); - pv_area_store (stack, regs[ARM_SP_REGNUM], 12, regs[regno]); + stack.store (regs[ARM_SP_REGNUM], 12, regs[regno]); } else if ((insn & 0xffbf0fff) == 0xec2d0200 /* sfmfd f0, 4, [sp!] */ @@ -1574,7 +1613,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, int n_saved_fp_regs; unsigned int fp_start_reg, fp_bound_reg; - if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM])) + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) break; if ((insn & 0x800) == 0x800) /* N0 is set */ @@ -1597,8 +1636,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch, for (; fp_start_reg < fp_bound_reg; fp_start_reg++) { regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -12); - pv_area_store (stack, regs[ARM_SP_REGNUM], 12, - regs[fp_start_reg++]); + stack.store (regs[ARM_SP_REGNUM], 12, + regs[fp_start_reg++]); } } else if ((insn & 0xff000000) == 0xeb000000 && cache == NULL) /* bl */ @@ -1678,7 +1717,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, cache->framesize = framesize; for (regno = 0; regno < ARM_FPS_REGNUM; regno++) - if (pv_area_find_reg (stack, gdbarch, regno, &offset)) + if (stack.find_reg (gdbarch, regno, &offset)) cache->saved_regs[regno].addr = offset; } @@ -1686,7 +1725,6 @@ arm_analyze_prologue (struct gdbarch *gdbarch, fprintf_unfiltered (gdb_stdlog, "Prologue scan stopped at %s\n", paddress (gdbarch, unrecognized_pc)); - do_cleanups (back_to); return unrecognized_pc; } @@ -1761,10 +1799,11 @@ arm_scan_prologue (struct frame_info *this_frame, the callee (or at the present moment if this is the innermost frame). The value stored there should be the address of the stmfd + 8. */ CORE_ADDR frame_loc; - LONGEST return_value; + ULONGEST return_value; frame_loc = get_frame_register_unsigned (this_frame, ARM_FP_REGNUM); - if (!safe_read_memory_integer (frame_loc, 4, byte_order, &return_value)) + if (!safe_read_memory_unsigned_integer (frame_loc, 4, byte_order, + &return_value)) return; else { @@ -2001,50 +2040,40 @@ arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma) static void arm_exidx_new_objfile (struct objfile *objfile) { - struct cleanup *cleanups; struct arm_exidx_data *data; asection *exidx, *extab; bfd_vma exidx_vma = 0, extab_vma = 0; - bfd_size_type exidx_size = 0, extab_size = 0; - gdb_byte *exidx_data = NULL, *extab_data = NULL; LONGEST i; /* If we've already touched this file, do nothing. */ if (!objfile || objfile_data (objfile, arm_exidx_data_key) != NULL) return; - cleanups = make_cleanup (null_cleanup, NULL); /* Read contents of exception table and index. */ exidx = bfd_get_section_by_name (objfile->obfd, ELF_STRING_ARM_unwind); + gdb::byte_vector exidx_data; if (exidx) { exidx_vma = bfd_section_vma (objfile->obfd, exidx); - exidx_size = bfd_get_section_size (exidx); - exidx_data = (gdb_byte *) xmalloc (exidx_size); - make_cleanup (xfree, exidx_data); + exidx_data.resize (bfd_get_section_size (exidx)); if (!bfd_get_section_contents (objfile->obfd, exidx, - exidx_data, 0, exidx_size)) - { - do_cleanups (cleanups); - return; - } + exidx_data.data (), 0, + exidx_data.size ())) + return; } extab = bfd_get_section_by_name (objfile->obfd, ".ARM.extab"); + gdb::byte_vector extab_data; if (extab) { extab_vma = bfd_section_vma (objfile->obfd, extab); - extab_size = bfd_get_section_size (extab); - extab_data = (gdb_byte *) xmalloc (extab_size); - make_cleanup (xfree, extab_data); + extab_data.resize (bfd_get_section_size (extab)); if (!bfd_get_section_contents (objfile->obfd, extab, - extab_data, 0, extab_size)) - { - do_cleanups (cleanups); - return; - } + extab_data.data (), 0, + extab_data.size ())) + return; } /* Allocate exception table data structure. */ @@ -2055,11 +2084,12 @@ arm_exidx_new_objfile (struct objfile *objfile) VEC(arm_exidx_entry_s) *); /* Fill in exception table. */ - for (i = 0; i < exidx_size / 8; i++) + for (i = 0; i < exidx_data.size () / 8; i++) { struct arm_exidx_entry new_exidx_entry; - bfd_vma idx = bfd_h_get_32 (objfile->obfd, exidx_data + i * 8); - bfd_vma val = bfd_h_get_32 (objfile->obfd, exidx_data + i * 8 + 4); + bfd_vma idx = bfd_h_get_32 (objfile->obfd, exidx_data.data () + i * 8); + bfd_vma val = bfd_h_get_32 (objfile->obfd, + exidx_data.data () + i * 8 + 4); bfd_vma addr = 0, word = 0; int n_bytes = 0, n_words = 0; struct obj_section *sec; @@ -2093,10 +2123,10 @@ arm_exidx_new_objfile (struct objfile *objfile) addr = ((val & 0x7fffffff) ^ 0x40000000) - 0x40000000; addr += exidx_vma + i * 8 + 4; - if (addr >= extab_vma && addr + 4 <= extab_vma + extab_size) + if (addr >= extab_vma && addr + 4 <= extab_vma + extab_data.size ()) { word = bfd_h_get_32 (objfile->obfd, - extab_data + addr - extab_vma); + extab_data.data () + addr - extab_vma); addr += 4; if ((word & 0xff000000) == 0x80000000) @@ -2151,10 +2181,11 @@ arm_exidx_new_objfile (struct objfile *objfile) byte, followed by the same unwind instructions as the pre-defined forms. */ if (gnu_personality - && addr + 4 <= extab_vma + extab_size) + && addr + 4 <= extab_vma + extab_data.size ()) { word = bfd_h_get_32 (objfile->obfd, - extab_data + addr - extab_vma); + (extab_data.data () + + addr - extab_vma)); addr += 4; n_bytes = 3; n_words = ((word >> 24) & 0xff); @@ -2165,7 +2196,8 @@ arm_exidx_new_objfile (struct objfile *objfile) /* Sanity check address. */ if (n_words) - if (addr < extab_vma || addr + 4 * n_words > extab_vma + extab_size) + if (addr < extab_vma + || addr + 4 * n_words > extab_vma + extab_data.size ()) n_words = n_bytes = 0; /* The unwind instructions reside in WORD (only the N_BYTES least @@ -2183,7 +2215,7 @@ arm_exidx_new_objfile (struct objfile *objfile) while (n_words--) { word = bfd_h_get_32 (objfile->obfd, - extab_data + addr - extab_vma); + extab_data.data () + addr - extab_vma); addr += 4; *p++ = (gdb_byte) ((word >> 24) & 0xff); @@ -2204,8 +2236,6 @@ arm_exidx_new_objfile (struct objfile *objfile) data->section_maps[sec->the_bfd_section->index], &new_exidx_entry); } - - do_cleanups (cleanups); } /* Search for the exception table entry covering MEMADDR. If one is found, @@ -2613,19 +2643,19 @@ arm_exidx_unwind_sniffer (const struct frame_unwind *self, ensure this, so that e.g. pthread cancellation works. */ if (arm_frame_is_thumb (this_frame)) { - LONGEST insn; + ULONGEST insn; - if (safe_read_memory_integer (get_frame_pc (this_frame) - 2, 2, - byte_order_for_code, &insn) + if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 2, + 2, byte_order_for_code, &insn) && (insn & 0xff00) == 0xdf00 /* svc */) exc_valid = 1; } else { - LONGEST insn; + ULONGEST insn; - if (safe_read_memory_integer (get_frame_pc (this_frame) - 4, 4, - byte_order_for_code, &insn) + if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 4, + 4, byte_order_for_code, &insn) && (insn & 0x0f000000) == 0x0f000000 /* svc */) exc_valid = 1; } @@ -2669,6 +2699,108 @@ struct frame_unwind arm_exidx_unwind = { arm_exidx_unwind_sniffer }; +static struct arm_prologue_cache * +arm_make_epilogue_frame_cache (struct frame_info *this_frame) +{ + struct arm_prologue_cache *cache; + int reg; + + cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache); + cache->saved_regs = trad_frame_alloc_saved_regs (this_frame); + + /* Still rely on the offset calculated from prologue. */ + arm_scan_prologue (this_frame, cache); + + /* Since we are in epilogue, the SP has been restored. */ + cache->prev_sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM); + + /* Calculate actual addresses of saved registers using offsets + determined by arm_scan_prologue. */ + for (reg = 0; reg < gdbarch_num_regs (get_frame_arch (this_frame)); reg++) + if (trad_frame_addr_p (cache->saved_regs, reg)) + cache->saved_regs[reg].addr += cache->prev_sp; + + return cache; +} + +/* Implementation of function hook 'this_id' in + 'struct frame_uwnind' for epilogue unwinder. */ + +static void +arm_epilogue_frame_this_id (struct frame_info *this_frame, + void **this_cache, + struct frame_id *this_id) +{ + struct arm_prologue_cache *cache; + CORE_ADDR pc, func; + + if (*this_cache == NULL) + *this_cache = arm_make_epilogue_frame_cache (this_frame); + cache = (struct arm_prologue_cache *) *this_cache; + + /* Use function start address as part of the frame ID. If we cannot + identify the start address (due to missing symbol information), + fall back to just using the current PC. */ + pc = get_frame_pc (this_frame); + func = get_frame_func (this_frame); + if (func == 0) + func = pc; + + (*this_id) = frame_id_build (cache->prev_sp, pc); +} + +/* Implementation of function hook 'prev_register' in + 'struct frame_uwnind' for epilogue unwinder. */ + +static struct value * +arm_epilogue_frame_prev_register (struct frame_info *this_frame, + void **this_cache, int regnum) +{ + if (*this_cache == NULL) + *this_cache = arm_make_epilogue_frame_cache (this_frame); + + return arm_prologue_prev_register (this_frame, this_cache, regnum); +} + +static int arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, + CORE_ADDR pc); +static int thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, + CORE_ADDR pc); + +/* Implementation of function hook 'sniffer' in + 'struct frame_uwnind' for epilogue unwinder. */ + +static int +arm_epilogue_frame_sniffer (const struct frame_unwind *self, + struct frame_info *this_frame, + void **this_prologue_cache) +{ + if (frame_relative_level (this_frame) == 0) + { + struct gdbarch *gdbarch = get_frame_arch (this_frame); + CORE_ADDR pc = get_frame_pc (this_frame); + + if (arm_frame_is_thumb (this_frame)) + return thumb_stack_frame_destroyed_p (gdbarch, pc); + else + return arm_stack_frame_destroyed_p_1 (gdbarch, pc); + } + else + return 0; +} + +/* Frame unwinder from epilogue. */ + +static const struct frame_unwind arm_epilogue_frame_unwind = +{ + NORMAL_FRAME, + default_frame_unwind_stop_reason, + arm_epilogue_frame_this_id, + arm_epilogue_frame_prev_register, + NULL, + arm_epilogue_frame_sniffer, +}; + /* Recognize GCC's trampoline for thumb call-indirect. If we are in a trampoline, return the target PC. Otherwise return 0. @@ -2888,14 +3020,8 @@ arm_m_exception_unwind_sniffer (const struct frame_unwind *self, /* No need to check is_m; this sniffer is only registered for M-profile architectures. */ - /* Exception frames return to one of these magic PCs. Other values - are not defined as of v7-M. See details in "B1.5.8 Exception - return behavior" in "ARMv7-M Architecture Reference Manual". */ - if (this_pc == 0xfffffff1 || this_pc == 0xfffffff9 - || this_pc == 0xfffffffd) - return 1; - - return 0; + /* Check if exception frame returns to a magic PC value. */ + return arm_m_addr_is_magic (this_pc); } /* Frame unwinder for M-profile exceptions. */ @@ -3124,19 +3250,14 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) return found_stack_adjust; } -/* Implement the stack_frame_destroyed_p gdbarch method. */ - static int -arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) +arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); unsigned int insn; int found_return; CORE_ADDR func_start, func_end; - if (arm_pc_is_thumb (gdbarch, pc)) - return thumb_stack_frame_destroyed_p (gdbarch, pc); - if (!find_pc_partial_function (pc, NULL, &func_start, &func_end)) return 0; @@ -3178,6 +3299,16 @@ arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) return 0; } +/* Implement the stack_frame_destroyed_p gdbarch method. */ + +static int +arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + if (arm_pc_is_thumb (gdbarch, pc)) + return thumb_stack_frame_destroyed_p (gdbarch, pc); + else + return arm_stack_frame_destroyed_p_1 (gdbarch, pc); +} /* When arguments must be pushed onto the stack, they go on in reverse order. The code below implements a FILO (stack) to do this. */ @@ -3236,6 +3367,7 @@ arm_type_align (struct type *t) case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_REF: + case TYPE_CODE_RVALUE_REF: case TYPE_CODE_CHAR: case TYPE_CODE_BOOL: return TYPE_LENGTH (t); @@ -3447,8 +3579,11 @@ arm_vfp_cprc_sub_candidate (struct type *t, int i; for (i = 0; i < TYPE_NFIELDS (t); i++) { - int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), - base_type); + int sub_count = 0; + + if (!field_is_static (&TYPE_FIELD (t, i))) + sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), + base_type); if (sub_count == -1) return -1; count += sub_count; @@ -3669,8 +3804,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, reg_char, reg_scaled + i); regnum = user_reg_map_name_to_regnum (gdbarch, name_buf, strlen (name_buf)); - regcache_cooked_write (regcache, regnum, - val + i * unit_length); + regcache->cooked_write (regnum, val + i * unit_length); } } continue; @@ -4052,59 +4186,6 @@ arm_register_sim_regno (struct gdbarch *gdbarch, int regnum) internal_error (__FILE__, __LINE__, _("Bad REGNUM %d"), regnum); } -/* NOTE: cagney/2001-08-20: Both convert_from_extended() and - convert_to_extended() use floatformat_arm_ext_littlebyte_bigword. - It is thought that this is is the floating-point register format on - little-endian systems. */ - -static void -convert_from_extended (const struct floatformat *fmt, const void *ptr, - void *dbl, int endianess) -{ - DOUBLEST d; - - if (endianess == BFD_ENDIAN_BIG) - floatformat_to_doublest (&floatformat_arm_ext_big, ptr, &d); - else - floatformat_to_doublest (&floatformat_arm_ext_littlebyte_bigword, - ptr, &d); - floatformat_from_doublest (fmt, &d, dbl); -} - -static void -convert_to_extended (const struct floatformat *fmt, void *dbl, const void *ptr, - int endianess) -{ - DOUBLEST d; - - floatformat_to_doublest (fmt, ptr, &d); - if (endianess == BFD_ENDIAN_BIG) - floatformat_from_doublest (&floatformat_arm_ext_big, &d, dbl); - else - floatformat_from_doublest (&floatformat_arm_ext_littlebyte_bigword, - &d, dbl); -} - -/* Like insert_single_step_breakpoint, but make sure we use a breakpoint - of the appropriate mode (as encoded in the PC value), even if this - differs from what would be expected according to the symbol tables. */ - -void -arm_insert_single_step_breakpoint (struct gdbarch *gdbarch, - struct address_space *aspace, - CORE_ADDR pc) -{ - struct cleanup *old_chain - = make_cleanup_restore_integer (&arm_override_mode); - - arm_override_mode = IS_THUMB_ADDR (pc); - pc = gdbarch_addr_bits_remove (gdbarch, pc); - - insert_single_step_breakpoint (gdbarch, aspace, pc); - - do_cleanups (old_chain); -} - /* Given BUF, which is OLD_LEN bytes ending at ENDADDR, expand the buffer to be NEW_LEN bytes ending at ENDADDR. Return NULL if an error occurs. BUF is freed. */ @@ -4119,7 +4200,7 @@ extend_buffer_earlier (gdb_byte *buf, CORE_ADDR endaddr, new_buf = (gdb_byte *) xmalloc (new_len); memcpy (new_buf + bytes_to_read, buf, old_len); xfree (buf); - if (target_read_memory (endaddr - new_len, new_buf, bytes_to_read) != 0) + if (target_read_code (endaddr - new_len, new_buf, bytes_to_read) != 0) { xfree (new_buf); return NULL; @@ -4177,13 +4258,13 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) footwork to distinguish a real IT instruction from the second half of a 32-bit instruction, but there is no need for that if there's no candidate. */ - buf_len = min (bpaddr - boundary, MAX_IT_BLOCK_PREFIX); + buf_len = std::min (bpaddr - boundary, (CORE_ADDR) MAX_IT_BLOCK_PREFIX); if (buf_len == 0) /* No room for an IT instruction. */ return bpaddr; buf = (gdb_byte *) xmalloc (buf_len); - if (target_read_memory (bpaddr - buf_len, buf, buf_len) != 0) + if (target_read_code (bpaddr - buf_len, buf, buf_len) != 0) return bpaddr; any = 0; for (i = 0; i < buf_len; i += 2) @@ -4323,7 +4404,7 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) location. */ ULONGEST -displaced_read_reg (struct regcache *regs, struct displaced_step_closure *dsc, +displaced_read_reg (struct regcache *regs, arm_displaced_step_closure *dsc, int regno) { ULONGEST ret; @@ -4361,7 +4442,7 @@ static int displaced_in_arm_mode (struct regcache *regs) { ULONGEST ps; - ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regs)); + ULONGEST t_bit = arm_psr_thumb_bit (regs->arch ()); regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &ps); @@ -4371,7 +4452,7 @@ displaced_in_arm_mode (struct regcache *regs) /* Write to the PC as from a branch instruction. */ static void -branch_write_pc (struct regcache *regs, struct displaced_step_closure *dsc, +branch_write_pc (struct regcache *regs, arm_displaced_step_closure *dsc, ULONGEST val) { if (!dsc->is_thumb) @@ -4390,7 +4471,7 @@ static void bx_write_pc (struct regcache *regs, ULONGEST val) { ULONGEST ps; - ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regs)); + ULONGEST t_bit = arm_psr_thumb_bit (regs->arch ()); regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &ps); @@ -4417,7 +4498,7 @@ bx_write_pc (struct regcache *regs, ULONGEST val) /* Write to the PC as if from a load instruction. */ static void -load_write_pc (struct regcache *regs, struct displaced_step_closure *dsc, +load_write_pc (struct regcache *regs, arm_displaced_step_closure *dsc, ULONGEST val) { if (DISPLACED_STEPPING_ARCH_VERSION >= 5) @@ -4429,7 +4510,7 @@ load_write_pc (struct regcache *regs, struct displaced_step_closure *dsc, /* Write to the PC as if from an ALU instruction. */ static void -alu_write_pc (struct regcache *regs, struct displaced_step_closure *dsc, +alu_write_pc (struct regcache *regs, arm_displaced_step_closure *dsc, ULONGEST val) { if (DISPLACED_STEPPING_ARCH_VERSION >= 7 && !dsc->is_thumb) @@ -4443,7 +4524,7 @@ alu_write_pc (struct regcache *regs, struct displaced_step_closure *dsc, this is controlled by the WRITE_PC argument. */ void -displaced_write_reg (struct regcache *regs, struct displaced_step_closure *dsc, +displaced_write_reg (struct regcache *regs, arm_displaced_step_closure *dsc, int regno, ULONGEST val, enum pc_write_style write_pc) { if (regno == ARM_PC_REGNUM) @@ -4527,7 +4608,7 @@ insn_references_pc (uint32_t insn, uint32_t bitmask) static int arm_copy_unmodified (struct gdbarch *gdbarch, uint32_t insn, - const char *iname, struct displaced_step_closure *dsc) + const char *iname, arm_displaced_step_closure *dsc) { if (debug_displaced) fprintf_unfiltered (gdb_stdlog, "displaced: copying insn %.8lx, " @@ -4542,7 +4623,7 @@ arm_copy_unmodified (struct gdbarch *gdbarch, uint32_t insn, static int thumb_copy_unmodified_32bit (struct gdbarch *gdbarch, uint16_t insn1, uint16_t insn2, const char *iname, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { if (debug_displaced) fprintf_unfiltered (gdb_stdlog, "displaced: copying insn %.4x %.4x, " @@ -4561,7 +4642,7 @@ thumb_copy_unmodified_32bit (struct gdbarch *gdbarch, uint16_t insn1, static int thumb_copy_unmodified_16bit (struct gdbarch *gdbarch, uint16_t insn, const char *iname, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { if (debug_displaced) fprintf_unfiltered (gdb_stdlog, "displaced: copying insn %.4x, " @@ -4577,7 +4658,7 @@ thumb_copy_unmodified_16bit (struct gdbarch *gdbarch, uint16_t insn, static void cleanup_preload (struct gdbarch *gdbarch, - struct regcache *regs, struct displaced_step_closure *dsc) + struct regcache *regs, arm_displaced_step_closure *dsc) { displaced_write_reg (regs, dsc, 0, dsc->tmp[0], CANNOT_WRITE_PC); if (!dsc->u.preload.immed) @@ -4586,7 +4667,7 @@ cleanup_preload (struct gdbarch *gdbarch, static void install_preload (struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc, unsigned int rn) + arm_displaced_step_closure *dsc, unsigned int rn) { ULONGEST rn_val; /* Preload instructions: @@ -4605,7 +4686,7 @@ install_preload (struct gdbarch *gdbarch, struct regcache *regs, static int arm_copy_preload (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { unsigned int rn = bits (insn, 16, 19); @@ -4625,7 +4706,7 @@ arm_copy_preload (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs, static int thumb2_copy_preload (struct gdbarch *gdbarch, uint16_t insn1, uint16_t insn2, - struct regcache *regs, struct displaced_step_closure *dsc) + struct regcache *regs, arm_displaced_step_closure *dsc) { unsigned int rn = bits (insn1, 0, 3); unsigned int u_bit = bit (insn1, 7); @@ -4675,7 +4756,7 @@ thumb2_copy_preload (struct gdbarch *gdbarch, uint16_t insn1, uint16_t insn2, static void install_preload_reg(struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc, unsigned int rn, + arm_displaced_step_closure *dsc, unsigned int rn, unsigned int rm) { ULONGEST rn_val, rm_val; @@ -4700,7 +4781,7 @@ install_preload_reg(struct gdbarch *gdbarch, struct regcache *regs, static int arm_copy_preload_reg (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { unsigned int rn = bits (insn, 16, 19); unsigned int rm = bits (insn, 0, 3); @@ -4724,7 +4805,7 @@ arm_copy_preload_reg (struct gdbarch *gdbarch, uint32_t insn, static void cleanup_copro_load_store (struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { ULONGEST rn_val = displaced_read_reg (regs, dsc, 0); @@ -4736,7 +4817,7 @@ cleanup_copro_load_store (struct gdbarch *gdbarch, static void install_copro_load_store (struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc, + arm_displaced_step_closure *dsc, int writeback, unsigned int rn) { ULONGEST rn_val; @@ -4764,7 +4845,7 @@ install_copro_load_store (struct gdbarch *gdbarch, struct regcache *regs, static int arm_copy_copro_load_store (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { unsigned int rn = bits (insn, 16, 19); @@ -4785,7 +4866,7 @@ arm_copy_copro_load_store (struct gdbarch *gdbarch, uint32_t insn, static int thumb2_copy_copro_load_store (struct gdbarch *gdbarch, uint16_t insn1, uint16_t insn2, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { unsigned int rn = bits (insn1, 0, 3); @@ -4813,7 +4894,7 @@ thumb2_copy_copro_load_store (struct gdbarch *gdbarch, uint16_t insn1, static void cleanup_branch (struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc) + arm_displaced_step_closure *dsc) { uint32_t status = displaced_read_reg (regs, dsc, ARM_PS_REGNUM); int branch_taken = condition_true (dsc->u.branch.cond, status); @@ -4844,7 +4925,7 @@ cleanup_branch (struct gdbarch *gdbarch, struct regcache *regs, static void install_b_bl_blx (struct gdbarch *gdbarch, struct regcache *regs, - struct displaced_step_closure *dsc, + arm_displaced_step_closure *dsc, unsigned int cond, int exchange, int link, long offset) { /* Implement "BL