160 "zero",
"at",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
161 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
162 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
163 "et",
"bt",
"gp",
"sp",
"fp",
"ea",
"sstatus",
"ra",
165 "status",
"estatus",
"bstatus",
"ienable",
166 "ipending",
"cpuid",
"ctl6",
"exception",
167 "pteaddr",
"tlbacc",
"tlbmisc",
"eccinj",
168 "badaddr",
"config",
"mpubase",
"mpuacc"
208 int len = valtype->
length ();
229 int len = valtype->
length ();
279static const struct nios2_opcode *
287 if (mach == bfd_mach_nios2r2)
290 BFD_ENDIAN_LITTLE, &memword)
292 BFD_ENDIAN_LITTLE, &memword))
299 insn = (
unsigned int) memword;
302 return nios2_find_opcode_hash (insn, mach);
311 unsigned long mach,
int *ra,
int *rb,
int *rc)
313 int is_r2 = (mach == bfd_mach_nios2r2);
315 if (!is_r2 && (op->match == MATCH_R1_ADD || op->match == MATCH_R1_MOV))
317 *ra = GET_IW_R_A (insn);
318 *rb = GET_IW_R_B (insn);
319 *rc = GET_IW_R_C (insn);
324 else if (op->match == MATCH_R2_ADD || op->match == MATCH_R2_MOV)
326 *ra = GET_IW_F3X6L5_A (insn);
327 *rb = GET_IW_F3X6L5_B (insn);
328 *rc = GET_IW_F3X6L5_C (insn);
331 else if (op->match == MATCH_R2_ADD_N)
333 *ra = nios2_r2_reg3_mappings[GET_IW_T3X1_A3 (insn)];
334 *rb = nios2_r2_reg3_mappings[GET_IW_T3X1_B3 (insn)];
335 *rc = nios2_r2_reg3_mappings[GET_IW_T3X1_C3 (insn)];
338 else if (op->match == MATCH_R2_MOV_N)
340 *ra = GET_IW_F2_A (insn);
342 *rc = GET_IW_F2_B (insn);
353 unsigned long mach,
int *ra,
int *rb,
int *rc)
355 int is_r2 = (mach == bfd_mach_nios2r2);
357 if (!is_r2 && op->match == MATCH_R1_SUB)
359 *ra = GET_IW_R_A (insn);
360 *rb = GET_IW_R_B (insn);
361 *rc = GET_IW_R_C (insn);
366 else if (op->match == MATCH_R2_SUB)
368 *ra = GET_IW_F3X6L5_A (insn);
369 *rb = GET_IW_F3X6L5_B (insn);
370 *rc = GET_IW_F3X6L5_C (insn);
373 else if (op->match == MATCH_R2_SUB_N)
375 *ra = nios2_r2_reg3_mappings[GET_IW_T3X1_A3 (insn)];
376 *rb = nios2_r2_reg3_mappings[GET_IW_T3X1_B3 (insn)];
377 *rc = nios2_r2_reg3_mappings[GET_IW_T3X1_C3 (insn)];
389 unsigned long mach,
int *ra,
int *rb,
int *imm)
391 int is_r2 = (mach == bfd_mach_nios2r2);
393 if (!is_r2 && op->match == MATCH_R1_ADDI)
395 *ra = GET_IW_I_A (insn);
396 *rb = GET_IW_I_B (insn);
397 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
402 else if (op->match == MATCH_R2_ADDI)
404 *ra = GET_IW_F2I16_A (insn);
405 *rb = GET_IW_F2I16_B (insn);
406 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
409 else if (op->match == MATCH_R2_ADDI_N || op->match == MATCH_R2_SUBI_N)
411 *ra = nios2_r2_reg3_mappings[GET_IW_T2X1I3_A3 (insn)];
412 *rb = nios2_r2_reg3_mappings[GET_IW_T2X1I3_B3 (insn)];
413 *imm = nios2_r2_asi_n_mappings[GET_IW_T2X1I3_IMM3 (insn)];
414 if (op->match == MATCH_R2_SUBI_N)
418 else if (op->match == MATCH_R2_SPADDI_N)
420 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
422 *imm = GET_IW_T1I7_IMM7 (insn) << 2;
425 else if (op->match == MATCH_R2_SPINCI_N || op->match == MATCH_R2_SPDECI_N)
429 *imm = GET_IW_X1I7_IMM7 (insn) << 2;
430 if (op->match == MATCH_R2_SPDECI_N)
443 unsigned long mach,
int *ra,
int *rb,
unsigned int *uimm)
445 int is_r2 = (mach == bfd_mach_nios2r2);
447 if (!is_r2 && op->match == MATCH_R1_ORHI)
449 *ra = GET_IW_I_A (insn);
450 *rb = GET_IW_I_B (insn);
451 *uimm = GET_IW_I_IMM16 (insn);
456 else if (op->match == MATCH_R2_ORHI)
458 *ra = GET_IW_F2I16_A (insn);
459 *rb = GET_IW_F2I16_B (insn);
460 *uimm = GET_IW_F2I16_IMM16 (insn);
472 unsigned long mach,
int *ra,
int *rb,
int *imm)
474 int is_r2 = (mach == bfd_mach_nios2r2);
476 if (!is_r2 && (op->match == MATCH_R1_STW || op->match == MATCH_R1_STWIO))
478 *ra = GET_IW_I_A (insn);
479 *rb = GET_IW_I_B (insn);
480 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
485 else if (op->match == MATCH_R2_STW)
487 *ra = GET_IW_F2I16_A (insn);
488 *rb = GET_IW_F2I16_B (insn);
489 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
492 else if (op->match == MATCH_R2_STWIO)
494 *ra = GET_IW_F2X4I12_A (insn);
495 *rb = GET_IW_F2X4I12_B (insn);
496 *imm = (signed) (GET_IW_F2X4I12_IMM12 (insn) << 20) >> 20;
499 else if (op->match == MATCH_R2_STW_N)
501 *ra = nios2_r2_reg3_mappings[GET_IW_T2I4_A3 (insn)];
502 *rb = nios2_r2_reg3_mappings[GET_IW_T2I4_B3 (insn)];
503 *imm = GET_IW_T2I4_IMM4 (insn) << 2;
506 else if (op->match == MATCH_R2_STWSP_N)
509 *rb = GET_IW_F1I5_B (insn);
510 *imm = GET_IW_F1I5_IMM5 (insn) << 2;
513 else if (op->match == MATCH_R2_STWZ_N)
515 *ra = nios2_r2_reg3_mappings[GET_IW_T1X1I6_A3 (insn)];
517 *imm = GET_IW_T1X1I6_IMM6 (insn) << 2;
529 unsigned long mach,
int *ra,
int *rb,
int *imm)
531 int is_r2 = (mach == bfd_mach_nios2r2);
533 if (!is_r2 && (op->match == MATCH_R1_LDW || op->match == MATCH_R1_LDWIO))
535 *ra = GET_IW_I_A (insn);
536 *rb = GET_IW_I_B (insn);
537 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
542 else if (op->match == MATCH_R2_LDW)
544 *ra = GET_IW_F2I16_A (insn);
545 *rb = GET_IW_F2I16_B (insn);
546 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
549 else if (op->match == MATCH_R2_LDWIO)
551 *ra = GET_IW_F2X4I12_A (insn);
552 *rb = GET_IW_F2X4I12_B (insn);
553 *imm = (signed) (GET_IW_F2X4I12_IMM12 (insn) << 20) >> 20;
556 else if (op->match == MATCH_R2_LDW_N)
558 *ra = nios2_r2_reg3_mappings[GET_IW_T2I4_A3 (insn)];
559 *rb = nios2_r2_reg3_mappings[GET_IW_T2I4_B3 (insn)];
560 *imm = GET_IW_T2I4_IMM4 (insn) << 2;
563 else if (op->match == MATCH_R2_LDWSP_N)
566 *rb = GET_IW_F1I5_B (insn);
567 *imm = GET_IW_F1I5_IMM5 (insn) << 2;
578 unsigned long mach,
int *ra,
int *rc)
580 int is_r2 = (mach == bfd_mach_nios2r2);
582 if (!is_r2 && (op->match == MATCH_R1_RDCTL))
584 *ra = GET_IW_R_IMM5 (insn);
585 *rc = GET_IW_R_C (insn);
590 else if (op->match == MATCH_R2_RDCTL)
592 *ra = GET_IW_F3X6L5_IMM5 (insn);
593 *rc = GET_IW_F3X6L5_C (insn);
604 unsigned long mach,
unsigned int *reglist,
605 int *ra,
int *imm,
int *wb,
int *
id)
607 int is_r2 = (mach == bfd_mach_nios2r2);
611 else if (op->match == MATCH_R2_PUSH_N)
614 if (GET_IW_L5I4X1_FP (insn))
615 *reglist |= (1 << 28);
616 if (GET_IW_L5I4X1_CS (insn))
618 int val = GET_IW_L5I4X1_REGRANGE (insn);
619 *reglist |= nios2_r2_reg_range_mappings[val];
622 *imm = GET_IW_L5I4X1_IMM4 (insn) << 2;
627 else if (op->match == MATCH_R2_STWM)
629 unsigned int rawmask = GET_IW_F1X4L17_REGMASK (insn);
630 if (GET_IW_F1X4L17_RS (insn))
632 *reglist = ((rawmask << 14) & 0x00ffc000);
633 if (rawmask & (1 << 10))
634 *reglist |= (1 << 28);
635 if (rawmask & (1 << 11))
636 *reglist |= (1 << 31);
639 *reglist = rawmask << 2;
640 *ra = GET_IW_F1X4L17_A (insn);
642 *wb = GET_IW_F1X4L17_WB (insn);
643 *
id = GET_IW_F1X4L17_ID (insn);
654 unsigned long mach,
unsigned int *reglist,
655 int *ra,
int *imm,
int *wb,
int *
id,
int *ret)
657 int is_r2 = (mach == bfd_mach_nios2r2);
661 else if (op->match == MATCH_R2_POP_N)
664 if (GET_IW_L5I4X1_FP (insn))
665 *reglist |= (1 << 28);
666 if (GET_IW_L5I4X1_CS (insn))
668 int val = GET_IW_L5I4X1_REGRANGE (insn);
669 *reglist |= nios2_r2_reg_range_mappings[val];
672 *imm = GET_IW_L5I4X1_IMM4 (insn) << 2;
678 else if (op->match == MATCH_R2_LDWM)
680 unsigned int rawmask = GET_IW_F1X4L17_REGMASK (insn);
681 if (GET_IW_F1X4L17_RS (insn))
683 *reglist = ((rawmask << 14) & 0x00ffc000);
684 if (rawmask & (1 << 10))
685 *reglist |= (1 << 28);
686 if (rawmask & (1 << 11))
687 *reglist |= (1 << 31);
690 *reglist = rawmask << 2;
691 *ra = GET_IW_F1X4L17_A (insn);
693 *wb = GET_IW_F1X4L17_WB (insn);
694 *
id = GET_IW_F1X4L17_ID (insn);
695 *ret = GET_IW_F1X4L17_PC (insn);
717 unsigned long mach,
int *ra,
int *rb,
int *imm,
720 int is_r2 = (mach == bfd_mach_nios2r2);
750 *imm = (signed) (GET_IW_I_IMM16 (insn) << 16) >> 16;
751 *ra = GET_IW_I_A (insn);
752 *rb = GET_IW_I_B (insn);
763 *imm = (signed) ((GET_IW_I10_IMM10 (insn) << 1) << 21) >> 21;
765 case MATCH_R2_BEQZ_N:
767 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
769 *imm = (signed) ((GET_IW_T1I7_IMM7 (insn) << 1) << 24) >> 24;
771 case MATCH_R2_BNEZ_N:
773 *ra = nios2_r2_reg3_mappings[GET_IW_T1I7_A3 (insn)];
775 *imm = (signed) ((GET_IW_T1I7_IMM7 (insn) << 1) << 24) >> 24;
801 *ra = GET_IW_F2I16_A (insn);
802 *rb = GET_IW_F2I16_B (insn);
803 *imm = (signed) (GET_IW_F2I16_IMM16 (insn) << 16) >> 16;
815 unsigned long mach,
unsigned int *uimm)
817 int is_r2 = (mach == bfd_mach_nios2r2);
819 if (!is_r2 && op->match == MATCH_R1_JMPI)
821 *uimm = GET_IW_J_IMM26 (insn) << 2;
826 else if (op->match == MATCH_R2_JMPI)
828 *uimm = GET_IW_L26_IMM26 (insn) << 2;
840 unsigned long mach,
unsigned int *uimm)
842 int is_r2 = (mach == bfd_mach_nios2r2);
844 if (!is_r2 && op->match == MATCH_R1_CALL)
846 *uimm = GET_IW_J_IMM26 (insn) << 2;
851 else if (op->match == MATCH_R2_CALL)
853 *uimm = GET_IW_L26_IMM26 (insn) << 2;
865 unsigned long mach,
int *ra)
867 int is_r2 = (mach == bfd_mach_nios2r2);
873 *ra = GET_IW_I_A (insn);
891 *ra = GET_IW_F2I16_A (insn);
893 case MATCH_R2_JMPR_N:
894 *ra = GET_IW_F1X1_A (insn);
917 unsigned long mach,
int *ra)
919 int is_r2 = (mach == bfd_mach_nios2r2);
921 if (!is_r2 && op->match == MATCH_R1_CALLR)
923 *ra = GET_IW_I_A (insn);
928 else if (op->match == MATCH_R2_CALLR)
930 *ra = GET_IW_F2I16_A (insn);
933 else if (op->match == MATCH_R2_CALLR_N)
935 *ra = GET_IW_F1X1_A (insn);
946 unsigned long mach,
unsigned int *uimm)
948 int is_r2 = (mach == bfd_mach_nios2r2);
950 if (!is_r2 && op->match == MATCH_R1_BREAK)
952 *uimm = GET_IW_R_IMM5 (insn);
957 else if (op->match == MATCH_R2_BREAK)
959 *uimm = GET_IW_F3X6L5_IMM5 (insn);
962 else if (op->match == MATCH_R2_BREAK_N)
964 *uimm = GET_IW_X2L5_IMM5 (insn);
975 unsigned long mach,
unsigned int *uimm)
977 int is_r2 = (mach == bfd_mach_nios2r2);
979 if (!is_r2 && op->match == MATCH_R1_TRAP)
981 *uimm = GET_IW_R_IMM5 (insn);
986 else if (op->match == MATCH_R2_TRAP)
988 *uimm = GET_IW_F3X6L5_IMM5 (insn);
991 else if (op->match == MATCH_R2_TRAP_N)
993 *uimm = GET_IW_X2L5_IMM5 (insn);
1008 CORE_ADDR current_pc,
1012 int is_r2 = (mach == bfd_mach_nios2r2);
1016 int ninsns, max_insns = 5;
1018 const struct nios2_opcode *op = NULL;
1027 if (current_pc <= start_pc)
1035 for (pc = start_pc; ; )
1040 if (pc + op->size < current_pc)
1049 && pc + imm < current_pc)
1065 for (ninsns = 0; ninsns < max_insns; ninsns++)
1083 &imm, &wb, &ret, &
id))
1096 if (ninsns == max_insns)
1118 CORE_ADDR func_addr;
1190 const CORE_ADDR current_pc,
1197 int ninsns, max_insns = 50;
1209 CORE_ADDR pc = start_pc;
1212 int exception_handler = 0;
1216 CORE_ADDR frame_high;
1219 CORE_ADDR prologue_end;
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));
1315 if (
value[rb].reg == 0)
1317 else if (
value[ra].reg == 0)
1334 &&
value[rc].reg != 0)
1340 if (
value[rb].reg == 0)
1392 && (
value[rb].offset == 0
1396 if (pc < current_pc)
1406 exception_handler = 1;
1414 ®list, &ra, &imm, &wb, &
id))
1426 for (
int i = 31; i >= 0; i--)
1427 if (reglist & (1 << i))
1432 if (orig > 0 &&
value[i].offset == 0 && pc < current_pc)
1463 &&
value[8].offset == 0
1471 for (
int i = 2 ; i <= 3 ; i++)
1473 for (
int i = 9 ; i <= 15 ; i++)
1497 unsigned int next_insn;
1498 const struct nios2_opcode *next_op
1503 pc += next_op->size;
1512 unsigned int next_insn;
1513 const struct nios2_opcode *next_op
1532 &imm, &wb, &
id, &ret)
1543 if (this_frame == NULL)
1544 return prologue_end;
1553 if (exception_handler)
1598 if (ra == current_pc)
1603 "<noreturn ADJUST %s, r31@r%d+?>, r%d@r%d+?> }\n",
1652 cache->
cfa = frame_high;
1655 if (exception_handler)
1666 return prologue_end;
1674 CORE_ADDR func_addr;
1683 CORE_ADDR post_prologue_pc
1686 if (post_prologue_pc != 0)
1687 return std::max (start_pc, post_prologue_pc);
1702 if (mach == bfd_mach_nios2r2)
1705 const struct nios2_opcode *op
1719static const gdb_byte *
1741 static const gdb_byte cdx_breakpoint_le[] = {0xc9, 0xd7};
1743 return cdx_breakpoint_le;
1749 if (mach == bfd_mach_nios2r2)
1751 static const gdb_byte r2_breakpoint_le[] = {0x20, 0x00, 0xfd, 0xb7};
1753 return r2_breakpoint_le;
1757 enum bfd_endian byte_order_for_code
1762 static const gdb_byte r1_breakpoint_le[] = {0xfa, 0x6f, 0x3b, 0x0};
1763 static const gdb_byte r1_breakpoint_be[] = {0x0, 0x3b, 0x6f, 0xfa};
1765 if (byte_order_for_code == BFD_ENDIAN_BIG)
1766 return r1_breakpoint_be;
1768 return r1_breakpoint_le;
1778 return align_down (addr, 4);
1787 gdb_byte *readbuf,
const gdb_byte *writebuf)
1805 int nargs,
struct value **args, CORE_ADDR sp,
1807 CORE_ADDR struct_addr)
1812 int stack_offset = 0;
1820 for (argnum = 0; argnum < nargs; argnum++)
1821 arg_space += align_up (args[argnum]->
type ()->length (), 4);
1835 for (argnum = 0; argnum < nargs; argnum++)
1837 const gdb_byte *val;
1838 struct value *arg = args[argnum];
1840 int len = arg_type->
length ();
1849 int partial_len = (len < 4 ? len : 4);
1863 CORE_ADDR addr = sp + stack_offset;
1866 stack_offset += align_up (partial_len, 4);
1897 void **this_prologue_cache)
1900 CORE_ADDR current_pc;
1903 if (*this_prologue_cache)
1907 *this_prologue_cache = cache;
1930 if (cache->
base == 0)
1938static struct value *
2006 CORE_ADDR start_addr;
2007 CORE_ADDR stack_addr;
2011 if (*this_cache != NULL)
2014 *this_cache = this_trad_cache;
2030 return this_trad_cache;
2047static struct value *
2049 void **this_cache,
int regnum)
2120 unsigned int rau = regcache_raw_get_unsigned (
regcache, ra);
2121 unsigned int rbu = regcache_raw_get_unsigned (
regcache, rb);
2159 pc = (pc & 0xf0000000) | uimm;
2162 CORE_ADDR callto = (pc & 0xf0000000) | uimm;
2173 pc = regcache_raw_get_unsigned (
regcache, ra);
2176 CORE_ADDR callto = regcache_raw_get_unsigned (
regcache, ra);
2185 else if (
nios2_match_ldwm (insn, op, mach, &uimm, &ra, &imm, &wb, &
id, &ret)
2210static std::vector<CORE_ADDR>
2244 case TYPE_CODE_FUNC:
2245 case TYPE_CODE_FLAGS:
2247 case TYPE_CODE_RANGE:
2249 case TYPE_CODE_ENUM:
2251 case TYPE_CODE_RVALUE_REF:
2252 case TYPE_CODE_CHAR:
2253 case TYPE_CODE_BOOL:
2254 case TYPE_CODE_DECFLOAT:
2255 case TYPE_CODE_METHODPTR:
2256 case TYPE_CODE_MEMBERPTR:
2258 return std::min<ULONGEST> (4,
type->
length ());
2279 const struct target_desc *tdesc = info.target_desc;
2288 const struct tdesc_feature *feature;
2292 if (feature == NULL)
2377 if (tdep->
jb_pc >= 0)
2400 _(
"Set Nios II debugging."),
2401 _(
"Show Nios II debugging."),
2402 _(
"When on, Nios II specific debugging is enabled."),
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep, gdbarch_supports_arch_info_ftype *supports_arch_info)
static std::vector< const char * > arches
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
enum register_status cooked_read(int regnum, gdb_byte *buf)
void cooked_write(int regnum, const gdb_byte *buf)
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
int safe_read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
struct value * frame_unwind_got_memory(frame_info_ptr frame, int regnum, CORE_ADDR addr)
struct value * frame_unwind_got_register(frame_info_ptr frame, int regnum, int new_regnum)
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
struct value * frame_unwind_got_constant(frame_info_ptr frame, int regnum, ULONGEST val)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
int frame_relative_level(frame_info_ptr fi)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
void frame_unwind_register(frame_info_ptr next_frame, int regnum, gdb_byte *buf)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
frame_info_ptr get_current_frame(void)
CORE_ADDR get_frame_address_in_block(frame_info_ptr this_frame)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
void set_gdbarch_stab_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum)
void set_gdbarch_addr_bit(struct gdbarch *gdbarch, int addr_bit)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc)
void set_gdbarch_software_single_step(struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align)
void set_gdbarch_get_longjmp_target(struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value)
void set_gdbarch_double_bit(struct gdbarch *gdbarch, int double_bit)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than)
enum bfd_endian gdbarch_byte_order_for_code(struct gdbarch *gdbarch)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type)
void set_gdbarch_gcc_target_options(struct gdbarch *gdbarch, gdbarch_gcc_target_options_ftype *gcc_target_options)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
void set_gdbarch_stack_frame_destroyed_p(struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype *stack_frame_destroyed_p)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
void set_gdbarch_type_align(struct gdbarch *gdbarch, gdbarch_type_align_ftype *type_align)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind)
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
void set_gdbarch_float_format(struct gdbarch *gdbarch, const struct floatformat **float_format)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
std::unique_ptr< gdbarch_tdep_base > gdbarch_tdep_up
function_call_return_method
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
struct type * check_typedef(struct type *type)
static int nios2_dwarf_reg_to_regnum(struct gdbarch *gdbarch, int dw_reg)
static void nios2_stub_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static CORE_ADDR nios2_unwind_pc(struct gdbarch *gdbarch, frame_info_ptr next_frame)
static CORE_ADDR nios2_get_next_pc(struct regcache *regcache, CORE_ADDR pc)
static int nios2_match_ldw(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *imm)
static int nios2_match_break(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
static int nios2_stub_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **cache)
static std::string nios2_gcc_target_options(struct gdbarch *gdbarch)
static void nios2_setup_default(struct nios2_unwind_cache *cache)
static int nios2_dwarf2gdb_regno_map[]
static const struct frame_base nios2_frame_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 int nios2_match_calli(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
static int nios2_match_orhi(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, unsigned int *uimm)
static int nios2_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
static void nios2_extract_return_value(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *valbuf)
static struct value * nios2_stub_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static const struct nios2_opcode * nios2_fetch_insn(struct gdbarch *gdbarch, CORE_ADDR pc, unsigned int *insnp)
static int nios2_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
static const char * nios2_register_name(struct gdbarch *gdbarch, int regno)
static int nios2_in_epilogue_p(struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR start_pc)
static int nios2_match_jmpi(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
static int nios2_match_callr(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra)
static void nios2_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static void nios2_store_return_value(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf)
static void nios2_init_cache(struct nios2_unwind_cache *cache, CORE_ADDR pc)
static int nios2_match_jmpr(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra)
static int nios2_get_longjmp_target(frame_info_ptr frame, CORE_ADDR *pc)
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)
static const gdb_byte * nios2_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
static int nios2_match_rdctl(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rc)
static CORE_ADDR nios2_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
static const char *const nios2_reg_names[NIOS2_NUM_REGS]
void _initialize_nios2_tdep()
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)
static CORE_ADDR nios2_frame_base_address(frame_info_ptr this_frame, void **this_cache)
static std::vector< CORE_ADDR > nios2_software_single_step(struct regcache *regcache)
static ULONGEST nios2_type_align(struct gdbarch *gdbarch, struct type *type)
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 struct trad_frame_cache * nios2_stub_frame_cache(frame_info_ptr this_frame, void **this_cache)
gdb_static_assert(ARRAY_SIZE(nios2_dwarf2gdb_regno_map)==NIOS2_NUM_REGS)
static const struct frame_unwind nios2_stub_frame_unwind
static CORE_ADDR nios2_analyze_prologue(struct gdbarch *gdbarch, const CORE_ADDR start_pc, const CORE_ADDR current_pc, struct nios2_unwind_cache *cache, frame_info_ptr this_frame)
static const struct frame_unwind nios2_frame_unwind
static struct value * nios2_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static CORE_ADDR nios2_frame_align(struct gdbarch *gdbarch, CORE_ADDR addr)
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, function_call_return_method return_method, CORE_ADDR struct_addr)
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_match_add(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, int *ra, int *rb, int *rc)
static struct gdbarch * nios2_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static struct nios2_unwind_cache * nios2_frame_unwind_cache(frame_info_ptr this_frame, void **this_prologue_cache)
static struct type * nios2_register_type(struct gdbarch *gdbarch, int regno)
static int nios2_match_trap(uint32_t insn, const struct nios2_opcode *op, unsigned long mach, unsigned int *uimm)
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)
#define NIOS2_TLBACC_REGNUM
#define NIOS2_ECCINJ_REGNUM
#define NIOS2_CPUID_REGNUM
#define NIOS2_FIRST_ARGREG
#define NIOS2_TLBMISC_REGNUM
#define NIOS2_MPUACC_REGNUM
#define NIOS2_STATUS_REGNUM
#define NIOS2_IENABLE_REGNUM
#define NIOS2_BADADDR_REGNUM
#define NIOS2_CONFIG_REGNUM
#define NIOS2_ESTATUS_REGNUM
#define NIOS2_MPUBASE_REGNUM
#define NIOS2_LAST_ARGREG
#define NIOS2_CDX_OPCODE_SIZE
#define NIOS2_IPENDING_REGNUM
#define NIOS2_BSTATUS_REGNUM
#define NIOS2_EXCEPTION_REGNUM
#define NIOS2_OPCODE_SIZE
#define NIOS2_PTEADDR_REGNUM
const struct target_desc * tdesc_nios2
static void initialize_tdesc_nios2(void)
static int in_plt_section(CORE_ADDR pc)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
int register_size(struct gdbarch *gdbarch, int regnum)
void regcache_cooked_write_signed(struct regcache *regcache, int regnum, LONGEST val)
LONGEST regcache_raw_get_signed(struct regcache *regcache, int regnum)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
struct type * builtin_func_ptr
struct type * builtin_data_ptr
struct type * builtin_uint32
CORE_ADDR(* syscall_next_pc)(frame_info_ptr frame, const struct nios2_opcode *op)
bool(* is_kernel_helper)(CORE_ADDR pc)
struct reg_saved reg_saved[NIOS2_NUM_REGS]
struct reg_value reg_value[NIOS2_NUM_REGS]
frame_info_ptr this_frame
gdb::array_view< const gdb_byte > contents()
struct type * type() const
struct value::@203::@204 reg
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
tdesc_arch_data_up tdesc_data_alloc(void)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
static const registry< gdbarch >::key< tdesc_arch_data > tdesc_data
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, tdesc_arch_data_up &&early_data, tdesc_unknown_register_ftype unk_reg_cb)
int tdesc_has_registers(const struct target_desc *target_desc)
struct type * tdesc_register_type(struct gdbarch *gdbarch, int regno)
const char * tdesc_register_name(struct gdbarch *gdbarch, int regno)
std::unique_ptr< tdesc_arch_data, tdesc_arch_data_deleter > tdesc_arch_data_up
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void trad_frame_set_reg_realreg(struct trad_frame_cache *this_trad_cache, int regnum, int realreg)
struct trad_frame_cache * trad_frame_cache_zalloc(frame_info_ptr this_frame)
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
void trad_frame_set_this_base(struct trad_frame_cache *this_trad_cache, CORE_ADDR this_base)
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, frame_info_ptr this_frame, int regnum)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)