158 "zero",
"at",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
159 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
160 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
161 "et",
"bt",
"gp",
"sp",
"fp",
"ea",
"sstatus",
"ra",
163 "status",
"estatus",
"bstatus",
"ienable",
164 "ipending",
"cpuid",
"ctl6",
"exception",
165 "pteaddr",
"tlbacc",
"tlbmisc",
"eccinj",
166 "badaddr",
"config",
"mpubase",
"mpuacc" 277 static const struct nios2_opcode *
285 if (mach == bfd_mach_nios2r2)
288 BFD_ENDIAN_LITTLE, &memword)
290 BFD_ENDIAN_LITTLE, &memword))
297 insn = (
unsigned int) memword;
300 return nios2_find_opcode_hash (insn, mach);
309 unsigned long mach,
int *ra,
int *rb,
int *rc)
311 int is_r2 = (mach == bfd_mach_nios2r2);
313 if (!is_r2 && (op->match == MATCH_R1_ADD || op->match == MATCH_R1_MOV))
315 *ra = GET_IW_R_A (insn);
316 *rb = GET_IW_R_B (insn);
317 *rc = GET_IW_R_C (insn);
322 else if (op->match == MATCH_R2_ADD || op->match == MATCH_R2_MOV)
324 *ra = GET_IW_F3X6L5_A (insn);
325 *rb = GET_IW_F3X6L5_B (insn);
326 *rc = GET_IW_F3X6L5_C (insn);
329 else if (op->match == MATCH_R2_ADD_N)
331 *ra = nios2_r2_reg3_mappings[GET_IW_T3X1_A3 (insn)];
332 *rb = nios2_r2_reg3_mappings[GET_IW_T3X1_B3 (insn)];
333 *rc = nios2_r2_reg3_mappings[GET_IW_T3X1_C3 (insn)];
336 else if (op->match == MATCH_R2_MOV_N)
338 *ra = GET_IW_F2_A (insn);
340 *rc = GET_IW_F2_B (insn);
351 unsigned long mach,
int *ra,
int *rb,
int *rc)
353 int is_r2 = (mach == bfd_mach_nios2r2);
355 if (!is_r2 && op->match == MATCH_R1_SUB)
357 *ra = GET_IW_R_A (insn);
358 *rb = GET_IW_R_B (insn);
359 *rc = GET_IW_R_C (insn);
364 else if (op->match == MATCH_R2_SUB)
366 *ra = GET_IW_F3X6L5_A (insn);
367 *rb = GET_IW_F3X6L5_B (insn);
368 *rc = GET_IW_F3X6L5_C (insn);
371 else if (op->match == MATCH_R2_SUB_N)
373 *ra = nios2_r2_reg3_mappings[GET_IW_T3X1_A3 (insn)];
374 *rb = nios2_r2_reg3_mappings[GET_IW_T3X1_B3 (insn)];
375 *rc = nios2_r2_reg3_mappings[GET_IW_T3X1_C3 (insn)];
387 unsigned long mach,
int *ra,
int *rb,
int *imm)
389 int is_r2 = (mach == bfd_mach_nios2r2);
391 if (!is_r2 && op->match == MATCH_R1_ADDI)
393 *ra = GET_IW_I_A (insn);
394 *rb = GET_IW_I_B (insn);
395 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
400 else if (op->match == MATCH_R2_ADDI)
402 *ra = GET_IW_F2I16_A (insn);
403 *rb = GET_IW_F2I16_B (insn);
404 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
407 else if (op->match == MATCH_R2_ADDI_N || op->match == MATCH_R2_SUBI_N)
409 *ra = nios2_r2_reg3_mappings[GET_IW_T2X1I3_A3 (insn)];
410 *rb = nios2_r2_reg3_mappings[GET_IW_T2X1I3_B3 (insn)];
411 *imm = nios2_r2_asi_n_mappings[GET_IW_T2X1I3_IMM3 (insn)];
412 if (op->match == MATCH_R2_SUBI_N)
416 else if (op->match == MATCH_R2_SPADDI_N)
418 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
420 *imm = GET_IW_T1I7_IMM7 (insn) << 2;
423 else if (op->match == MATCH_R2_SPINCI_N || op->match == MATCH_R2_SPDECI_N)
427 *imm = GET_IW_X1I7_IMM7 (insn) << 2;
428 if (op->match == MATCH_R2_SPDECI_N)
441 unsigned long mach,
int *ra,
int *rb,
unsigned int *uimm)
443 int is_r2 = (mach == bfd_mach_nios2r2);
445 if (!is_r2 && op->match == MATCH_R1_ORHI)
447 *ra = GET_IW_I_A (insn);
448 *rb = GET_IW_I_B (insn);
449 *uimm = GET_IW_I_IMM16 (insn);
454 else if (op->match == MATCH_R2_ORHI)
456 *ra = GET_IW_F2I16_A (insn);
457 *rb = GET_IW_F2I16_B (insn);
458 *uimm = GET_IW_F2I16_IMM16 (insn);
470 unsigned long mach,
int *ra,
int *rb,
int *imm)
472 int is_r2 = (mach == bfd_mach_nios2r2);
474 if (!is_r2 && (op->match == MATCH_R1_STW || op->match == MATCH_R1_STWIO))
476 *ra = GET_IW_I_A (insn);
477 *rb = GET_IW_I_B (insn);
478 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
483 else if (op->match == MATCH_R2_STW)
485 *ra = GET_IW_F2I16_A (insn);
486 *rb = GET_IW_F2I16_B (insn);
487 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
490 else if (op->match == MATCH_R2_STWIO)
492 *ra = GET_IW_F2X4I12_A (insn);
493 *rb = GET_IW_F2X4I12_B (insn);
494 *imm = (signed) (GET_IW_F2X4I12_IMM12 (insn) << 20) >> 20;
497 else if (op->match == MATCH_R2_STW_N)
499 *ra = nios2_r2_reg3_mappings[GET_IW_T2I4_A3 (insn)];
500 *rb = nios2_r2_reg3_mappings[GET_IW_T2I4_B3 (insn)];
501 *imm = GET_IW_T2I4_IMM4 (insn) << 2;
504 else if (op->match == MATCH_R2_STWSP_N)
507 *rb = GET_IW_F1I5_B (insn);
508 *imm = GET_IW_F1I5_IMM5 (insn) << 2;
511 else if (op->match == MATCH_R2_STWZ_N)
513 *ra = nios2_r2_reg3_mappings[GET_IW_T1X1I6_A3 (insn)];
515 *imm = GET_IW_T1X1I6_IMM6 (insn) << 2;
527 unsigned long mach,
int *ra,
int *rb,
int *imm)
529 int is_r2 = (mach == bfd_mach_nios2r2);
531 if (!is_r2 && (op->match == MATCH_R1_LDW || op->match == MATCH_R1_LDWIO))
533 *ra = GET_IW_I_A (insn);
534 *rb = GET_IW_I_B (insn);
535 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
540 else if (op->match == MATCH_R2_LDW)
542 *ra = GET_IW_F2I16_A (insn);
543 *rb = GET_IW_F2I16_B (insn);
544 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
547 else if (op->match == MATCH_R2_LDWIO)
549 *ra = GET_IW_F2X4I12_A (insn);
550 *rb = GET_IW_F2X4I12_B (insn);
551 *imm = (signed) (GET_IW_F2X4I12_IMM12 (insn) << 20) >> 20;
554 else if (op->match == MATCH_R2_LDW_N)
556 *ra = nios2_r2_reg3_mappings[GET_IW_T2I4_A3 (insn)];
557 *rb = nios2_r2_reg3_mappings[GET_IW_T2I4_B3 (insn)];
558 *imm = GET_IW_T2I4_IMM4 (insn) << 2;
561 else if (op->match == MATCH_R2_LDWSP_N)
564 *rb = GET_IW_F1I5_B (insn);
565 *imm = GET_IW_F1I5_IMM5 (insn) << 2;
576 unsigned long mach,
int *ra,
int *rc)
578 int is_r2 = (mach == bfd_mach_nios2r2);
580 if (!is_r2 && (op->match == MATCH_R1_RDCTL))
582 *ra = GET_IW_R_IMM5 (insn);
583 *rc = GET_IW_R_C (insn);
588 else if (op->match == MATCH_R2_RDCTL)
590 *ra = GET_IW_F3X6L5_IMM5 (insn);
591 *rc = GET_IW_F3X6L5_C (insn);
602 unsigned long mach,
unsigned int *reglist,
603 int *ra,
int *imm,
int *wb,
int *
id)
605 int is_r2 = (mach == bfd_mach_nios2r2);
609 else if (op->match == MATCH_R2_PUSH_N)
612 if (GET_IW_L5I4X1_FP (insn))
613 *reglist |= (1 << 28);
614 if (GET_IW_L5I4X1_CS (insn))
616 int val = GET_IW_L5I4X1_REGRANGE (insn);
617 *reglist |= nios2_r2_reg_range_mappings[val];
620 *imm = GET_IW_L5I4X1_IMM4 (insn) << 2;
625 else if (op->match == MATCH_R2_STWM)
627 unsigned int rawmask = GET_IW_F1X4L17_REGMASK (insn);
628 if (GET_IW_F1X4L17_RS (insn))
630 *reglist = ((rawmask << 14) & 0x00ffc000);
631 if (rawmask & (1 << 10))
632 *reglist |= (1 << 28);
633 if (rawmask & (1 << 11))
634 *reglist |= (1 << 31);
637 *reglist = rawmask << 2;
638 *ra = GET_IW_F1X4L17_A (insn);
640 *wb = GET_IW_F1X4L17_WB (insn);
641 *
id = GET_IW_F1X4L17_ID (insn);
652 unsigned long mach,
unsigned int *reglist,
653 int *ra,
int *imm,
int *wb,
int *
id,
int *ret)
655 int is_r2 = (mach == bfd_mach_nios2r2);
659 else if (op->match == MATCH_R2_POP_N)
662 if (GET_IW_L5I4X1_FP (insn))
663 *reglist |= (1 << 28);
664 if (GET_IW_L5I4X1_CS (insn))
666 int val = GET_IW_L5I4X1_REGRANGE (insn);
667 *reglist |= nios2_r2_reg_range_mappings[val];
670 *imm = GET_IW_L5I4X1_IMM4 (insn) << 2;
676 else if (op->match == MATCH_R2_LDWM)
678 unsigned int rawmask = GET_IW_F1X4L17_REGMASK (insn);
679 if (GET_IW_F1X4L17_RS (insn))
681 *reglist = ((rawmask << 14) & 0x00ffc000);
682 if (rawmask & (1 << 10))
683 *reglist |= (1 << 28);
684 if (rawmask & (1 << 11))
685 *reglist |= (1 << 31);
688 *reglist = rawmask << 2;
689 *ra = GET_IW_F1X4L17_A (insn);
691 *wb = GET_IW_F1X4L17_WB (insn);
692 *
id = GET_IW_F1X4L17_ID (insn);
693 *ret = GET_IW_F1X4L17_PC (insn);
715 unsigned long mach,
int *ra,
int *rb,
int *imm,
718 int is_r2 = (mach == bfd_mach_nios2r2);
748 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
749 *ra = GET_IW_I_A (insn);
750 *rb = GET_IW_I_B (insn);
761 *imm = (signed) ((GET_IW_I10_IMM10 (insn) << 1) << 21) >> 21;
763 case MATCH_R2_BEQZ_N:
765 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
767 *imm = (signed) ((GET_IW_T1I7_IMM7 (insn) << 1) << 24) >> 24;
769 case MATCH_R2_BNEZ_N:
771 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
773 *imm = (signed) ((GET_IW_T1I7_IMM7 (insn) << 1) << 24) >> 24;
799 *ra = GET_IW_F2I16_A (insn);
800 *rb = GET_IW_F2I16_B (insn);
801 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
813 unsigned long mach,
unsigned int *uimm)
815 int is_r2 = (mach == bfd_mach_nios2r2);
817 if (!is_r2 && op->match == MATCH_R1_JMPI)
819 *uimm = GET_IW_J_IMM26 (insn) << 2;
824 else if (op->match == MATCH_R2_JMPI)
826 *uimm = GET_IW_L26_IMM26 (insn) << 2;
838 unsigned long mach,
unsigned int *uimm)
840 int is_r2 = (mach == bfd_mach_nios2r2);
842 if (!is_r2 && op->match == MATCH_R1_CALL)
844 *uimm = GET_IW_J_IMM26 (insn) << 2;
849 else if (op->match == MATCH_R2_CALL)
851 *uimm = GET_IW_L26_IMM26 (insn) << 2;
863 unsigned long mach,
int *ra)
865 int is_r2 = (mach == bfd_mach_nios2r2);
871 *ra = GET_IW_I_A (insn);
889 *ra = GET_IW_F2I16_A (insn);
891 case MATCH_R2_JMPR_N:
892 *ra = GET_IW_F1X1_A (insn);
915 unsigned long mach,
int *ra)
917 int is_r2 = (mach == bfd_mach_nios2r2);
919 if (!is_r2 && op->match == MATCH_R1_CALLR)
921 *ra = GET_IW_I_A (insn);
926 else if (op->match == MATCH_R2_CALLR)
928 *ra = GET_IW_F2I16_A (insn);
931 else if (op->match == MATCH_R2_CALLR_N)
933 *ra = GET_IW_F1X1_A (insn);
944 unsigned long mach,
unsigned int *uimm)
946 int is_r2 = (mach == bfd_mach_nios2r2);
948 if (!is_r2 && op->match == MATCH_R1_BREAK)
950 *uimm = GET_IW_R_IMM5 (insn);
955 else if (op->match == MATCH_R2_BREAK)
957 *uimm = GET_IW_F3X6L5_IMM5 (insn);
960 else if (op->match == MATCH_R2_BREAK_N)
962 *uimm = GET_IW_X2L5_IMM5 (insn);
973 unsigned long mach,
unsigned int *uimm)
975 int is_r2 = (mach == bfd_mach_nios2r2);
977 if (!is_r2 && op->match == MATCH_R1_TRAP)
979 *uimm = GET_IW_R_IMM5 (insn);
984 else if (op->match == MATCH_R2_TRAP)
986 *uimm = GET_IW_F3X6L5_IMM5 (insn);
989 else if (op->match == MATCH_R2_TRAP_N)
991 *uimm = GET_IW_X2L5_IMM5 (insn);
1010 int is_r2 = (mach == bfd_mach_nios2r2);
1014 int ninsns, max_insns = 5;
1016 const struct nios2_opcode *op = NULL;
1025 if (current_pc <= start_pc)
1033 for (pc = start_pc; ; )
1038 if (pc + op->size < current_pc)
1047 && pc + imm < current_pc)
1063 for (ninsns = 0; ninsns < max_insns; ninsns++)
1081 &imm, &wb, &ret, &
id))
1094 if (ninsns == max_insns)
1195 int ninsns, max_insns = 50;
1212 int exception_handler = 0;
1226 "{ nios2_analyze_prologue start=%s, current=%s ",
1234 prologue_end = start_pc;
1235 for (ninsns = 0; ninsns < max_insns; ninsns++)
1239 const struct nios2_opcode *op;
1240 int ra, rb, rc, imm;
1242 unsigned int reglist;
1246 if (pc == current_pc)
1252 memcpy (temp_value,
value,
sizeof (temp_value));
1396 if (pc < current_pc)
1406 exception_handler = 1;
1414 ®list, &ra, &imm, &wb, &
id))
1427 for (i = 31; i >= 0; i--)
1428 if (reglist & (1 << i))
1433 if (orig > 0 &&
value[i].
offset == 0 && pc < current_pc)
1472 for (i = 2 ; i <= 3 ; i++)
1474 for (i = 9 ; i <= 15 ; i++)
1498 unsigned int next_insn;
1499 const struct nios2_opcode *next_op
1504 pc += next_op->size;
1513 unsigned int next_insn;
1514 const struct nios2_opcode *next_op
1533 &imm, &wb, &
id, &ret)
1544 if (this_frame == NULL)
1545 return prologue_end;
1554 if (exception_handler)
1599 if (ra == current_pc)
1604 "<noreturn ADJUST %s, r31@r%d+?>, r%d@r%d+?> }\n",
1653 cache->
cfa = frame_high;
1656 if (exception_handler)
1667 return prologue_end;
1687 if (post_prologue_pc != 0)
1688 return std::max (start_pc, post_prologue_pc);
1703 if (mach == bfd_mach_nios2r2)
1706 const struct nios2_opcode *op
1742 static const gdb_byte cdx_breakpoint_le[] = {0xc9, 0xd7};
1744 return cdx_breakpoint_le;
1750 if (mach == bfd_mach_nios2r2)
1752 static const gdb_byte r2_breakpoint_le[] = {0x20, 0x00, 0xfd, 0xb7};
1754 return r2_breakpoint_le;
1758 enum bfd_endian byte_order_for_code
1763 static const gdb_byte r1_breakpoint_le[] = {0xfa, 0x6f, 0x3b, 0x0};
1764 static const gdb_byte r1_breakpoint_be[] = {0x0, 0x3b, 0x6f, 0xfa};
1766 if (byte_order_for_code == BFD_ENDIAN_BIG)
1767 return r1_breakpoint_be;
1769 return r1_breakpoint_le;
1822 int stack_offset = 0;
1831 for (argnum = 0; argnum < nargs; argnum++)
1846 for (argnum = 0; argnum < nargs; argnum++)
1849 struct value *arg = args[argnum];
1860 int partial_len = (len < 4 ? len : 4);
1877 stack_offset +=
align_up (partial_len, 4);
1916 void **this_prologue_cache)
1922 if (*this_prologue_cache)
1926 *this_prologue_cache = cache;
1949 if (cache->
base == 0)
1957 static struct value *
2029 if (*this_cache != NULL)
2032 *this_cache = this_trad_cache;
2048 return this_trad_cache;
2065 static struct value *
2067 void **this_cache,
int regnum)
2177 pc = (pc & 0xf0000000) | uimm;
2183 else if (
nios2_match_ldwm (insn, op, mach, &uimm, &ra, &imm, &wb, &
id, &ret)
2208 static std::vector<CORE_ADDR>
2256 if (feature == NULL)
2340 if (tdep->
jb_pc >= 0)
2362 _(
"Set Nios II debugging."),
2363 _(
"Show Nios II debugging."),
2364 _(
"When on, Nios II specific debugging is enabled."),
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_double_bit(struct gdbarch *gdbarch, int double_bit)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
void set_gdbarch_float_format(struct gdbarch *gdbarch, const struct floatformat **float_format)
CORE_ADDR(* syscall_next_pc)(struct frame_info *frame)
ULONGEST regcache_raw_get_unsigned(struct regcache *regcache, int regnum)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
#define NIOS2_BSTATUS_REGNUM
void set_gdbarch_get_longjmp_target(struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype get_longjmp_target)
CORE_ADDR get_frame_address_in_block(struct frame_info *this_frame)
#define NIOS2_PTEADDR_REGNUM
struct type * builtin_func_ptr
static void nios2_setup_default(struct nios2_unwind_cache *cache)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
CORE_ADDR get_frame_pc(struct frame_info *frame)
void _initialize_nios2_tdep(void)
struct frame_info * get_current_frame(void)
static int nios2_stub_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **cache)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
static const char *const nios2_reg_names[NIOS2_NUM_REGS]
static struct nios2_unwind_cache * nios2_frame_unwind_cache(struct frame_info *this_frame, void **this_prologue_cache)
static int nios2_match_rdctl(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rc)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
void trad_frame_set_reg_realreg(struct trad_frame_cache *this_trad_cache, int regnum, int realreg)
void set_gdbarch_stab_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
static int nios2_match_addi(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm)
static int nios2_dwarf_reg_to_regnum(struct gdbarch *gdbarch, int dw_reg)
ULONGEST align_down(ULONGEST v, int n)
gdb_static_assert(ARRAY_SIZE(nios2_dwarf2gdb_regno_map)==NIOS2_NUM_REGS)
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
void regcache_cooked_write_signed(struct regcache *regcache, int regnum, LONGEST val)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
static struct trad_frame_cache * nios2_stub_frame_cache(struct frame_info *this_frame, void **this_cache)
static CORE_ADDR nios2_get_next_pc(struct regcache *regcache, CORE_ADDR pc)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void frame_unwind_register(struct frame_info *frame, int regnum, gdb_byte *buf)
const char * tdesc_register_name(struct gdbarch *gdbarch, int regno)
static int nios2_match_break(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
#define NIOS2_TLBMISC_REGNUM
static int nios2_match_stwm(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *reglist, int *ra, int *imm, int *wb, int *id)
int safe_read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value)
#define NIOS2_ESTATUS_REGNUM
static int nios2_dwarf2gdb_regno_map[]
static int nios2_match_branch(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm, enum branch_condition *cond)
static CORE_ADDR nios2_analyze_prologue(struct gdbarch *gdbarch, const CORE_ADDR start_pc, const CORE_ADDR current_pc, struct nios2_unwind_cache *cache, struct frame_info *this_frame)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
static CORE_ADDR nios2_frame_align(struct gdbarch *gdbarch, CORE_ADDR addr)
static int nios2_match_callr(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra)
static void nios2_extract_return_value(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *valbuf)
static int nios2_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
#define NIOS2_EXCEPTION_REGNUM
#define NIOS2_OPCODE_SIZE
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
static std::vector< CORE_ADDR > nios2_software_single_step(struct regcache *regcache)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
void tdesc_data_cleanup(void *data_untyped)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static struct type * nios2_register_type(struct gdbarch *gdbarch, int regno)
#define FRAME_OBSTACK_ZALLOC(TYPE)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep)
void set_gdbarch_addr_bit(struct gdbarch *gdbarch, int addr_bit)
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static int nios2_match_sub(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *rc)
static int nios2_match_stw(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm)
static CORE_ADDR nios2_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
LONGEST regcache_raw_get_signed(struct regcache *regcache, int regnum)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
static void nios2_init_cache(struct nios2_unwind_cache *cache, CORE_ADDR pc)
struct type * check_typedef(struct type *type)
const gdb_byte * value_contents(struct value *value)
static void nios2_store_return_value(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf)
static int nios2_match_jmpi(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
struct value::@186::@187 reg
void set_gdbarch_stack_frame_destroyed_p(struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype stack_frame_destroyed_p)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
static int nios2_match_trap(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static CORE_ADDR nios2_unwind_sp(struct gdbarch *gdbarch, struct frame_info *this_frame)
static CORE_ADDR nios2_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
#define NIOS2_IPENDING_REGNUM
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
#define NIOS2_FIRST_ARGREG
static void nios2_stub_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
struct type * builtin_uint32
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
#define NIOS2_STATUS_REGNUM
static int nios2_match_calli(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
static const struct frame_base nios2_frame_base
struct reg_value reg_value[NIOS2_NUM_REGS]
static struct gdbarch * nios2_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
struct trad_frame_cache * trad_frame_cache_zalloc(struct frame_info *this_frame)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
static const struct frame_unwind nios2_frame_unwind
struct cmd_list_element * setdebuglist
#define NIOS2_LAST_ARGREG
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype breakpoint_kind_from_pc)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
struct frame_info * this_frame
const struct target_desc * target_desc
static struct value * nios2_stub_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
void set_gdbarch_software_single_step(struct gdbarch *gdbarch, gdbarch_software_single_step_ftype software_single_step)
#define NIOS2_IENABLE_REGNUM
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
#define NIOS2_ECCINJ_REGNUM
struct reg_saved reg_saved[NIOS2_NUM_REGS]
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, struct tdesc_arch_data *early_data)
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
#define NIOS2_TLBACC_REGNUM
#define NIOS2_BADADDR_REGNUM
ULONGEST align_up(ULONGEST v, int n)
static int nios2_match_add(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *rc)
int frame_relative_level(struct frame_info *fi)
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type)
struct type * builtin_data_ptr
static int in_plt_section(CORE_ADDR pc)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
static enum return_value_convention nios2_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
struct type * tdesc_register_type(struct gdbarch *gdbarch, int regno)
static int nios2_match_ldw(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define NIOS2_CPUID_REGNUM
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
enum register_status regcache_cooked_read(struct regcache *regcache, int regnum, gdb_byte *buf)
static int nios2_get_longjmp_target(struct frame_info *frame, CORE_ADDR *pc)
void trad_frame_set_this_base(struct trad_frame_cache *this_trad_cache, CORE_ADDR this_base)
static void nios2_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
struct tdesc_arch_data * tdesc_data_alloc(void)
#define NIOS2_CDX_OPCODE_SIZE
static int nios2_match_orhi(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, unsigned int *uimm)
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int register_size(struct gdbarch *gdbarch, int regnum)
static int nios2_match_jmpr(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra)
struct type * value_type(const struct value *value)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
struct cmd_list_element * showdebuglist
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
static CORE_ADDR nios2_frame_base_address(struct frame_info *this_frame, void **this_cache)
static const struct nios2_opcode * nios2_fetch_insn(struct gdbarch *gdbarch, CORE_ADDR pc, unsigned int *insnp)
#define NIOS2_MPUBASE_REGNUM
static struct frame_id nios2_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
struct target_desc * tdesc_nios2
static void initialize_tdesc_nios2(void)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
static struct value * nios2_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype sw_breakpoint_from_kind)
static int nios2_in_epilogue_p(struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR start_pc)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
static struct gdbarch_data * tdesc_data
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, struct frame_info *this_frame, int regnum)
enum bfd_endian gdbarch_byte_order_for_code(struct gdbarch *gdbarch)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
static const struct frame_unwind nios2_stub_frame_unwind
int tdesc_has_registers(const struct target_desc *target_desc)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
static int nios2_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, struct gdbarch_tdep *tdep)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype inner_than)
static const gdb_byte * nios2_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
void regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
#define NIOS2_MPUACC_REGNUM
#define NIOS2_CONFIG_REGNUM
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
static CORE_ADDR nios2_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static const char * nios2_register_name(struct gdbarch *gdbarch, int regno)
static int nios2_match_ldwm(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *reglist, int *ra, int *imm, int *wb, int *id, int *ret)