aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.h
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2009-07-30 23:05:05 +0000
committerJulian Brown <julian@codesourcery.com>2009-07-30 23:05:05 +0000
commitcca44b1b87795e0a92ec8d016456941a7986d107 (patch)
tree01563daf73571b24cef602e0c0cb619d6409520a /gdb/arm-tdep.h
parent929dfd4f59cd5f4f3a135325c48d4ad9828aaf0f (diff)
downloadgdb-cca44b1b87795e0a92ec8d016456941a7986d107.zip
gdb-cca44b1b87795e0a92ec8d016456941a7986d107.tar.gz
gdb-cca44b1b87795e0a92ec8d016456941a7986d107.tar.bz2
* arm-linux-tdep.c (arch-utils.h, inferior.h, gdbthread.h, symfile.h):
Include files. (arm_linux_cleanup_svc, arm_linux_copy_svc): New. (cleanup_kernel_helper_return, arm_catch_kernel_helper_return): New. (arm_linux_displaced_step_copy_insn): New. (arm_linux_init_abi): Initialise displaced stepping callbacks. * arm-tdep.c (DISPLACED_STEPPING_ARCH_VERSION): New macro. (ARM_NOP): New. (displaced_read_reg, displaced_in_arm_mode, branch_write_pc) (bx_write_pc, load_write_pc, alu_write_pc, displaced_write_reg) (insn_references_pc, copy_unmodified, cleanup_preload, copy_preload) (copy_preload_reg, cleanup_copro_load_store, copy_copro_load_store) (cleanup_branch, copy_b_bl_blx, copy_bx_blx_reg, cleanup_alu_imm) (copy_alu_imm, cleanup_alu_reg, copy_alu_reg) (cleanup_alu_shifted_reg, copy_alu_shifted_reg, cleanup_load) (cleanup_store, copy_extra_ld_st, copy_ldr_str_ldrb_strb) (cleanup_block_load_all, cleanup_block_store_pc) (cleanup_block_load_pc, copy_block_xfer, cleanup_svc, copy_svc) (copy_undef, copy_unpred): New. (decode_misc_memhint_neon, decode_unconditional) (decode_miscellaneous, decode_dp_misc, decode_ld_st_word_ubyte) (decode_media, decode_b_bl_ldmstm, decode_ext_reg_ld_st) (decode_svc_copro, arm_process_displaced_insn) (arm_displaced_init_closure, arm_displaced_step_copy_insn) (arm_displaced_step_fixup): New. (arm_gdbarch_init): Initialise max insn length field. * arm-tdep.h (DISPLACED_TEMPS, DISPLACED_MODIFIED_INSNS): New macros. (displaced_step_closure, pc_write_style): New. (arm_displaced_init_closure, displaced_read_reg) (arm_process_displaced_insn, arm_displaced_init_closure) (displaced_read_reg, displaced_write_reg, arm_displaced_step_copy_insn) (arm_displaced_step_fixup): Add prototypes.
Diffstat (limited to 'gdb/arm-tdep.h')
-rw-r--r--gdb/arm-tdep.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index 968c4f2..2fa86df 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -186,11 +186,113 @@ struct gdbarch_tdep
struct type *neon_quad_type;
};
+/* Structures used for displaced stepping. */
+
+/* The maximum number of temporaries available for displaced instructions. */
+#define DISPLACED_TEMPS 16
+/* The maximum number of modified instructions generated for one single-stepped
+ instruction, including the breakpoint (usually at the end of the instruction
+ sequence) and any scratch words, etc. */
+#define DISPLACED_MODIFIED_INSNS 8
+
+struct displaced_step_closure
+{
+ ULONGEST tmp[DISPLACED_TEMPS];
+ int rd;
+ int wrote_to_pc;
+ union
+ {
+ struct
+ {
+ int xfersize;
+ int rn; /* Writeback register. */
+ unsigned int immed : 1; /* Offset is immediate. */
+ unsigned int writeback : 1; /* Perform base-register writeback. */
+ unsigned int restore_r4 : 1; /* Used r4 as scratch. */
+ } ldst;
+
+ struct
+ {
+ unsigned long dest;
+ unsigned int link : 1;
+ unsigned int exchange : 1;
+ unsigned int cond : 4;
+ } branch;
+
+ struct
+ {
+ unsigned int regmask;
+ int rn;
+ CORE_ADDR xfer_addr;
+ unsigned int load : 1;
+ unsigned int user : 1;
+ unsigned int increment : 1;
+ unsigned int before : 1;
+ unsigned int writeback : 1;
+ unsigned int cond : 4;
+ } block;
+
+ struct
+ {
+ unsigned int immed : 1;
+ } preload;
+
+ struct
+ {
+ /* If non-NULL, override generic SVC handling (e.g. for a particular
+ OS). */
+ int (*copy_svc_os) (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
+ struct regcache *regs,
+ struct displaced_step_closure *dsc);
+ } svc;
+ } u;
+ unsigned long modinsn[DISPLACED_MODIFIED_INSNS];
+ int numinsns;
+ CORE_ADDR insn_addr;
+ CORE_ADDR scratch_base;
+ void (*cleanup) (struct gdbarch *, struct regcache *,
+ struct displaced_step_closure *);
+};
+
+/* Values for the WRITE_PC argument to displaced_write_reg. If the register
+ write may write to the PC, specifies the way the CPSR T bit, etc. is
+ modified by the instruction. */
+
+enum pc_write_style
+{
+ BRANCH_WRITE_PC,
+ BX_WRITE_PC,
+ LOAD_WRITE_PC,
+ ALU_WRITE_PC,
+ CANNOT_WRITE_PC
+};
+
+extern void
+ arm_process_displaced_insn (struct gdbarch *gdbarch, uint32_t insn,
+ CORE_ADDR from, CORE_ADDR to,
+ struct regcache *regs,
+ struct displaced_step_closure *dsc);
+extern void
+ arm_displaced_init_closure (struct gdbarch *gdbarch, CORE_ADDR from,
+ CORE_ADDR to, struct displaced_step_closure *dsc);
+extern ULONGEST
+ displaced_read_reg (struct regcache *regs, CORE_ADDR from, int regno);
+extern void
+ displaced_write_reg (struct regcache *regs,
+ struct displaced_step_closure *dsc, int regno,
+ ULONGEST val, enum pc_write_style write_pc);
CORE_ADDR arm_skip_stub (struct frame_info *, CORE_ADDR);
CORE_ADDR arm_get_next_pc (struct frame_info *, CORE_ADDR);
int arm_software_single_step (struct frame_info *);
+extern struct displaced_step_closure *
+ arm_displaced_step_copy_insn (struct gdbarch *, CORE_ADDR, CORE_ADDR,
+ struct regcache *);
+extern void arm_displaced_step_fixup (struct gdbarch *,
+ struct displaced_step_closure *,
+ CORE_ADDR, CORE_ADDR, struct regcache *);
+
/* Functions exported from armbsd-tdep.h. */
/* Return the appropriate register set for the core section identified