26 #include "arch/aarch64-insn.h" 28 #include "elf/common.h" 35 #include <asm/ptrace.h> 41 #include "arch/aarch64.h" 80 return regno >= AARCH64_NUM_REGS;
88 return regno >= AARCH64_NUM_REGS;
94 struct user_pt_regs *regset = (
struct user_pt_regs *) buf;
97 for (i = 0; i < AARCH64_X_REGS_NUM; i++)
107 const struct user_pt_regs *regset = (
const struct user_pt_regs *) buf;
110 for (i = 0; i < AARCH64_X_REGS_NUM; i++)
120 struct user_fpsimd_state *regset = (
struct user_fpsimd_state *) buf;
123 for (i = 0; i < AARCH64_V_REGS_NUM; i++)
132 const struct user_fpsimd_state *regset
133 = (
const struct user_fpsimd_state *) buf;
136 for (i = 0; i < AARCH64_V_REGS_NUM; i++)
168 #define aarch64_breakpoint_len 4 259 fprintf (stderr,
"insert_point on entry (addr=0x%08lx, len=%d)\n",
260 (
unsigned long) addr, len);
308 fprintf (stderr,
"remove_point on entry (addr=0x%08lx, len=%d)\n",
309 (
unsigned long) addr, len);
355 if (siginfo.si_signo != SIGTRAP
356 || (siginfo.si_code & 0xffff) != 0x0004 )
368 && addr_trap >= addr_watch
369 && addr_trap < addr_watch + len)
391 lwpid_t lwpid,
int idx,
void **base)
472 unsigned int machine;
491 sizeof (
struct user_pt_regs), GENERAL_REGS,
494 sizeof (
struct user_fpsimd_state), FP_REGS,
547 iovec.iov_base = ®
548 iovec.iov_len =
sizeof (reg);
570 *sysno = (int) l_sysno;
683 static struct aarch64_memory_operand
686 return (
struct aarch64_memory_operand) { MEMORY_OPERAND_OFFSET,
offset };
694 static struct aarch64_memory_operand
697 return (
struct aarch64_memory_operand) { MEMORY_OPERAND_PREINDEX, index };
705 static struct aarch64_memory_operand
708 return (
struct aarch64_memory_operand) { MEMORY_OPERAND_POSTINDEX, index };
723 NZCV = (0x1 << 14) | (0
x3 << 11) | (0x4 << 7) | (0
x2 << 3) | 0x0,
724 FPSR = (0x1 << 14) | (0
x3 << 11) | (0x4 << 7) | (0
x4 << 3) | 0x1,
725 FPCR = (0x1 << 14) | (0
x3 << 11) | (0x4 << 7) | (0
x4 << 3) | 0x0,
738 return aarch64_emit_insn (buf, BLR | ENCODE (rn.num, 5, 5));
750 return aarch64_emit_insn (buf, RET | ENCODE (rn.num, 5, 5));
758 struct aarch64_memory_operand operand)
765 opc = ENCODE (2, 2, 30);
767 opc = ENCODE (0, 2, 30);
769 switch (operand.type)
771 case MEMORY_OPERAND_OFFSET:
773 pre_index = ENCODE (1, 1, 24);
774 write_back = ENCODE (0, 1, 23);
777 case MEMORY_OPERAND_POSTINDEX:
779 pre_index = ENCODE (0, 1, 24);
780 write_back = ENCODE (1, 1, 23);
783 case MEMORY_OPERAND_PREINDEX:
785 pre_index = ENCODE (1, 1, 24);
786 write_back = ENCODE (1, 1, 23);
793 return aarch64_emit_insn (buf, opcode | opc | pre_index | write_back
794 | ENCODE (operand.index >> 3, 7, 15)
795 | ENCODE (rt2.num, 5, 10)
796 | ENCODE (rn.num, 5, 5) | ENCODE (rt.num, 5, 0));
813 struct aarch64_memory_operand operand)
832 struct aarch64_memory_operand operand)
850 uint32_t opc = ENCODE (2, 2, 30);
851 uint32_t pre_index = ENCODE (1, 1, 24);
853 return aarch64_emit_insn (buf, LDP_SIMD_VFP | opc | pre_index
854 | ENCODE (
offset >> 4, 7, 15)
855 | ENCODE (rt2, 5, 10)
856 | ENCODE (rn.num, 5, 5) | ENCODE (rt, 5, 0));
872 uint32_t opc = ENCODE (2, 2, 30);
873 uint32_t pre_index = ENCODE (1, 1, 24);
875 return aarch64_emit_insn (buf, STP_SIMD_VFP | opc | pre_index
876 | ENCODE (
offset >> 4, 7, 15)
877 | ENCODE (rt2, 5, 10)
878 | ENCODE (rn.num, 5, 5) | ENCODE (rt, 5, 0));
895 struct aarch64_memory_operand operand)
897 return aarch64_emit_load_store (buf, 1, LDR, rt, rn, operand);
914 struct aarch64_memory_operand operand)
916 return aarch64_emit_load_store (buf, 0, LDR, rt, rn, operand);
935 struct aarch64_memory_operand operand)
937 return aarch64_emit_load_store (buf, rt.is64 ? 3 : 2, STR, rt, rn, operand);
944 enum aarch64_opcodes opcode,
950 return aarch64_emit_insn (buf, opcode | ENCODE (size, 2, 30)
951 | ENCODE (rs.num, 5, 16) | ENCODE (rt2.num, 5, 10)
952 | ENCODE (rn.num, 5, 5) | ENCODE (rt.num, 5, 0));
1009 uint32_t size = ENCODE (rd.is64, 1, 31);
1011 return aarch64_emit_insn (buf, opcode | size | ENCODE (rm.num, 5, 16)
1012 | ENCODE (rn.num, 5, 5) | ENCODE (rd.num, 5, 0));
1024 uint32_t size = ENCODE (rd.is64, 1, 31);
1026 uint32_t operand_opcode;
1031 operand_opcode = ENCODE (8, 4, 25);
1033 return aarch64_emit_insn (buf, opcode | operand_opcode | size
1034 | ENCODE (operand.
imm, 12, 10)
1035 | ENCODE (rn.num, 5, 5)
1036 | ENCODE (rd.num, 5, 0));
1041 operand_opcode = ENCODE (5, 4, 25);
1105 uint32_t size = ENCODE (rd.is64, 1, 31);
1107 uint32_t shift = ENCODE (0, 2, 21);
1109 return aarch64_emit_insn (buf, MOV | size | shift
1110 | ENCODE (operand.
imm, 16, 5)
1111 | ENCODE (rd.num, 5, 0));
1129 uint32_t size = ENCODE (rd.is64, 1, 31);
1131 return aarch64_emit_insn (buf, MOVK | size | ENCODE (shift, 2, 21) |
1132 ENCODE (imm, 16, 5) | ENCODE (rd.num, 5, 0));
1154 if ((addr >> 16) != 0)
1155 p +=
emit_movk (p, rd, (addr >> 16) & 0xffff, 1);
1159 if ((addr >> 32) != 0)
1160 p +=
emit_movk (p, rd, (addr >> 32) & 0xffff, 2);
1164 if ((addr >> 48) != 0)
1165 p +=
emit_movk (p, rd, (addr >> 48) & 0xffff, 3);
1340 return aarch64_emit_insn (buf, MRS | ENCODE (system_reg, 15, 5)
1341 | ENCODE (rt.num, 5, 0));
1355 return aarch64_emit_insn (buf, MSR | ENCODE (system_reg, 15, 5)
1356 | ENCODE (rt.num, 5, 0));
1366 return aarch64_emit_insn (buf, SEVL);
1376 return aarch64_emit_insn (buf, WFE);
1395 uint32_t size = ENCODE (rd.is64, 1, 31);
1396 uint32_t n = ENCODE (rd.is64, 1, 22);
1398 return aarch64_emit_insn (buf, SBFM | size | n | ENCODE (immr, 6, 16)
1399 | ENCODE (imms, 6, 10) | ENCODE (rn.num, 5, 5)
1400 | ENCODE (rd.num, 5, 0));
1421 return emit_sbfm (buf, rd, rn, lsb, lsb + width - 1);
1440 uint32_t size = ENCODE (rd.is64, 1, 31);
1441 uint32_t n = ENCODE (rd.is64, 1, 22);
1443 return aarch64_emit_insn (buf, UBFM | size | n | ENCODE (immr, 6, 16)
1444 | ENCODE (imms, 6, 10) | ENCODE (rn.num, 5, 5)
1445 | ENCODE (rd.num, 5, 0));
1466 return emit_ubfm (buf, rd, rn, lsb, lsb + width - 1);
1485 uint32_t size = ENCODE (rd.is64, 1, 31);
1487 return aarch64_emit_insn (buf, CSINC | size | ENCODE (rm.num, 5, 16)
1488 | ENCODE (cond, 4, 12) | ENCODE (rn.num, 5, 5)
1489 | ENCODE (rd.num, 5, 0));
1522 size_t byte_len = len *
sizeof (uint32_t);
1523 #if (__BYTE_ORDER == __BIG_ENDIAN) 1524 uint32_t *le_buf = (uint32_t *)
xmalloc (byte_len);
1527 for (i = 0; i < len; i++)
1528 le_buf[i] = htole32 (buf[i]);
1547 struct aarch64_insn_data base;
1559 struct aarch64_insn_data *data)
1566 if (can_encode_int32 (new_offset, 28))
1574 struct aarch64_insn_data *data)
1581 if (can_encode_int32 (new_offset, 21))
1586 else if (can_encode_int32 (new_offset, 28))
1610 const unsigned rn,
int is64,
1611 struct aarch64_insn_data *data)
1618 if (can_encode_int32 (new_offset, 21))
1623 else if (can_encode_int32 (new_offset, 28))
1647 const unsigned rt,
unsigned bit,
1648 struct aarch64_insn_data *data)
1655 if (can_encode_int32 (new_offset, 16))
1660 else if (can_encode_int32 (new_offset, 28))
1686 struct aarch64_insn_data *data)
1710 const unsigned rt,
const int is64,
1711 struct aarch64_insn_data *data)
1747 struct aarch64_insn_data *data)
1757 static const struct aarch64_insn_visitor
visitor =
1780 unsigned char *jjump_pad_insn,
1852 for (i = 30; i >= 0; i -= 2)
1867 for (i = 30; i >= 0; i -= 1)
1988 p += emit_cb (p, 1,
w2, -2 * 4);
1990 p += emit_cb (p, 1,
x2, -4 * 4);
2071 for (i = 0; i <= 30; i += 1)
2085 for (i = 0; i <= 30; i += 2)
2093 *adjusted_insn_addr = buildaddr;
2096 insn_data.
base.insn_addr = tpaddr;
2100 aarch64_relocate_instruction (insn, &
visitor,
2101 (
struct aarch64_insn_data *) &insn_data);
2104 if (insn_data.insn_ptr == buf)
2107 "E.Could not relocate instruction from %s to %s.",
2113 append_insns (&buildaddr, insn_data.insn_ptr - buf, buf);
2114 *adjusted_insn_addr_end = buildaddr;
2120 offset = (tpaddr + orig_size - buildaddr);
2121 if (!can_encode_int32 (
offset, 28))
2124 "E.Jump back from jump pad too far from tracepoint " 2125 "(offset 0x%" PRIx64
" cannot be encoded in 28 bits).",
2130 p += emit_b (p, 0,
offset);
2134 offset = (*jump_entry - tpaddr);
2135 if (!can_encode_int32 (
offset, 28))
2138 "E.Jump pad too far from tracepoint " 2139 "(offset 0x%" PRIx64
" cannot be encoded in 28 bits).",
2144 emit_b ((uint32_t *) jjump_pad_insn, 0,
offset);
2145 *jjump_pad_insn_size = 4;
2148 *jump_entry = buildaddr;
2513 p += emit_bcond (p,
EQ, 8);
2517 *offset_p = (p - buf) * 4;
2550 emit_b (&insn, 0, to - from);
2723 p += emit_bcond (p,
NE, 8);
2726 *offset_p = (p - buf) * 4;
2745 p += emit_bcond (p,
EQ, 8);
2748 *offset_p = (p - buf) * 4;
2767 p += emit_bcond (p,
GE, 8);
2770 *offset_p = (p - buf) * 4;
2789 p += emit_bcond (p,
GT, 8);
2792 *offset_p = (p - buf) * 4;
2811 p += emit_bcond (p,
LE, 8);
2814 *offset_p = (p - buf) * 4;
2833 p += emit_bcond (p,
LT, 8);
2836 *offset_p = (p - buf) * 4;
const struct target_desc * tdesc
static void aarch64_emit_mul(void)
enum target_hw_bp_type raw_bkpt_type_to_target_hw_bp_type(enum raw_bkpt_type raw_type)
int arm_breakpoint_at(CORE_ADDR where)
const struct target_desc * tdesc_arm_with_neon
void aarch64_linux_new_thread(struct lwp_info *lwp)
CORE_ADDR linux_get_pc_64bit(struct regcache *regcache)
void initialize_low_arch(void)
struct thread_info * current_thread
void collect_register(struct regcache *regcache, int n, void *buf)
static void aarch64_emit_bit_or(void)
static void aarch64_emit_swap(void)
static void aarch64_store_gregset(struct regcache *regcache, const void *buf)
static void xfree(T *ptr)
static void aarch64_fill_gregset(struct regcache *regcache, void *buf)
#define AARCH64_HWP_MAX_NUM
aarch64_system_control_registers
static void aarch64_ftrace_insn_reloc_b(const int is_bl, const int32_t offset, struct aarch64_insn_data *data)
static void aarch64_emit_bit_xor(void)
static void aarch64_emit_less_signed(void)
#define AARCH64_HBP_MAX_NUM
int aarch64_handle_breakpoint(enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state)
static void aarch64_emit_equal(void)
static void aarch64_emit_le_goto(int *offset_p, int *size_p)
static const struct aarch64_register fp
static int aarch64_cannot_fetch_register(int regno)
static const struct aarch64_register sp
static CORE_ADDR aarch64_stopped_data_address(void)
struct aarch64_debug_reg_state debug_reg_state
static int emit_subs(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_operand operand)
static void aarch64_emit_sub(void)
static long lwpid_of(const thread_info *thread)
int aarch64_handle_watchpoint(enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state)
static void aarch64_emit_gt_goto(int *offset_p, int *size_p)
unsigned int dr_ref_count_wp[AARCH64_HWP_MAX_NUM]
static int emit_data_processing(uint32_t *buf, enum aarch64_opcodes opcode, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_operand operand)
void initialize_low_arch_aarch32(void)
enum aarch64_operand_type type
static void aarch64_emit_bit_and(void)
static void aarch64_ftrace_insn_reloc_ldr_literal(const int32_t offset, const int is_sw, const unsigned rt, const int is64, struct aarch64_insn_data *data)
static struct regs_info regs_info_aarch64
static void aarch64_emit_bit_not(void)
static int aarch64_install_fast_tracepoint_jump_pad(CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector, CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry, CORE_ADDR *trampoline, ULONGEST *trampoline_size, unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size, CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end, char *err)
static int emit_ldaxr(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rn)
static int aarch64_supports_tracepoints(void)
char * paddress(CORE_ADDR addr)
void aarch64_linux_delete_thread(struct arch_lwp_info *arch_lwp)
static const struct aarch64_register w0
static int emit_asrv(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
static void aarch64_emit_goto(int *offset_p, int *size_p)
static void aarch64_ftrace_insn_reloc_others(const uint32_t insn, struct aarch64_insn_data *data)
static int is_64bit_tdesc(void)
static int aarch64_supports_z_point_type(char z_type)
static void aarch64_emit_ref(int size)
static void aarch64_emit_prologue(void)
struct regs_info regs_info_aarch32
static int aarch64_get_thread_area(int lwpid, CORE_ADDR *addrp)
static struct regset_info aarch64_regsets[]
void linux_set_pc_64bit(struct regcache *regcache, CORE_ADDR pc)
static void aarch64_emit_rsh_unsigned(void)
static int emit_data_processing_reg(uint32_t *buf, uint32_t opcode, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
struct linux_target_ops the_low_target
static void aarch64_arch_setup(void)
static struct arch_process_info * aarch64_linux_new_process(void)
static int pid_of(const thread_info *thread)
static int aarch64_breakpoint_at(CORE_ADDR where)
struct target_ops * the_target
static int emit_add(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_operand operand)
const struct target_desc * tdesc
static void emit_ops_insns(const uint32_t *start, int len)
const gdb_byte * arm_sw_breakpoint_from_kind(int kind, int *size)
static int emit_ubfx(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, uint32_t lsb, uint32_t width)
struct aarch64_debug_reg_state * aarch64_get_debug_reg_state(pid_t pid)
struct arch_process_info * arch_private
static CORE_ADDR aarch64_get_pc(struct regcache *regcache)
static void aarch64_emit_ge_got(int *offset_p, int *size_p)
static struct aarch64_memory_operand preindex_memory_operand(int32_t index)
static void aarch64_emit_lsh(void)
static const gdb_byte aarch64_breakpoint[]
struct aarch64_register reg
CORE_ADDR linux_get_pc_32bit(struct regcache *regcache)
static void aarch64_emit_ext(int arg)
static int aarch64_cannot_store_register(int regno)
static int emit_ubfm(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, uint32_t immr, uint32_t imms)
unsigned int aarch64_watchpoint_length(unsigned int ctrl)
static const struct aarch64_register x4
static int emit_ldrb(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rn, struct aarch64_memory_operand operand)
void collect_register_by_name(struct regcache *regcache, const char *name, void *buf)
void aarch64_linux_get_debug_reg_capacity(int tid)
static int emit_cset(uint32_t *buf, struct aarch64_register rd, unsigned cond)
static struct emit_ops * aarch64_emit_ops(void)
static void aarch64_emit_epilogue(void)
int arm_breakpoint_kind_from_pc(CORE_ADDR *pcptr)
static int aarch64_supports_range_stepping(void)
CORE_ADDR current_insn_ptr
static int emit_and(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
#define aarch64_breakpoint_len
process_info * find_process_pid(int pid)
int arm_breakpoint_kind_from_current_state(CORE_ADDR *pcptr)
static int emit_ldp_q_offset(uint32_t *buf, unsigned rt, unsigned rt2, struct aarch64_register rn, int32_t offset)
void aarch64_compat_siginfo_from_siginfo(compat_siginfo_t *to, siginfo_t *from)
static struct aarch64_register aarch64_register(unsigned num, int is64)
static int aarch64_get_min_fast_tracepoint_insn_len(void)
static void aarch64_emit_add(void)
static void aarch64_ftrace_insn_reloc_b_cond(const unsigned cond, const int32_t offset, struct aarch64_insn_data *data)
void aarch64_linux_prepare_to_resume(struct lwp_info *lwp)
static int emit_mrs(uint32_t *buf, struct aarch64_register rt, enum aarch64_system_control_registers system_reg)
static void aarch64_linux_new_fork(struct process_info *parent, struct process_info *child)
int register_size(const struct target_desc *tdesc, int n)
static int emit_lslv(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
static int emit_mov(uint32_t *buf, struct aarch64_register rd, struct aarch64_operand operand)
static void aarch64_ftrace_insn_reloc_tb(const int32_t offset, int is_tbnz, const unsigned rt, unsigned bit, struct aarch64_insn_data *data)
static struct regsets_info aarch64_regsets_info
static int emit_ldp(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rt2, struct aarch64_register rn, struct aarch64_memory_operand operand)
static const struct aarch64_register xzr
void initialize_low_tdesc()
static void aarch64_fill_fpregset(struct regcache *regcache, void *buf)
static int emit_lsrv(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
const target_desc * aarch64_linux_read_description()
int target_read_uint32(CORE_ADDR memaddr, uint32_t *result)
static int emit_cmp(uint32_t *buf, struct aarch64_register rn, struct aarch64_operand operand)
static void aarch64_emit_stack_adjust(int n)
static struct aarch64_memory_operand offset_memory_operand(int32_t offset)
static int emit_eor(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
struct process_info * current_process(void)
static void aarch64_emit_call(CORE_ADDR fn)
static int emit_mul(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
CORE_ADDR dr_addr_bp[AARCH64_HBP_MAX_NUM]
static void aarch64_emit_log_not(void)
static void aarch64_get_syscall_trapinfo(struct regcache *regcache, int *sysno)
static struct aarch64_operand register_operand(struct aarch64_register reg)
struct process_info_private * priv
static int emit_sbfm(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, uint32_t immr, uint32_t imms)
static struct aarch64_memory_operand postindex_memory_operand(int32_t index)
static void aarch64_set_pc(struct regcache *regcache, CORE_ADDR pc)
static int emit_stp_q_offset(uint32_t *buf, unsigned rt, unsigned rt2, struct aarch64_register rn, int32_t offset)
static int emit_mvn(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rm)
void linux_set_pc_32bit(struct regcache *regcache, CORE_ADDR pc)
int linux_pid_exe_is_elf_64_file(int pid, unsigned int *machine)
static int emit_stp(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rt2, struct aarch64_register rn, struct aarch64_memory_operand operand)
int write_inferior_memory(CORE_ADDR memaddr, const unsigned char *myaddr, int len)
static int emit_csinc(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm, unsigned cond)
#define PTRACE_GETSIGINFO
static int emit_stlr(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rn)
static const struct aarch64_register x3
static int aarch64_remove_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static const struct aarch64_register w2
static void aarch64_ftrace_insn_reloc_adr(const int32_t offset, const unsigned rd, const int is_adrp, struct aarch64_insn_data *data)
static void aarch64_emit_ne_goto(int *offset_p, int *size_p)
ps_err_e aarch64_ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base, int is_64bit_p)
static int emit_sub(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_operand operand)
static void aarch64_emit_eq_goto(int *offset_p, int *size_p)
static void aarch64_emit_pop(void)
static struct aarch64_operand immediate_operand(uint32_t imm)
static int aarch64_stopped_by_watchpoint(void)
struct aarch64_insn_data base
static const struct regs_info * aarch64_regs_info(void)
CORE_ADDR get_raw_reg_func_addr(void)
static int emit_wfe(uint32_t *buf)
static void aarch64_store_fpregset(struct regcache *regcache, const void *buf)
static int aarch64_breakpoint_kind_from_pc(CORE_ADDR *pcptr)
int(* read_memory)(CORE_ADDR memaddr, unsigned char *myaddr, int len)
static void aarch64_emit_if_goto(int *offset_p, int *size_p)
struct regcache * get_thread_regcache(struct thread_info *thread, int fetch)
void aarch64_write_goto_address(CORE_ADDR from, CORE_ADDR to, int size)
int aarch64_linux_region_ok_for_watchpoint(CORE_ADDR addr, int len)
static int emit_sbfx(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, uint32_t lsb, uint32_t width)
static void aarch64_ftrace_insn_reloc_cb(const int32_t offset, const int is_cbnz, const unsigned rn, int is64, struct aarch64_insn_data *data)
#define Z_PACKET_ACCESS_WP
unsigned int dr_ref_count_bp[AARCH64_HBP_MAX_NUM]
unsigned int dr_ctrl_wp[AARCH64_HWP_MAX_NUM]
static int aarch64_breakpoint_kind_from_current_state(CORE_ADDR *pcptr)
static const struct aarch64_register x1
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
#define DR_CONTROL_ENABLED(ctrl)
unsigned long long ULONGEST
static void aarch64_emit_less_unsigned(void)
static int emit_push(uint32_t *buf, struct aarch64_register rt)
static int emit_load_store_exclusive(uint32_t *buf, uint32_t size, enum aarch64_opcodes opcode, struct aarch64_register rs, struct aarch64_register rt, struct aarch64_register rt2, struct aarch64_register rn)
static int emit_stxr(uint32_t *buf, struct aarch64_register rs, struct aarch64_register rt, struct aarch64_register rn)
static int emit_blr(uint32_t *buf, struct aarch64_register rn)
static int emit_ldrh(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rn, struct aarch64_memory_operand operand)
static void aarch64_emit_int_call_1(CORE_ADDR fn, int arg1)
static void aarch64_emit_reg(int reg)
static void aarch64_init_debug_reg_state(struct aarch64_debug_reg_state *state)
static const struct aarch64_register x2
void debug_printf(const char *fmt,...)
static int emit_orn(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
static int emit_load_store_pair(uint32_t *buf, enum aarch64_opcodes opcode, struct aarch64_register rt, struct aarch64_register rt2, struct aarch64_register rn, struct aarch64_memory_operand operand)
static void aarch64_linux_delete_process(struct arch_process_info *info)
static const struct aarch64_register x0
static void aarch64_emit_stack_flush(void)
static int aarch64_linux_siginfo_fixup(siginfo_t *native, gdb_byte *inf, int direction)
static int aarch64_supports_hardware_single_step(void)
void supply_register(struct regcache *regcache, int n, const void *buf)
static int emit_movk(uint32_t *buf, struct aarch64_register rd, uint32_t imm, unsigned shift)
static void append_insns(CORE_ADDR *to, size_t len, const uint32_t *buf)
const char * core_addr_to_string_nz(const CORE_ADDR addr)
static int emit_msr(uint32_t *buf, enum aarch64_system_control_registers system_reg, struct aarch64_register rt)
static const struct aarch64_register ip0
static int emit_pop(uint32_t *buf, struct aarch64_register rt)
static int emit_mov_addr(uint32_t *buf, struct aarch64_register rd, CORE_ADDR addr)
void aarch64_show_debug_reg_state(struct aarch64_debug_reg_state *state, const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type)
unsigned int dr_ctrl_bp[AARCH64_HBP_MAX_NUM]
static struct emit_ops aarch64_emit_ops_impl
void aarch64_siginfo_from_compat_siginfo(siginfo_t *to, compat_siginfo_t *from)
static const struct aarch64_insn_visitor visitor
static const gdb_byte * aarch64_sw_breakpoint_from_kind(int kind, int *size)
static int emit_sevl(uint32_t *buf)
static void aarch64_emit_const(LONGEST num)
static int emit_ret(uint32_t *buf, struct aarch64_register rn)
#define Z_PACKET_WRITE_WP
static void aarch64_emit_void_call_2(CORE_ADDR fn, int arg1)
static int emit_orr(uint32_t *buf, struct aarch64_register rd, struct aarch64_register rn, struct aarch64_register rm)
static void aarch64_emit_zero_ext(int arg)
static int aarch64_insert_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static const struct aarch64_register lr
static void aarch64_emit_rsh_signed(void)
CORE_ADDR dr_addr_wp[AARCH64_HWP_MAX_NUM]
static void aarch64_emit_lt_goto(int *offset_p, int *size_p)
static int emit_str(uint32_t *buf, struct aarch64_register rt, struct aarch64_register rn, struct aarch64_memory_operand operand)