41 #include "opcode/mips.h" 83 #define ST0_FR (1 << 26) 170 #define R(n) { "r" #n, n } 171 R(0),
R(1),
R(2),
R(3),
R(4),
R(5),
R(6),
R(7),
172 R(8),
R(9),
R(10),
R(11),
R(12),
R(13),
R(14),
R(15),
173 R(16),
R(17),
R(18),
R(19),
R(20),
R(21),
R(22),
R(23),
174 R(24),
R(25),
R(26),
R(27),
R(28),
R(29),
R(30),
R(31),
193 #define R(n) { #n, n } 194 R(0),
R(1),
R(2),
R(3),
R(4),
R(5),
R(6),
R(7),
195 R(8),
R(9),
R(10),
R(11),
R(12),
R(13),
R(14),
R(15),
196 R(16),
R(17),
R(18),
R(19),
R(20),
R(21),
R(22),
R(23),
197 R(24),
R(25),
R(26),
R(27),
R(28),
R(29),
R(30),
R(31),
201 #ifndef MIPS_DEFAULT_FPU_TYPE 202 #define MIPS_DEFAULT_FPU_TYPE MIPS_FPU_DOUBLE 211 #define PROPERTY_GP32 "internal: transfers-32bit-registers" 212 #define PROPERTY_GP64 "internal: transfers-64bit-registers" 241 #define MIPS_EABI(gdbarch) (gdbarch_tdep (gdbarch)->mips_abi \ 243 || gdbarch_tdep (gdbarch)->mips_abi == MIPS_ABI_EABI64) 245 #define MIPS_LAST_FP_ARG_REGNUM(gdbarch) \ 246 (gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum) 248 #define MIPS_LAST_ARG_REGNUM(gdbarch) \ 249 (gdbarch_tdep (gdbarch)->mips_last_arg_regnum) 251 #define MIPS_FPU_TYPE(gdbarch) (gdbarch_tdep (gdbarch)->mips_fpu_type) 275 #define MAX_MIPS_ABI_REGSIZE 8 395 elf_symbol_type *elfsym = (elf_symbol_type *) sym;
396 unsigned char st_other;
398 if ((sym->flags & BSF_SYNTHETIC) == 0)
399 st_other = elfsym->internal_elf_sym.st_other;
400 else if ((sym->flags & BSF_FUNCTION) != 0)
401 st_other = sym->udata.i;
405 if (ELF_ST_IS_MICROMIPS (st_other))
410 else if (ELF_ST_IS_MIPS16 (st_other))
478 int reg_num,
int length,
479 enum bfd_endian endian,
gdb_byte *in,
480 const gdb_byte *out,
int buf_offset)
492 case BFD_ENDIAN_LITTLE:
495 case BFD_ENDIAN_UNKNOWN:
503 "xfer $%d, reg offset %d, buf offset %d, length %d, ",
509 for (i = 0; i < length; i++)
522 for (i = 0; i < length; i++)
555 #define VM_MIN_ADDRESS (CORE_ADDR)0x400000 574 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
575 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
576 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
577 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
578 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
585 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
586 "",
"",
"",
"",
"",
"",
"",
"",
587 "",
"",
"",
"",
"",
"",
"",
"",
588 "",
"",
"",
"",
"",
"",
"",
"",
589 "",
"",
"",
"",
"",
"",
"",
"",
591 "",
"",
"",
"",
"",
"",
"",
"",
592 "",
"",
"config",
"cache",
"debug",
"depc",
"epc",
597 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
598 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
599 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
600 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
601 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
612 static const char *mips_gpr_names[] = {
613 "zero",
"at",
"v0",
"v1",
"a0",
"a1",
"a2",
"a3",
614 "t0",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
615 "s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
616 "t8",
"t9",
"k0",
"k1",
"gp",
"sp",
"s8",
"ra",
620 static const char *mips_n32_n64_gpr_names[] = {
621 "zero",
"at",
"v0",
"v1",
"a0",
"a1",
"a2",
"a3",
622 "a4",
"a5",
"a6",
"a7",
"t0",
"t1",
"t2",
"t3",
623 "s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
624 "t8",
"t9",
"k0",
"k1",
"gp",
"sp",
"s8",
"ra" 647 if (0 <= rawnum && rawnum < 32)
650 return mips_n32_n64_gpr_names[rawnum];
652 return mips_gpr_names[rawnum];
665 _(
"mips_register_name: bad register number %d"), rawnum);
690 return float_p && pseudo;
692 return vector_p && pseudo;
694 return (!vector_p && !float_p) && pseudo;
699 return raw_p && pseudo;
702 return raw_p && pseudo;
867 error (
_(
"32-bit compatibility mode not supported"));
912 int *optimizedp,
int *unavailablep)
922 optimizedp, unavailablep))
926 optimizedp, unavailablep))
928 *optimizedp = *unavailablep = 0;
938 optimizedp, unavailablep))
941 *optimizedp = *unavailablep = 0;
947 _(
"mips_register_to_value: unrecognized case"));
984 if (from[len-1] & 0x80)
995 _(
"mips_value_to_register: unrecognized case"));
1002 static struct type *
1059 static struct type *
1063 int rawnum =
regnum % num_regs;
1064 struct type *rawtype;
1141 _(
"mips_mask_address_p: bad switch"));
1163 (
"The 32 bit address mask is set automatically. Currently %s\n",
1167 internal_error (__FILE__, __LINE__,
_(
"show_mask_address: bad switch"));
1316 pc = rel ? pc + addr : addr;
1318 addr = rel ? isa_pc - adj_pc : isa_pc;
1467 #define mips32_op(x) (x >> 26) 1468 #define itype_op(x) (x >> 26) 1469 #define itype_rs(x) ((x >> 21) & 0x1f) 1470 #define itype_rt(x) ((x >> 16) & 0x1f) 1471 #define itype_immediate(x) (x & 0xffff) 1473 #define jtype_op(x) (x >> 26) 1474 #define jtype_target(x) (x & 0x03ffffff) 1476 #define rtype_op(x) (x >> 26) 1477 #define rtype_rs(x) ((x >> 21) & 0x1f) 1478 #define rtype_rt(x) ((x >> 16) & 0x1f) 1479 #define rtype_rd(x) ((x >> 11) & 0x1f) 1480 #define rtype_shamt(x) ((x >> 6) & 0x1f) 1481 #define rtype_funct(x) (x & 0x3f) 1484 #define micromips_op(x) ((x) >> 10) 1488 #define b0s4_imm(x) ((x) & 0xf) 1489 #define b0s5_imm(x) ((x) & 0x1f) 1490 #define b0s5_reg(x) ((x) & 0x1f) 1491 #define b0s7_imm(x) ((x) & 0x7f) 1492 #define b0s10_imm(x) ((x) & 0x3ff) 1493 #define b1s4_imm(x) (((x) >> 1) & 0xf) 1494 #define b1s9_imm(x) (((x) >> 1) & 0x1ff) 1495 #define b2s3_cc(x) (((x) >> 2) & 0x7) 1496 #define b4s2_regl(x) (((x) >> 4) & 0x3) 1497 #define b5s5_op(x) (((x) >> 5) & 0x1f) 1498 #define b5s5_reg(x) (((x) >> 5) & 0x1f) 1499 #define b6s4_op(x) (((x) >> 6) & 0xf) 1500 #define b7s3_reg(x) (((x) >> 7) & 0x7) 1504 #define b0s6_op(x) ((x) & 0x3f) 1505 #define b0s11_op(x) ((x) & 0x7ff) 1506 #define b0s12_imm(x) ((x) & 0xfff) 1507 #define b0s16_imm(x) ((x) & 0xffff) 1508 #define b0s26_imm(x) ((x) & 0x3ffffff) 1509 #define b6s10_ext(x) (((x) >> 6) & 0x3ff) 1510 #define b11s5_reg(x) (((x) >> 11) & 0x1f) 1511 #define b12s4_op(x) (((x) >> 12) & 0xf) 1528 if ((insn & 0xf800) == 0xf000)
1553 int cnum = (
itype_rt (inst) >> 2) & (count - 1);
1555 int mask = (1 << count) - 1;
1564 cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
1566 if (((cond >> cnum) & mask) != mask * !tf)
1581 return (info->mach == bfd_mach_mips_octeon
1582 || info->mach == bfd_mach_mips_octeonp
1583 || info->mach == bfd_mach_mips_octeon2);
1597 if (op == 50 || op == 54 || op == 58 || op == 62)
1614 if ((inst & 0xe0000000) != 0)
1629 goto greater_branch;
1634 else if (op == 17 &&
itype_rs (inst) == 8)
1637 else if (op == 17 &&
itype_rs (inst) == 9
1641 else if (op == 17 &&
itype_rs (inst) == 10
1659 branch_if = op == 58 || op == 62;
1663 if (op == 54 || op == 62)
1737 unsigned int pos = (op & 2) ? 64 : 32;
1745 dspctl) & 0x7f) >= pos)
1807 return ((
b0s7_imm (insn) ^ 0x40) - 0x40) << 1;
1816 return ((
b0s10_imm (insn) ^ 0x200) - 0x200) << 1;
1825 return ((
b0s16_imm (insn) ^ 0x8000) - 0x8000) << 1;
1849 int cnum =
b2s3_cc (insn >> 16) & (count - 1);
1850 int tf =
b5s5_op (insn >> 16) & 1;
1851 int mask = (1 << count) - 1;
1860 cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
1862 if (((cond >> cnum) & mask) != mask * !tf)
1952 if (((insn >> 16) & 0x3) == 0x0)
1960 unsigned int pos = (
b5s5_op (insn >> 16) & 1) ? 32 : 64;
1968 dspctl) & 0x7f) >= pos)
1979 if (((insn >> 16) & 0x2) == 0x0)
1981 ((insn >> 16) & 0x1) + 1);
1986 if (((insn >> 16) & 0x3) == 0x1)
1995 pc = ((pc | 0x7fffffe) ^ 0x7fffffe) | (
b0s26_imm (insn) << 1);
2015 pc = ((pc | 0xfffffff) ^ 0xfffffff) | (
b0s26_imm (insn) << 2);
2025 if ((
b5s5_op (insn) & 0x1c) == 0xc)
2028 else if (
b5s5_op (insn) == 0x18)
2117 value = (extension >> 16) & 0x1f;
2119 value |= (extension >> 21) & 0x3f;
2121 value |= extension & 0x1f;
2146 unsigned int extension,
2153 switch (insn_format)
2165 value = inst & 0x7ff;
2186 value = inst & 0xff;
2190 regx = (inst >> 8) & 0x07;
2196 unsigned long value;
2197 unsigned int nexthalf;
2198 value = ((inst & 0x1f) << 5) | ((inst >> 5) & 0x1f);
2223 return pc + (
offset << 1) + 2;
2228 unsigned int extension,
unsigned int insn)
2231 int op = (insn >> 11);
2247 if ((insn >> 10) & 0x01)
2285 if (((upk.
regx == 0) && (
reg == 0))
2286 || ((upk.
regx == 1) && (
reg != 0)))
2300 upk.
regx = (insn >> 8) & 0x07;
2301 upk.
regy = (insn >> 5) & 0x07;
2302 if ((upk.
regy & 1) == 0)
2363 switch (insn & 0xf800)
2366 return (insn & 0x009f) == 0x80;
2368 return (insn & 0x0600) == 0;
2387 return (
b5s5_op (insn) == 0x18
2392 return (
b5s5_op (insn) & 0x1d) == 0x5;
2420 if (this_cache != NULL
2438 unsigned short inst,
2445 if ((prev_inst & 0xf800) == 0xf000)
2447 offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
2450 return offset | (inst & 0x1f);
2454 int max_imm = 1 << nbits;
2455 int mask = max_imm - 1;
2456 int sign_bit = max_imm >> 1;
2459 if (is_signed && (
offset & sign_bit))
2476 int prev_non_prologue_insn = 0;
2477 int this_non_prologue_insn;
2478 int non_prologue_insns = 0;
2483 long frame_offset = 0;
2484 long frame_adjust = 0;
2486 unsigned short prev_inst = 0;
2488 unsigned entry_inst = 0;
2489 unsigned save_inst = 0;
2490 int prev_delay_slot = 0;
2494 int extend_bytes = 0;
2495 int prev_extend_bytes = 0;
2500 if (this_frame != NULL)
2507 if (limit_pc > start_pc + 200)
2508 limit_pc = start_pc + 200;
2516 this_non_prologue_insn = 0;
2532 if ((inst & 0xf800) == 0xf000)
2538 prev_extend_bytes = extend_bytes;
2541 if ((inst & 0xff00) == 0x6300
2542 || (inst & 0xff00) == 0xfb00)
2553 else if ((inst & 0xf800) == 0xd000)
2559 else if ((inst & 0xff00) == 0xf900)
2565 else if ((inst & 0xff00) == 0x6200)
2570 else if ((inst & 0xff00) == 0xfa00)
2575 else if (inst == 0x673d)
2580 else if ((inst & 0xff00) == 0x0100)
2583 frame_addr = sp +
offset;
2587 else if ((inst & 0xFF00) == 0xd900)
2593 else if ((inst & 0xFF00) == 0x7900)
2599 else if ((inst & 0xf81f) == 0xe809
2600 && (inst & 0x700) != 0x700)
2602 else if ((inst & 0xff80) == 0x6480)
2605 if (prev_extend_bytes)
2606 save_inst |= prev_inst << 16;
2608 else if ((inst & 0xff1c) == 0x6704)
2628 this_non_prologue_insn = 1;
2631 non_prologue_insns += this_non_prologue_insn;
2635 if (prev_delay_slot || non_prologue_insns > 1
2639 prev_non_prologue_insn = this_non_prologue_insn;
2640 prev_delay_slot = in_delay_slot;
2641 prev_pc = cur_pc - prev_extend_bytes;
2650 if (entry_inst != 0)
2652 int areg_count = (entry_inst >> 8) & 7;
2653 int sreg_count = (entry_inst >> 6) & 3;
2671 if (entry_inst & 0x20)
2678 for (
reg = 16;
reg < sreg_count + 16;
reg++)
2693 static int args_table[16] = {
2694 0, 0, 0, 0, 1, 1, 1, 1,
2695 2, 2, 2, 0, 3, 3, 4, -1,
2697 static int astatic_table[16] = {
2698 0, 1, 2, 3, 0, 1, 2, 3,
2699 0, 1, 2, 4, 0, 1, 0, -1,
2701 int aregs = (save_inst >> 16) & 0xf;
2702 int xsregs = (save_inst >> 24) & 0x7;
2703 int args = args_table[aregs];
2704 int astatic = astatic_table[aregs];
2709 warning (
_(
"Invalid number of argument registers encoded in SAVE."));
2714 warning (
_(
"Invalid number of static registers encoded in SAVE."));
2719 frame_size = ((save_inst >> 16) & 0xf0) | (save_inst & 0xf);
2720 if (frame_size == 0 && (save_inst >> 16) == 0)
2723 frame_offset += frame_size;
2739 if (save_inst & 0x40)
2753 for (
reg = 18 + xsregs - 1;
reg > 18 - 1;
reg--)
2760 if (save_inst & 0x10)
2766 if (save_inst & 0x20)
2780 if (this_cache != NULL)
2785 + frame_offset - frame_adjust);
2798 end_prologue_addr = (prev_non_prologue_insn || prev_delay_slot
2799 ? prev_pc : cur_pc - prev_extend_bytes);
2801 return end_prologue_addr;
2814 if ((*this_cache) != NULL)
2817 (*this_cache) = cache;
2826 if (start_addr == 0)
2830 if (start_addr == 0)
2852 if (info->
base == 0)
2857 static struct value *
2859 void **this_cache,
int regnum)
2868 struct frame_info *this_frame,
void **this_cache)
2922 imm = (imm ^ 0x100) - 0x100;
2923 if (imm > -3 && imm < 2)
2938 int prev_non_prologue_insn = 0;
2940 int this_non_prologue_insn;
2941 int non_prologue_insns = 0;
2942 long frame_offset = 0;
2943 long frame_adjust = 0;
2944 int prev_delay_slot = 0;
2965 if (this_frame != NULL)
2972 if (limit_pc > start_pc + 200)
2973 limit_pc = start_pc + 200;
2979 for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc +=
loc)
2981 this_non_prologue_insn = 0;
3012 else if (op != 0x150
3016 this_non_prologue_insn = 1;
3022 reglist = sreg =
b5s5_reg (insn >> 16);
3024 if ((op == 0x9 || op == 0xc)
3030 s = 4 << ((
b12s4_op (insn) & 0x4) == 0x4);
3034 sreg + 1, sp +
offset + s);
3036 else if ((op == 0xd || op == 0xf)
3041 && ((reglist >= 1 && reglist <= 9)
3042 || (reglist >= 16 && reglist <= 25)))
3044 int sreglist = std::min(reglist & 0xf, 8);
3046 s = 4 << ((
b12s4_op (insn) & 0x2) == 0x2);
3047 for (i = 0; i < sreglist; i++)
3049 if ((reglist & 0xf) > 8)
3051 if ((reglist & 0x10) == 0x10)
3056 this_non_prologue_insn = 1;
3075 else if (sreg != 28 || dreg != 28)
3077 this_non_prologue_insn = 1;
3083 if (
b5s5_op (insn >> 16) == 0xd
3087 v1_off = ((
b0s16_imm (insn) << 16) ^ 0x80000000) - 0x80000000;
3088 else if (
b5s5_op (insn >> 16) != 0xd
3092 this_non_prologue_insn = 1;
3099 if (sreg == 3 && dreg == 3)
3103 this_non_prologue_insn = 1;
3111 this_non_prologue_insn = 1;
3123 this_non_prologue_insn = 1;
3132 this_non_prologue_insn = 1;
3148 else if ((sreg & 0x1c) != 0x4)
3150 this_non_prologue_insn = 1;
3159 for (i = 0; i <= reglist; i++)
3165 this_non_prologue_insn = 1;
3169 if ((insn & 0x1) == 0x1)
3175 sp_adj = (
b1s4_imm (insn) ^ 8) - 8;
3177 this_non_prologue_insn = 1;
3192 this_non_prologue_insn = 1;
3198 frame_offset -= sp_adj;
3200 non_prologue_insns += this_non_prologue_insn;
3205 if (prev_delay_slot || non_prologue_insns > 1 || sp_adj > 0
3209 prev_non_prologue_insn = this_non_prologue_insn;
3210 prev_delay_slot = in_delay_slot;
3214 if (this_cache != NULL)
3219 + frame_offset - frame_adjust);
3233 = prev_non_prologue_insn || prev_delay_slot ? prev_pc : cur_pc;
3235 return end_prologue_addr;
3248 if ((*this_cache) != NULL)
3252 (*this_cache) = cache;
3261 if (start_addr == 0)
3265 if (start_addr == 0)
3287 if (info->
base == 0)
3292 static struct value *
3294 void **this_cache,
int regnum)
3303 struct frame_info *this_frame,
void **this_cache)
3358 if (this_cache == NULL || this_cache->
saved_regs == NULL)
3382 int prev_non_prologue_insn;
3383 int this_non_prologue_insn;
3384 int non_prologue_insns;
3387 int prev_delay_slot;
3395 int seen_sp_adjust = 0;
3396 int load_immediate_bytes = 0;
3402 if (this_frame != NULL)
3409 if (limit_pc > start_pc + 200)
3410 limit_pc = start_pc + 200;
3413 prev_non_prologue_insn = 0;
3414 non_prologue_insns = 0;
3415 prev_delay_slot = 0;
3424 unsigned long inst, high_word;
3428 this_non_prologue_insn = 0;
3436 high_word = (inst >> 16) & 0xffff;
3437 offset = ((inst & 0xffff) ^ 0x8000) - 0x8000;
3438 reg = high_word & 0x1f;
3440 if (high_word == 0x27bd
3441 || high_word == 0x23bd
3442 || high_word == 0x67bd)
3453 else if (((high_word & 0xFFE0) == 0xafa0)
3454 && !regsize_is_64_bits)
3458 else if (((high_word & 0xFFE0) == 0xffa0)
3459 && regsize_is_64_bits)
3464 else if (high_word == 0x27be)
3467 if (
offset != frame_offset)
3468 frame_addr = sp +
offset;
3471 unsigned alloca_adjust;
3478 alloca_adjust = (unsigned) (frame_addr - (sp +
offset));
3479 if (alloca_adjust > 0)
3484 sp += alloca_adjust;
3497 else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
3502 unsigned alloca_adjust;
3508 alloca_adjust = (unsigned) (frame_addr - sp);
3509 if (alloca_adjust > 0)
3524 else if ((high_word & 0xFFE0) == 0xafc0
3525 && !regsize_is_64_bits)
3529 else if ((high_word & 0xFFE0) == 0xE7A0
3530 || (high_word & 0xF3E0) == 0xA3C0
3531 || (inst & 0xFF9F07FF) == 0x00800021
3532 || high_word == 0x3c1c
3533 || high_word == 0x279c
3534 || inst == 0x0399e021
3535 || inst == 0x033ce021
3546 else if (!seen_sp_adjust
3548 && (high_word == 0x3c01
3549 || high_word == 0x3c08
3550 || high_word == 0x3421
3551 || high_word == 0x3508
3552 || high_word == 0x3401
3553 || high_word == 0x3408
3569 this_non_prologue_insn = 1;
3572 non_prologue_insns += this_non_prologue_insn;
3576 if (prev_delay_slot || non_prologue_insns > 1)
3579 prev_non_prologue_insn = this_non_prologue_insn;
3580 prev_delay_slot = in_delay_slot;
3584 if (this_cache != NULL)
3604 = prev_non_prologue_insn || prev_delay_slot ? prev_pc : cur_pc;
3609 if (load_immediate_bytes && !seen_sp_adjust)
3610 end_prologue_addr -= load_immediate_bytes;
3612 return end_prologue_addr;
3626 if ((*this_cache) != NULL)
3630 (*this_cache) = cache;
3639 if (start_addr == 0)
3643 if (start_addr == 0)
3665 if (info->
base == 0)
3670 static struct value *
3672 void **this_cache,
int regnum)
3681 struct frame_info *this_frame,
void **this_cache)
3736 if ((*this_cache) != NULL)
3739 (*this_cache) = this_trad_cache;
3758 return this_trad_cache;
3770 static struct value *
3772 void **this_cache,
int regnum)
3864 return addr &= 0xffffffffUL;
3877 #define LL_OPCODE 0x30 3878 #define LLD_OPCODE 0x34 3879 #define SC_OPCODE 0x38 3880 #define SCD_OPCODE 0x3c 3882 static std::vector<CORE_ADDR>
3891 int last_breakpoint = 0;
3892 const int atomic_sequence_length = 16;
3901 for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count)
3948 if (last_breakpoint >= 1)
3951 breaks[1] = branch_bp;
3970 if (last_breakpoint &&
pc <= breaks[1] && breaks[1] <= breaks[0])
3971 last_breakpoint = 0;
3973 std::vector<CORE_ADDR> next_pcs;
3976 for (index = 0; index <= last_breakpoint; index++)
3977 next_pcs.push_back (breaks[index]);
3982 static std::vector<CORE_ADDR>
3986 const int atomic_sequence_length = 16;
3987 int last_breakpoint = 0;
4004 if ((
b12s4_op (insn) & 0xb) != 0x3)
4011 for (insn_count = 0;
4012 !sc_found && insn_count < atomic_sequence_length;
4030 if ((
b5s5_op (insn) & 0x18) != 0x0
4033 && (
b5s5_op (insn) & 0x1d) != 0x11
4035 && ((
b5s5_op (insn) & 0x1e) != 0x14
4036 || (insn & 0x3) != 0x0)
4038 && (
b5s5_op (insn) & 0x1e) != 0x1a
4040 && ((
b5s5_op (insn) & 0x1e) != 0x1c
4041 || (insn & 0x3) != 0x0)
4043 && ((
b5s5_op (insn) & 0x1c) != 0x1c
4044 || (insn & 0x3) != 0x1))
4078 if ((
b12s4_op (insn) & 0xb) == 0xb)
4097 if ((
b5s5_op (insn) & 0x1c) != 0xc
4111 if (last_breakpoint >= 1)
4114 breaks[1] = branch_bp;
4126 if (last_breakpoint &&
pc <= breaks[1] && breaks[1] <= breaks[0])
4127 last_breakpoint = 0;
4129 std::vector<CORE_ADDR> next_pcs;
4132 for (index = 0; index <= last_breakpoint; index++)
4133 next_pcs.push_back (breaks[index]);
4138 static std::vector<CORE_ADDR>
4154 std::vector<CORE_ADDR>
4163 if (!next_pcs.empty ())
4186 return (insn & ~hint) == 0x3e00008;
4217 for (start_pc -= instlen;; start_pc -= instlen)
4218 if (start_pc < fence)
4226 static int blurb_printed = 0;
4228 warning (
_(
"GDB can't find the start of the function at %s."),
4240 GDB is unable to find the start of the function at %s\n\ 4241 and thus can't determine the size of that function's stack frame.\n\ 4242 This means that GDB may be unable to access that stack frame, or\n\ 4243 the frames below it.\n\ 4244 This problem is most likely caused by an invalid program counter or\n\ 4246 However, if you think GDB should simply search farther back\n\ 4247 from %s for code which looks like the beginning of a\n\ 4248 function, you can increase the range of the search using the `set\n\ 4249 heuristic-fence-post' command.\n",
4259 unsigned short inst;
4270 if ((inst & 0xff80) == 0x6480)
4272 if (start_pc - instlen >= fence)
4275 start_pc - instlen, NULL);
4276 if ((inst & 0xf800) == 0xf000)
4277 start_pc -= instlen;
4281 else if (((inst & 0xf81f) == 0xe809
4282 && (inst & 0x700) != 0x700)
4283 || (inst & 0xff80) == 0x6380
4284 || (inst & 0xff80) == 0xfb80
4285 || ((inst & 0xf810) == 0xf010 && seen_adjsp))
4287 else if ((inst & 0xff00) == 0x6300
4288 || (inst & 0xff00) == 0xfb00)
4332 if ((insn & 0x1) == 0x1)
4378 struct type *arg_type)
4411 for (i = 0; i < n; i++)
4436 static gdb_byte nop_insn[] = { 0, 0, 0, 0 };
4441 bp_slot = sp -
sizeof (nop_insn);
4456 nop_addr = bp_slot -
sizeof (nop_insn);
4476 int stack_offset = 0;
4501 for (argnum = 0; argnum < nargs; argnum++)
4507 "mips_eabi_push_dummy_call: sp=%s allocated %ld\n",
4519 "mips_eabi_push_dummy_call: " 4520 "struct_return reg=%d %s\n",
4528 for (argnum = 0; argnum < nargs; argnum++)
4534 struct value *arg = args[argnum];
4541 "mips_eabi_push_dummy_call: %d len=%d type=%d",
4542 argnum + 1, len, (
int) typecode);
4546 if (len > abi_regsize
4549 gdb_assert (abi_regsize <= ARRAY_SIZE (ref_valbuf));
4568 if ((float_argreg & 1))
4595 == BFD_ENDIAN_BIG ? 4 : 0;
4603 float_argreg,
phex (regval, 4));
4611 float_argreg,
phex (regval, 4));
4623 float_argreg,
phex (regval, len));
4637 int odd_sized_struct = (len > abi_regsize && len % abi_regsize != 0);
4644 int stack_used_p = 0;
4645 int partial_len = (len < abi_regsize ? len : abi_regsize);
4658 int longword_offset = 0;
4663 if (abi_regsize == 8
4667 longword_offset = abi_regsize - len;
4671 longword_offset = abi_regsize - len;
4682 addr = sp + stack_offset + longword_offset;
4689 for (i = 0; i < partial_len; i++)
4712 phex (regval, abi_regsize));
4727 stack_offset +=
align_up (partial_len, abi_regsize);
4748 int fp_return_type = 0;
4828 struct type *field_type;
4870 int stack_offset = 0;
4892 for (argnum = 0; argnum < nargs; argnum++)
4898 "mips_n32n64_push_dummy_call: sp=%s allocated %ld\n",
4910 "mips_n32n64_push_dummy_call: " 4911 "struct_return reg=%d %s\n",
4919 for (argnum = 0; argnum < nargs; argnum++)
4922 struct value *arg = args[argnum];
4929 "mips_n32n64_push_dummy_call: %d len=%d type=%d",
4930 argnum + 1, len, (
int) typecode);
4938 && (float_argreg & 1))
4953 float_argreg,
phex (regval, reglen));
4958 argreg,
phex (regval, reglen));
4965 reglen, byte_order);
4968 float_argreg,
phex (regval, reglen));
4973 argreg,
phex (regval, reglen));
4997 int stack_used_p = 0;
5012 int longword_offset = 0;
5031 addr = sp + stack_offset + longword_offset;
5038 for (i = 0; i < partial_len; i++)
5059 if ((partial_len == 4
5175 readbuf, writebuf, 0);
5180 readbuf ? readbuf + 8 : readbuf,
5181 writebuf ? writebuf + 8 : writebuf, 0);
5195 readbuf, writebuf, 0);
5233 readbuf, writebuf,
offset);
5238 readbuf, writebuf,
offset + 8);
5245 readbuf, writebuf,
offset);
5270 xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
5294 readbuf, writebuf,
offset);
5326 int stack_offset = 0;
5348 for (argnum = 0; argnum < nargs; argnum++)
5362 "mips_o32_push_dummy_call: sp=%s allocated %ld\n",
5374 "mips_o32_push_dummy_call: " 5375 "struct_return reg=%d %s\n",
5384 for (argnum = 0; argnum < nargs; argnum++)
5387 struct value *arg = args[argnum];
5394 "mips_o32_push_dummy_call: %d len=%d type=%d",
5395 argnum + 1, len, (
int) typecode);
5406 if ((float_argreg & 1))
5427 == BFD_ENDIAN_BIG ? 1 : 0;
5428 unsigned long regval;
5434 float_argreg + freg_offset,
5437 float_argreg++ + freg_offset,
5441 argreg,
phex (regval, 4));
5448 float_argreg - freg_offset,
5451 float_argreg++ - freg_offset,
5455 argreg,
phex (regval, 4));
5467 float_argreg,
phex (regval, len));
5469 float_argreg++, regval);
5475 argreg,
phex (regval, len));
5513 || odd_sized_struct)
5517 int longword_offset = 0;
5528 addr = sp + stack_offset + longword_offset;
5535 for (i = 0; i < partial_len; i++)
5666 readbuf, writebuf, 0);
5672 readbuf, writebuf, 0);
5696 "Return float in $fp1/$fp0 and $2/$3\n");
5705 case BFD_ENDIAN_LITTLE:
5710 readbuf, writebuf, 0);
5715 readbuf, writebuf, 4);
5717 case BFD_ENDIAN_BIG:
5722 readbuf, writebuf, 0);
5727 readbuf, writebuf, 4);
5740 readbuf, writebuf, 0);
5744 readbuf, writebuf, 4);
5779 readbuf, writebuf,
offset);
5805 BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
offset);
5830 readbuf, writebuf,
offset);
5850 int stack_offset = 0;
5872 for (argnum = 0; argnum < nargs; argnum++)
5883 "mips_o64_push_dummy_call: sp=%s allocated %ld\n",
5895 "mips_o64_push_dummy_call: " 5896 "struct_return reg=%d %s\n",
5905 for (argnum = 0; argnum < nargs; argnum++)
5908 struct value *arg = args[argnum];
5915 "mips_o64_push_dummy_call: %d len=%d type=%d",
5916 argnum + 1, len, (
int) typecode);
5936 float_argreg,
phex (regval, len));
5940 argreg,
phex (regval, len));
5967 || odd_sized_struct)
5971 int longword_offset = 0;
5990 addr = sp + stack_offset + longword_offset;
5997 for (i = 0; i < partial_len; i++)
6110 readbuf, writebuf, 0);
6116 readbuf, writebuf, 0);
6138 readbuf, writebuf,
offset);
6186 error (
_(
"can't read register %d (%s)"),
6199 memcpy (rare_buffer, raw_buffer +
offset, 4);
6203 memcpy (rare_buffer, raw_buffer, 4);
6223 error (
_(
"can't read register %d (%s)"),
6232 _(
"mips_read_fp_register_double: bad access to " 6233 "odd-numbered FP register"));
6354 if (
flags & (1 << 0))
6356 if (
flags & (1 << 1))
6358 if (
flags & (1 << 2))
6360 if (
flags & (1 << 3))
6362 if (
flags & (1 << 4))
6364 if (
flags & (1 << 5))
6396 if (fcs & (1 << 23))
6398 for (i = 1; i <= 7; i++)
6399 if (fcs & (1 << (24 + i)))
6405 fputs (
"mask :", stdout);
6407 fputs (
"flags :", stdout);
6420 if (fcs & (1 << 21))
6422 if (fcs & (1 << 22))
6424 if (fcs & (1 << 24))
6426 if ((fcs & (0xb << 21)) == 0)
6467 for (col = 0,
regnum = start_regnum;
6506 for (col = 0,
regnum = start_regnum;
6526 :
"<unavailable>"));
6565 error (
_(
"Not a valid register for the current processor type"));
6639 if (post_prologue_pc != 0)
6640 return std::max (pc, post_prologue_pc);
6651 limit_pc = pc + 100;
6674 if (addr < func_addr + 4)
6675 addr = func_addr + 4;
6681 unsigned long high_word;
6685 high_word = (inst >> 16) & 0xffff;
6687 if (high_word != 0x27bd
6688 && high_word != 0x67bd
6689 && inst != 0x03e00008
6690 && inst != 0x00000000)
6719 addr = func_end - 12;
6721 if (addr < func_addr + 2)
6722 addr = func_addr + 2;
6726 for (; pc < func_end; pc +=
loc)
6764 if (sreg == 0 && dreg == 0)
6781 if ((insn & 0x1) == 0x1
6809 if (addr < func_addr + 4)
6810 addr = func_addr + 4;
6816 unsigned short inst;
6820 if ((inst & 0xf800) == 0xf000)
6866 (
"\"set mips\" must be followed by an appropriate subcommand.\n");
6880 (
"The MIPS floating-point coprocessor is unknown " 6881 "because the current architecture is not MIPS.\n");
6888 fpu =
"single-precision";
6891 fpu =
"double-precision";
6894 fpu =
"absent (none)";
6901 "is set automatically (currently %s)\n",
6905 (
"The MIPS floating-point coprocessor is assumed to be %s\n", fpu);
6913 "\"single\",\"none\" or \"auto\".\n");
6987 info->mach = bfd_mach_mips16;
6989 info->mach = bfd_mach_mips_micromips;
6992 memaddr &= (info->mach == bfd_mach_mips16
6993 || info->mach == bfd_mach_mips_micromips) ? ~1 : ~3;
6996 if (!info->disassembler_options)
7012 info->disassembler_options =
"gpr-names=n32";
7013 info->flavour = bfd_target_elf_flavour;
7023 info->disassembler_options =
"gpr-names=64";
7024 info->flavour = bfd_target_elf_flavour;
7068 static gdb_byte mips16_big_breakpoint[] = { 0xe8, 0xa5 };
7069 static gdb_byte mips16_little_breakpoint[] = { 0xa5, 0xe8 };
7073 return mips16_big_breakpoint;
7075 return mips16_little_breakpoint;
7079 static gdb_byte micromips16_big_breakpoint[] = { 0x46, 0x85 };
7080 static gdb_byte micromips16_little_breakpoint[] = { 0x85, 0x46 };
7085 return micromips16_big_breakpoint;
7087 return micromips16_little_breakpoint;
7091 static gdb_byte micromips32_big_breakpoint[] = { 0, 0x5, 0, 0x7 };
7092 static gdb_byte micromips32_little_breakpoint[] = { 0x5, 0, 0x7, 0 };
7096 return micromips32_big_breakpoint;
7098 return micromips32_little_breakpoint;
7128 if ((inst & 0xe0000000) != 0)
7138 || (rs == 9 && (rt & 0x2) == 0)
7140 || (rs == 10 && (rt & 0x2) == 0))));
7154 return ((rt & 0xc) == 0
7157 || ((rt & 0x1e) == 0x1c && rs == 0));
7204 || (
b5s5_op (major) & 0x1e) == 0xe)));
7215 return ((
b5s5_op (major) & 0x1c) == 0x0
7217 || (
b5s5_op (major) & 0x1d) == 0x4
7219 || (
b5s5_op (major) & 0x1d) == 0x11
7221 || ((
b5s5_op (major) & 0x1e) == 0x14
7222 && (major & 0x3) == 0x0)
7224 || (
b5s5_op (major) & 0x1e) == 0x1a
7226 || ((
b5s5_op (major) & 0x1e) == 0x1c
7227 && (major & 0x3) == 0x0)
7229 || ((
b5s5_op (major) & 0x1c) == 0x1c
7230 && (major & 0x3) == 0x1));
7233 return (
b0s6_op (insn) == 0x3c
7278 if ((inst & 0xf89f) == 0xe800)
7280 return (inst & 0xf800) == 0x1800;
7291 unsigned short insn;
7314 switch (bpaddr >> ((
sizeof (
CORE_ADDR) << 3) - 2) & 3)
7317 if (bpaddr == (bfd_signed_vma) (int32_t) bpaddr)
7329 else if (bpaddr & 0x80000000)
7334 return bpaddr & mask;
7381 && func_addr > boundary && func_addr <= bpaddr)
7382 boundary = func_addr;
7386 if (bpaddr == boundary)
7391 prev_addr = bpaddr - 4;
7417 for (i = 1; i < 4; i++)
7422 if (i == 1 && insn_at_pc_has_delay_slot (
gdbarch, addr, 0))
7427 else if (i > 1 && insn_at_pc_has_delay_slot (
gdbarch, addr, 1))
7480 return zero && suffix[1] ==
'\0';
7482 return suffix[1] ==
'\0' || (suffix[1] ==
'0' && suffix[2] ==
'\0');
7487 return suffix[1] ==
'\0';
7499 return ((mode[0] ==
's' || mode[0] ==
'd')
7500 && (mode[1] ==
'f' || mode[1] ==
'c'));
7569 status == 0 && target_pc == 0 && i < 20;
7588 else if (rs == addrreg)
7607 target_pc += ((pc + 4) & ~(
CORE_ADDR) 0x0fffffff);
7618 else if (rt == addrreg)
7643 memset (buf, 0,
sizeof (buf));
7695 &&
name[prefixlen + 2] ==
'\0')
7715 &&
name[prefixlen + 2] ==
'_' 7718 if (pc == start_addr)
7738 if (pc == start_addr)
7770 if (pc != start_addr
7773 &&
name[prefixlen + 2] ==
'_' 7780 if (pc != start_addr
7796 &&
name[prefixlen + 2] ==
'\0')
7814 int32_t stub_words[4];
7835 for (i = 0; i < 4; i++)
7847 if ((stub_words[0] & 0xffff0000U) == 0x3c190000
7848 && (stub_words[1] & 0xfc000000U) == 0x08000000
7849 && (stub_words[2] & 0xffff0000U) == 0x27390000
7850 && stub_words[3] == 0x00000000)
7851 return ((((stub_words[0] & 0x0000ffff) << 16)
7852 + (stub_words[2] & 0x0000ffff)) ^ 0x8000) - 0x8000;
7882 while (pc != target_pc);
7884 return pc != requested_pc ? pc : 0;
7894 if (num >= 0 && num < 32)
7896 else if (num >= 38 && num < 70)
7917 if (num >= 0 && num < 32)
7919 else if (num >= 32 && num < 64)
7979 const char *
name = bfd_get_section_name (abfd, sect);
7987 if (strcmp (
name,
".mdebug.abi32") == 0)
7989 else if (strcmp (
name,
".mdebug.abiN32") == 0)
7991 else if (strcmp (
name,
".mdebug.abi64") == 0)
7993 else if (strcmp (
name,
".mdebug.abiO64") == 0)
7995 else if (strcmp (
name,
".mdebug.eabi32") == 0)
7997 else if (strcmp (
name,
".mdebug.eabi64") == 0)
8006 int *lbp = (
int *) obj;
8007 const char *
name = bfd_get_section_name (abfd, sect);
8014 warning (
_(
"unrecognized .gcc_compiled_longXX"));
8043 internal_error (__FILE__, __LINE__,
_(
"unknown compressed ISA string"));
8063 static struct value *
8066 const int *reg_p = (
const int *) baton;
8080 int elf_fpu_type = Val_GNU_MIPS_ABI_FP_ANY;
8081 const char **reg_names;
8128 static const char *
const mips_gprs[] = {
8129 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
8130 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
8131 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
8132 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31" 8134 static const char *
const mips_fprs[] = {
8135 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
8136 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
8137 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
8138 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
8145 "org.gnu.gdb.mips.cpu");
8146 if (feature == NULL)
8171 "org.gnu.gdb.mips.cp0");
8172 if (feature == NULL)
8195 "org.gnu.gdb.mips.fpu");
8196 if (feature == NULL)
8203 for (i = 0; i < 32; i++)
8226 "org.gnu.gdb.mips.dsp");
8228 if (feature != NULL)
8233 dspacc + i++,
"hi1");
8235 dspacc + i++,
"lo1");
8237 dspacc + i++,
"hi2");
8239 dspacc + i++,
"lo2");
8241 dspacc + i++,
"hi3");
8243 dspacc + i++,
"lo3");
8267 if (info.
abfd && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour)
8268 elf_flags = elf_elfheader (info.
abfd)->e_flags;
8269 else if (arches != NULL)
8275 "mips_gdbarch_init: elf_flags = 0x%08x\n", elf_flags);
8278 switch ((elf_flags & EF_MIPS_ABI))
8280 case E_MIPS_ABI_O32:
8283 case E_MIPS_ABI_O64:
8286 case E_MIPS_ABI_EABI32:
8289 case E_MIPS_ABI_EABI64:
8293 if ((elf_flags & EF_MIPS_ABI2))
8316 case bfd_mach_mips3900:
8319 case bfd_mach_mips4100:
8320 case bfd_mach_mips5000:
8323 case bfd_mach_mips8000:
8324 case bfd_mach_mips10000:
8328 if (info.
abfd != NULL
8329 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour
8330 && elf_elfheader (info.
abfd)->e_ident[EI_CLASS] == ELFCLASS64)
8340 && info.
abfd != NULL
8341 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour
8342 && elf_elfheader (info.
abfd)->e_ident[EI_CLASS] == ELFCLASS64)
8368 if ((elf_flags & EF_MIPS_ARCH_ASE_MICROMIPS) != 0
8369 && (elf_flags & EF_MIPS_ARCH_ASE_M16) == 0)
8371 else if ((elf_flags & EF_MIPS_ARCH_ASE_M16) != 0
8372 && (elf_flags & EF_MIPS_ARCH_ASE_MICROMIPS) == 0)
8381 "mips_gdbarch_init: " 8382 "mips64_transfers_32bit_regs_p = %d\n",
8388 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour)
8389 elf_fpu_type = bfd_elf_get_obj_attr_int (info.
abfd, OBJ_ATTR_GNU,
8390 Tag_GNU_MIPS_ABI_FP);
8395 else if (elf_fpu_type != Val_GNU_MIPS_ABI_FP_ANY)
8397 switch (elf_fpu_type)
8399 case Val_GNU_MIPS_ABI_FP_DOUBLE:
8402 case Val_GNU_MIPS_ABI_FP_SINGLE:
8405 case Val_GNU_MIPS_ABI_FP_SOFT:
8416 case bfd_mach_mips3900:
8417 case bfd_mach_mips4100:
8418 case bfd_mach_mips4111:
8419 case bfd_mach_mips4120:
8422 case bfd_mach_mips4650:
8429 else if (arches != NULL)
8435 "mips_gdbarch_init: fpu_type = %d\n", fpu_type);
8632 if (info.
abfd != NULL)
8843 const char *ignored_value)
8848 "The MIPS ABI is unknown because the current architecture " 8859 "The MIPS ABI is set automatically (currently \"%s\").\n",
8861 else if (global_abi == actual_abi)
8864 "The MIPS ABI is assumed to be \"%s\" (due to user setting).\n",
8870 "The (auto detected) MIPS ABI \"%s\" is in use " 8871 "even though the user setting was \"%s\".\n",
8912 int ef_mips_32bitmode;
8933 ef_mips_32bitmode = (tdep->
elf_flags & EF_MIPS_32BITMODE);
8935 "mips_dump_tdep: tdep->elf_flags = 0x%x\n",
8938 "mips_dump_tdep: ef_mips_32bitmode = %d\n",
8941 "mips_dump_tdep: ef_mips_arch = %d\n",
8944 "mips_dump_tdep: tdep->mips_abi = %d (%s)\n",
8948 "mips_mask_address_p() %d (default %d)\n",
8953 "mips_dump_tdep: MIPS_DEFAULT_FPU_TYPE = %d (%s)\n",
8959 "mips_dump_tdep: MIPS_FPU_TYPE = %d (%s)\n",
8972 internal_error (__FILE__, __LINE__,
_(
"mips_abi_strings out of sync"));
8988 _(
"Various MIPS specific commands."),
8992 _(
"Various MIPS specific commands."),
8998 Set the MIPS ABI used by this program."),
_(
"\ 8999 Show the MIPS ABI used by this program."),
_(
"\ 9000 This option can be set to one of:\n\ 9001 auto - the default ABI associated with the current binary\n\ 9018 Set the compressed ISA encoding used by MIPS code."),
_(
"\ 9019 Show the compressed ISA encoding used by MIPS code."),
_(
"\ 9020 Select the compressed ISA encoding used in functions that have no symbol\n\ 9021 information available. The encoding can be set to either of:\n\ 9024 and is updated automatically from ELF file flags if available."),
9033 _(
"Set use of MIPS floating-point coprocessor."),
9034 &mipsfpulist,
"set mipsfpu ", 0, &
setlist);
9036 _(
"Select single-precision MIPS floating-point coprocessor."),
9039 _(
"Select double-precision MIPS floating-point coprocessor."),
9045 _(
"Select no MIPS floating-point coprocessor."), &mipsfpulist);
9050 _(
"Select MIPS floating-point coprocessor automatically."),
9053 _(
"Show current use of MIPS floating-point coprocessor target."),
9061 Set the distance searched for the start of a function."),
_(
"\ 9062 Show the distance searched for the start of a function."),
_(
"\ 9063 If you are debugging a stripped executable, GDB needs to search through the\n\ 9064 program for the start of a function. This command sets the distance of the\n\ 9065 search. The only need to set it is when debugging a stripped executable."),
9075 Set zeroing of upper 32 bits of 64-bit addresses."),
_(
"\ 9076 Show zeroing of upper 32 bits of 64-bit addresses."),
_(
"\ 9077 Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to\n\ 9078 allow GDB to determine the correct value."),
9086 Set compatibility with 64-bit MIPS target that transfers 32-bit quantities."),
9088 Show compatibility with 64-bit MIPS target that transfers 32-bit quantities."),
9090 Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\ 9091 that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\ 9092 64 bits for others. Use \"off\" to disable compatibility mode"),
9102 Set mips debugging."),
_(
"\ 9103 Show mips debugging."),
_(
"\ 9104 When non-zero, mips specific debugging is enabled."),
struct gdbarch * target_gdbarch(void)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
static void mips_insn16_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
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_have_nonsteppable_watchpoint(struct gdbarch *gdbarch, int have_nonsteppable_watchpoint)
static CORE_ADDR mips_segment_boundary(CORE_ADDR bpaddr)
void set_gdbarch_value_to_register(struct gdbarch *gdbarch, gdbarch_value_to_register_ftype value_to_register)
static int gdb_print_insn_mips_n64(bfd_vma memaddr, struct disassemble_info *info)
static int mips_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
static void mips_print_registers_info(struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
static const char * mips_fpu_type_str(enum mips_fpu_type fpu_type)
static const char mips_compression_mips16[]
static struct type * mips_pseudo_register_type(struct gdbarch *gdbarch, int regnum)
static int mips16_insn_at_pc_has_delay_slot(struct gdbarch *gdbarch, CORE_ADDR addr, int mustbe32)
CORE_ADDR(* syscall_next_pc)(struct frame_info *frame)
static CORE_ADDR micromips_scan_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct frame_info *this_frame, struct mips_frame_cache *this_cache)
static void show_mask_address(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
const struct register_alias mips_o32_aliases[]
static struct value * mips_stub_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static int fp_register_arg_p(struct gdbarch *gdbarch, enum type_code typecode, struct type *arg_type)
ULONGEST regcache_raw_get_unsigned(struct regcache *regcache, int regnum)
int mips_pc_is_micromips(struct gdbarch *gdbarch, CORE_ADDR memaddr)
static CORE_ADDR mips32_bc1_pc(struct gdbarch *gdbarch, struct regcache *regcache, ULONGEST inst, CORE_ADDR pc, int count)
static int mips_insn16_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
enum breakpoint_here breakpoint_here_p(const address_space *aspace, CORE_ADDR pc)
static void show_mips_command(const char *args, int from_tty)
int tdesc_register_in_reggroup_p(struct gdbarch *gdbarch, int regno, struct reggroup *reggroup)
static int mips_dwarf_dwarf2_ecoff_reg_to_regnum(struct gdbarch *gdbarch, int num)
CORE_ADDR get_frame_address_in_block(struct frame_info *this_frame)
std::string target_float_to_string(const gdb_byte *addr, const struct type *type, const char *format)
static int print_gp_register_row(struct ui_file *file, struct frame_info *frame, int start_regnum)
struct type * builtin_func_ptr
static void mips_register_g_packet_guesses(struct gdbarch *gdbarch)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
static CORE_ADDR mips_n32n64_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)
#define MIPS_LAST_ARG_REGNUM(gdbarch)
CORE_ADDR get_frame_pc(struct frame_info *frame)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
#define MSYMBOL_LINKAGE_NAME(symbol)
struct frame_info * get_current_frame(void)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
void ax_reg_mask(struct agent_expr *ax, int reg)
struct value * trad_frame_get_prev_register(struct frame_info *this_frame, struct trad_frame_saved_reg this_saved_regs[], int regnum)
#define itype_immediate(x)
void set_gdbarch_make_symbol_special(struct gdbarch *gdbarch, gdbarch_make_symbol_special_ftype make_symbol_special)
static int mips_single_step_through_delay(struct gdbarch *gdbarch, struct frame_info *frame)
static const struct frame_base mips_micro_frame_base
void add_setshow_auto_boolean_cmd(const char *name, enum command_class theclass, enum auto_boolean *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)
CORE_ADDR mips_unmake_compact_addr(CORE_ADDR addr)
void set_tdesc_pseudo_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *pseudo_type)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
void warning(const char *fmt,...)
int fputc_filtered(int c, struct ui_file *stream)
LONGEST value_embedded_offset(const struct value *value)
void trad_frame_set_value(struct trad_frame_saved_reg this_saved_regs[], int regnum, LONGEST val)
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)
#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value)
void set_gdbarch_write_pc(struct gdbarch *gdbarch, gdbarch_write_pc_ftype write_pc)
void set_gdbarch_addr_bits_remove(struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype addr_bits_remove)
static const struct frame_base mips_stub_frame_base
const char ** mips_processor_reg_names
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
static CORE_ADDR unmake_compact_addr(CORE_ADDR addr)
void put_frame_register_bytes(struct frame_info *frame, int regnum, CORE_ADDR offset, int len, const gdb_byte *myaddr)
void set_gdbarch_integer_to_address(struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype integer_to_address)
static enum mips_abi global_mips_abi(void)
ULONGEST align_down(ULONGEST v, int n)
void regcache_cooked_write_signed(struct regcache *regcache, int regnum, LONGEST val)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
void get_formatted_print_options(struct value_print_options *opts, char format)
show_value_ftype deprecated_show_value_hack
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static struct mips_frame_cache * mips_insn16_frame_cache(struct frame_info *this_frame, void **this_cache)
static CORE_ADDR mips_adjust_breakpoint_address(struct gdbarch *gdbarch, CORE_ADDR bpaddr)
char * phex(ULONGEST l, int sizeof_l)
static enum mips_isa mips_pc_isa(struct gdbarch *gdbarch, CORE_ADDR memaddr)
#define SYMBOL_CLASS(symbol)
int mips_isa_regsize(struct gdbarch *gdbarch)
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
void set_gdbarch_ax_pseudo_register_collect(struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
int gdbarch_update_p(struct gdbarch_info info)
const char * tdesc_register_name(struct gdbarch *gdbarch, int regno)
static struct frame_id mips_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
static void unpack_mips16(struct gdbarch *gdbarch, CORE_ADDR pc, unsigned int extension, unsigned int inst, enum mips16_inst_fmts insn_format, struct upk_mips16 *upk)
void add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **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)
static void set_reg_offset(struct gdbarch *gdbarch, struct mips_frame_cache *this_cache, int regnum, CORE_ADDR offset)
static void set_mipsfpu_double_command(const char *args, int from_tty)
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype register_reggroup_p)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
static void mips_read_fp_register_double(struct frame_info *frame, int regno, gdb_byte *rare_buffer)
void _initialize_mips_tdep(void)
static void set_mips_command(const char *args, int from_tty)
static int mips2_fp_compat(struct frame_info *frame)
int default_mask_address_p
static const struct frame_base * mips_stub_frame_base_sniffer(struct frame_info *this_frame)
static CORE_ADDR mips32_scan_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct frame_info *this_frame, struct mips_frame_cache *this_cache)
static CORE_ADDR mips_eabi_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 int is_mips16_isa(struct gdbarch *gdbarch)
void regcache_cooked_write_part(struct regcache *regcache, int regnum, int offset, int len, const gdb_byte *buf)
constexpr gdb_byte little_breakpoint[]
static struct trad_frame_cache * mips_stub_frame_cache(struct frame_info *this_frame, void **this_cache)
static unsigned int fetch_mips_16(struct gdbarch *gdbarch, CORE_ADDR pc)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
static void set_mipsfpu_single_command(const char *args, int from_tty)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
static CORE_ADDR mips_micro_frame_base_address(struct frame_info *this_frame, void **this_cache)
struct gdbarch_list * next
#define MIPS_LAST_FP_ARG_REGNUM(gdbarch)
static enum mips_fpu_type mips_fpu_type
struct reggroup *const restore_reggroup
static CORE_ADDR mips_skip_pic_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
void ax_reg(struct agent_expr *x, int reg)
static int micromips_decode_imm9(int imm)
int gdbarch_num_regs(struct gdbarch *gdbarch)
static CORE_ADDR heuristic_proc_start(struct gdbarch *, CORE_ADDR)
struct reggroup *const all_reggroup
static int mips_in_return_stub(struct gdbarch *gdbarch, CORE_ADDR pc, const char *name)
static void print_fpu_flags(struct ui_file *file, int flags)
const struct bfd_arch_info * bfd_arch_info
static const struct frame_base * mips_insn32_frame_base_sniffer(struct frame_info *this_frame)
static int mips_fpu_type_auto
static std::vector< CORE_ADDR > deal_with_atomic_sequence(struct gdbarch *gdbarch, CORE_ADDR pc)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
#define TYPE_FIELD(thistype, n)
const struct mips_regnum * mips_regnum(struct gdbarch *gdbarch)
void set_gdbarch_single_step_through_delay(struct gdbarch *gdbarch, gdbarch_single_step_through_delay_ftype single_step_through_delay)
static int mips_convert_register_gpreg_case_p(struct gdbarch *gdbarch, int regnum, struct type *type)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
static enum mips_isa global_mips_compression(void)
void tdesc_data_cleanup(void *data_untyped)
#define TYPE_FIELD_TYPE(thistype, n)
void mips_write_pc(struct regcache *regcache, CORE_ADDR pc)
static enum return_value_convention mips_o32_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static CORE_ADDR micromips_bc1_pc(struct gdbarch *gdbarch, struct regcache *regcache, ULONGEST insn, CORE_ADDR pc, int count)
static void reinit_frame_cache_sfunc(const char *args, int from_tty, struct cmd_list_element *c)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static CORE_ADDR mips_frame_align(struct gdbarch *gdbarch, CORE_ADDR addr)
static void mips_read_fp_register_single(struct frame_info *frame, int regno, gdb_byte *rare_buffer)
void set_gdbarch_print_registers_info(struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype print_registers_info)
void set_gdbarch_elf_make_msymbol_special(struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
struct type * builtin_int32
enum gdb_osabi gdbarch_osabi(struct gdbarch *gdbarch)
#define FRAME_OBSTACK_ZALLOC(TYPE)
static CORE_ADDR mips_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static const char * mips_compression_string
void printf_filtered(const char *format,...)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static const char *const mips_abi_strings[]
static int gdb_print_insn_mips_n32(bfd_vma memaddr, struct disassemble_info *info)
const address_space * get_frame_address_space(struct frame_info *frame)
static CORE_ADDR mips_stub_frame_base_address(struct frame_info *this_frame, void **this_cache)
static void mips_value_to_register(struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from)
unsigned int mips_abi_regsize(struct gdbarch *gdbarch)
void regcache_raw_write_signed(struct regcache *regcache, int regnum, LONGEST val)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep)
static CORE_ADDR make_compact_addr(CORE_ADDR addr)
void add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned 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)
static const char mips_str_mips16_ret_stub[]
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
int gdbarch_num_pseudo_regs(struct gdbarch *gdbarch)
static const char * mips_abi_string
LONGEST frame_unwind_register_signed(struct frame_info *frame, int regnum)
static CORE_ADDR mips16_next_pc(struct regcache *regcache, CORE_ADDR pc)
void set_gdbarch_adjust_dwarf2_line(struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_line_ftype adjust_dwarf2_line)
void memory_error(enum target_xfer_status err, CORE_ADDR memaddr)
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
struct reggroup *const float_reggroup
#define MSYMBOL_VALUE_RAW_ADDRESS(symbol)
void val_print_scalar_formatted(struct type *type, LONGEST embedded_offset, struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
struct cmd_list_element * setlist
void set_gdbarch_ecoff_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
struct value * get_frame_register_value(struct frame_info *frame, int regnum)
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
static struct value * mips_insn32_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
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 int msymbol_is_mips16(struct minimal_symbol *msym)
static int mips_ax_pseudo_register_push_stack(struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
struct type * check_typedef(struct type *type)
const struct frame_base * dwarf2_frame_base_sniffer(struct frame_info *this_frame)
struct trad_frame_saved_reg * saved_regs
static void mips_stub_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct mips_frame_cache * mips_insn32_frame_cache(struct frame_info *this_frame, void **this_cache)
const gdb_byte * value_contents(struct value *value)
struct reggroup *const general_reggroup
enum register_status regcache_raw_read_part(struct regcache *regcache, int regnum, int offset, int len, gdb_byte *buf)
static struct value * mips_micro_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
void register_remote_g_packet_guess(struct gdbarch *gdbarch, int bytes, const struct target_desc *tdesc)
static void show_mips_compression(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static const char mips_str_fn_stub[]
static const char mips_compression_micromips[]
static std::vector< CORE_ADDR > mips_deal_with_atomic_sequence(struct gdbarch *gdbarch, CORE_ADDR pc)
static std::vector< CORE_ADDR > micromips_deal_with_atomic_sequence(struct gdbarch *gdbarch, CORE_ADDR pc)
static enum register_status mips_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
int field_is_static(struct field *f)
static int mips_type_needs_double_align(struct type *type)
static const struct frame_unwind mips_insn16_frame_unwind
static int mips32_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
static void mips_abi_update(const char *ignore_args, int from_tty, struct cmd_list_element *c)
struct target_desc * mips_tdesc_gp64
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static void show_mips_abi(struct ui_file *file, int from_tty, struct cmd_list_element *ignored_cmd, const char *ignored_value)
static ULONGEST mips_fetch_instruction(struct gdbarch *gdbarch, enum mips_isa isa, CORE_ADDR addr, int *errp)
static struct value * value_of_mips_user_reg(struct frame_info *frame, const void *baton)
CORE_ADDR find_solib_trampoline_target(struct frame_info *frame, CORE_ADDR pc)
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 LONGEST mips32_relative_offset(ULONGEST inst)
void add_setshow_zinteger_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)
static int mips16_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
static int mips_register_to_value(struct frame_info *frame, int regnum, struct type *type, gdb_byte *to, int *optimizedp, int *unavailablep)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
#define MSYMBOL_TARGET_FLAG_MIPS16
static int mips_ax_pseudo_register_collect(struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
void set_gdbarch_in_solib_return_trampoline(struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
struct cmd_list_element * showlist
void set_gdbarch_address_to_pointer(struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype address_to_pointer)
const gdb_byte * value_contents_all(struct value *value)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
static const char *const mips_compression_strings[]
static void mips_print_register(struct ui_file *file, struct frame_info *frame, int regnum)
static int mips_stab_reg_to_regnum(struct gdbarch *gdbarch, int num)
#define gdb_assert_not_reached(message)
int default_print_insn(bfd_vma memaddr, disassemble_info *info)
#define MSYMBOL_SIZE(msymbol)
void set_gdbarch_adjust_breakpoint_address(struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
static int mips16_get_imm(unsigned short prev_inst, unsigned short inst, int nbits, int scale, int is_signed)
void set_gdbarch_register_sim_regno(struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype register_sim_regno)
static void set_mips64_transfers_32bit_regs(const char *args, int from_tty, struct cmd_list_element *c)
static int is_branch(unsigned long inst)
static void set_mipsfpu_command(const char *args, int from_tty)
static const struct frame_base mips_insn32_frame_base
static struct cmd_list_element * showmipscmdlist
static const struct objfile_data * mips_pdr_data
static void mips_print_float_info(struct gdbarch *, struct ui_file *, struct frame_info *, const char *)
char ** disassembler_options
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
LONGEST get_frame_register_signed(struct frame_info *frame, int regnum)
static CORE_ADDR mips_adjust_dwarf2_addr(CORE_ADDR pc)
static void mips_find_abi_section(bfd *abfd, asection *sect, void *obj)
void set_gdbarch_register_to_value(struct gdbarch *gdbarch, gdbarch_register_to_value_ftype register_to_value)
int mips_last_fp_arg_regnum
static int mips_is_stub_suffix(const char *suffix, int zero)
#define MIPS_FPU_TYPE(gdbarch)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
unsigned int gdbarch_debug
const struct floatformat * floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]
static int is_compact_addr(CORE_ADDR addr)
static CORE_ADDR mips_o32_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 int mips16_instruction_is_compact_branch(unsigned short insn)
static int mips_convert_register_p(struct gdbarch *gdbarch, int regnum, struct type *type)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void ax_simple(struct agent_expr *x, enum agent_op op)
static int startswith(const char *string, const char *pattern)
void set_gdbarch_read_pc(struct gdbarch *gdbarch, gdbarch_read_pc_ftype read_pc)
struct trad_frame_cache * trad_frame_cache_zalloc(struct frame_info *this_frame)
void set_gdbarch_pointer_to_address(struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype pointer_to_address)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
static const struct frame_base mips_insn16_frame_base
static int mips_about_to_return(struct gdbarch *gdbarch, CORE_ADDR pc)
static int msymbol_is_micromips(struct minimal_symbol *msym)
static enum return_value_convention mips_n32n64_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
int fp_implementation_revision
static void mips_make_symbol_special(struct symbol *sym, struct objfile *objfile)
void set_gdbarch_ax_pseudo_register_push_stack(struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
static void mips_find_long_section(bfd *abfd, asection *sect, void *obj)
void printf_unfiltered(const char *format,...)
struct cmd_list_element * setdebuglist
#define TYPE_FIELDS(thistype)
static int mips_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
enum mips_fpu_type mips_fpu_type
#define MIPS_DEFAULT_FPU_TYPE
static int mips_micro_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static int is_mips16_addr(struct gdbarch *gdbarch, CORE_ADDR addr)
struct reggroup *const vector_reggroup
const struct register_alias mips_register_aliases[]
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
int mips_pc_is_mips(CORE_ADDR memaddr)
void set_tdesc_property(struct target_desc *target_desc, const char *key, const char *value)
const struct register_alias mips_n32_n64_aliases[]
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype breakpoint_kind_from_pc)
struct trad_frame_saved_reg * trad_frame_alloc_saved_regs(struct gdbarch *gdbarch)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
static CORE_ADDR mips_insn32_frame_base_address(struct frame_info *this_frame, void **this_cache)
#define TYPE_FIELD_BITPOS(thistype, n)
struct frame_info * this_frame
static const struct frame_base * mips_insn16_frame_base_sniffer(struct frame_info *this_frame)
static CORE_ADDR mips_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
static void mips_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
static struct mips_frame_cache * mips_micro_frame_cache(struct frame_info *this_frame, void **this_cache)
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *old, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
static int print_fp_register_row(struct ui_file *file, struct frame_info *frame, int regnum)
void put_frame_register(struct frame_info *frame, int regnum, const gdb_byte *buf)
struct type * gdbarch_register_type(struct gdbarch *gdbarch, int reg_nr)
void set_gdbarch_adjust_dwarf2_addr(struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_addr_ftype adjust_dwarf2_addr)
static int mips_float_register_p(struct gdbarch *gdbarch, int regnum)
const struct target_desc * target_desc
static const struct frame_unwind mips_stub_frame_unwind
void address_to_signed_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
static CORE_ADDR mips_skip_mips16_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
void set_gdbarch_push_dummy_code(struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype push_dummy_code)
static struct gdbarch * mips_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static const struct frame_unwind mips_insn32_frame_unwind
static CORE_ADDR extended_mips16_next_pc(regcache *regcache, CORE_ADDR pc, unsigned int extension, unsigned int insn)
static const struct frame_unwind mips_micro_frame_unwind
void regcache_raw_write_part(struct regcache *regcache, int regnum, int offset, int len, const gdb_byte *buf)
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, struct tdesc_arch_data *early_data)
constexpr gdb_byte big_breakpoint[]
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
static int msymbol_is_mips(struct minimal_symbol *msym)
int value_entirely_available(struct value *value)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
static CORE_ADDR mips_next_pc(struct regcache *regcache, CORE_ADDR pc)
static int micromips_instruction_has_delay_slot(ULONGEST insn, int mustbe32)
void set_gdbarch_pseudo_register_read(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype pseudo_register_read)
ULONGEST align_up(ULONGEST v, int n)
static int mips_insn_size(enum mips_isa isa, ULONGEST insn)
int value_optimized_out(struct value *value)
struct type * builtin_double
#define MAX_MIPS_ABI_REGSIZE
static int mips_stub_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
void set_gdbarch_convert_register_p(struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype convert_register_p)
static const char mips_str_mips16_call_stub[]
int deprecated_frame_register_read(struct frame_info *frame, int regnum, gdb_byte *myaddr)
int frame_relative_level(struct frame_info *fi)
#define SYMBOL_BLOCK_VALUE(symbol)
#define TYPE_CODE(thistype)
struct value * value_of_register(int regnum, struct frame_info *frame)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
const struct mips_regnum * regnum
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
static void set_mipsfpu_auto_command(const char *args, int from_tty)
void gdbarch_info_init(struct gdbarch_info *info)
static int mips_convert_register_float_case_p(struct gdbarch *gdbarch, int regnum, struct type *type)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
static int gdb_print_insn_mips(bfd_vma memaddr, struct disassemble_info *info)
static CORE_ADDR extended_offset(unsigned int extension)
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)
enum mips_abi mips_abi(struct gdbarch *gdbarch)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
struct minimal_symbol * minsym
int mips64_transfers_32bit_regs_p
static void mips_insn32_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static const char * mips_generic_reg_names[NUM_MIPS_PROCESSOR_REGS]
static int micromips_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
static struct type * mips_register_type(struct gdbarch *gdbarch, int regnum)
static const char mips_str_call_stub[]
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)
static const char * mips_tx39_reg_names[NUM_MIPS_PROCESSOR_REGS]
int register_size_valid_p
void set_gdbarch_virtual_frame_pointer(struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
void set_gdbarch_print_float_info(struct gdbarch *gdbarch, gdbarch_print_float_info_ftype print_float_info)
void get_frame_register(struct frame_info *frame, int regnum, gdb_byte *buf)
static CORE_ADDR mips_integer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
#define TYPE_NFIELDS(thistype)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
static void mips_virtual_frame_pointer(struct gdbarch *gdbarch, CORE_ADDR pc, int *reg, LONGEST *offset)
int read_frame_register_unsigned(struct frame_info *frame, int regnum, ULONGEST *val)
CORE_ADDR signed_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
static int micromips_insn_at_pc_has_delay_slot(struct gdbarch *gdbarch, CORE_ADDR addr, int mustbe32)
static int mips_fpa0_regnum(struct gdbarch *gdbarch)
static LONGEST micromips_relative_offset16(ULONGEST insn)
void trad_frame_set_this_base(struct trad_frame_cache *this_trad_cache, CORE_ADDR this_base)
static LONGEST extract_signed_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
static const char * mips_register_name(struct gdbarch *gdbarch, int regno)
static CORE_ADDR mips_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
static void mips_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
static CORE_ADDR mips32_next_pc(struct regcache *regcache, CORE_ADDR pc)
static const struct frame_base * mips_micro_frame_base_sniffer(struct frame_info *this_frame)
static int mips16_instruction_has_delay_slot(unsigned short inst, int mustbe32)
#define MSYMBOL_TARGET_FLAG_MICROMIPS
enum bfd_endian byte_order_for_code
static void set_mipsfpu_none_command(const char *args, int from_tty)
void ax_const_l(struct agent_expr *x, LONGEST l)
static int is_octeon_bbit_op(int op, struct gdbarch *gdbarch)
struct tdesc_arch_data * tdesc_data_alloc(void)
struct inferior * current_inferior(void)
static CORE_ADDR mips_insn16_frame_base_address(struct frame_info *this_frame, void **this_cache)
void frame_base_append_sniffer(struct gdbarch *gdbarch, frame_base_sniffer_ftype *sniffer)
int get_frame_register_bytes(struct frame_info *frame, int regnum, CORE_ADDR offset, int len, gdb_byte *myaddr, int *optimizedp, int *unavailablep)
int mips_pc_is_mips16(struct gdbarch *gdbarch, CORE_ADDR memaddr)
void set_gdbarch_call_dummy_location(struct gdbarch *gdbarch, int call_dummy_location)
target_desc * allocate_target_description(void)
static CORE_ADDR mips_read_pc(struct regcache *regcache)
void print_scalar_formatted(const gdb_byte *, struct type *, const struct value_print_options *, int, struct ui_file *)
unsigned long long ULONGEST
static int mips32_instruction_has_delay_slot(struct gdbarch *gdbarch, ULONGEST inst)
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static void reset_saved_regs(struct gdbarch *gdbarch, struct mips_frame_cache *this_cache)
static int mips_register_sim_regno(struct gdbarch *gdbarch, int regnum)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int register_size(struct gdbarch *gdbarch, int regnum)
void user_reg_add(struct gdbarch *gdbarch, const char *name, user_reg_read_ftype *read, const void *baton)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
static int is_mips_addr(CORE_ADDR addr)
struct type * value_type(const struct value *value)
#define MIPS_EABI(gdbarch)
static const char mips_str_pic[]
struct type * builtin_int64
static LONGEST micromips_relative_offset7(ULONGEST insn)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
static CORE_ADDR mips_adjust_dwarf2_line(CORE_ADDR addr, int rel)
enum register_status regcache_cooked_read_part(struct regcache *regcache, int regnum, int offset, int len, gdb_byte *buf)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
static void mips_micro_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
struct cmd_list_element * showdebuglist
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
CORE_ADDR trad_frame_get_this_base(struct trad_frame_cache *this_trad_cache)
static const gdb_byte * mips_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
struct target_desc * mips_tdesc_gp32
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
static int micromips_pc_insn_size(struct gdbarch *gdbarch, CORE_ADDR pc)
static int mips_tdesc_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
static int mips_n32n64_fp_arg_chunk_p(struct gdbarch *gdbarch, struct type *arg_type, int offset)
static const char * mips_linux_reg_names[NUM_MIPS_PROCESSOR_REGS]
static int mips_insn32_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static LONGEST micromips_relative_offset10(ULONGEST insn)
static void show_mipsfpu_command(const char *args, int from_tty)
struct reggroup *const save_reggroup
static int mips_in_frame_stub(CORE_ADDR pc)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
static CORE_ADDR mips_push_dummy_code(struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache)
static void mips_dump_tdep(struct gdbarch *gdbarch, struct ui_file *file)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
static enum return_value_convention mips_eabi_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
void reinit_frame_cache(void)
static CORE_ADDR mips_o64_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)
#define FIELD_BITPOS(thisfld)
static const signed char mips_reg3_to_reg[8]
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype sw_breakpoint_from_kind)
static CORE_ADDR micromips_next_pc(struct regcache *regcache, CORE_ADDR pc)
std::vector< CORE_ADDR > mips_software_single_step(struct regcache *regcache)
static int mips_is_stub_mode(const char *mode)
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 cmd_list_element * setmipscmdlist
static int is_micromips_isa(struct gdbarch *gdbarch)
static struct gdbarch_data * tdesc_data
CORE_ADDR value_address(const struct value *value)
static int mips64_transfers_32bit_regs_p
struct tdesc_arch_data * tdesc_data
static struct value * mips_insn16_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static int mips32_insn_at_pc_has_delay_slot(struct gdbarch *gdbarch, CORE_ADDR addr)
static int is_micromips_addr(struct gdbarch *gdbarch, CORE_ADDR addr)
enum bfd_endian byte_order
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, struct frame_info *this_frame, int regnum)
static void mips_xfer_register(struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, const gdb_byte *out, int buf_offset)
enum bfd_endian gdbarch_byte_order_for_code(struct gdbarch *gdbarch)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
static void mips_print_fp_register(struct ui_file *file, struct frame_info *frame, int regnum)
static int mips_mask_address_p(struct gdbarch_tdep *tdep)
static int is_octeon(struct gdbarch *gdbarch)
int tdesc_has_registers(const struct target_desc *target_desc)
static int mips_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
static CORE_ADDR mips_get_mips16_fn_stub_pc(struct frame_info *frame, CORE_ADDR pc)
enum auto_boolean mask_address_var
static const char mips_str_call_fp_stub[]
CORE_ADDR get_frame_func(struct frame_info *this_frame)
static unsigned int mips_debug
static void store_signed_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
static CORE_ADDR add_offset_16(CORE_ADDR pc, int offset)
void error(const char *fmt,...)
static CORE_ADDR mips16_scan_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct frame_info *this_frame, struct mips_frame_cache *this_cache)
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)
enum register_status regcache_cooked_read_signed(struct regcache *regcache, int regnum, LONGEST *val)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
const struct register_alias mips_numeric_register_aliases[]
static enum return_value_convention mips_o64_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int micromips_instruction_is_compact_branch(unsigned short insn)
void default_print_float_info(struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
const char * tdesc_property(const struct target_desc *target_desc, const char *key)
struct type * builtin_float
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
static int heuristic_fence_post
static int in_mips_stubs_section(CORE_ADDR pc)
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
static CORE_ADDR mips_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
static CORE_ADDR mips_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
void set_gdbarch_vbit_in_delta(struct gdbarch *gdbarch, int vbit_in_delta)
enum register_status regcache_raw_read_signed(struct regcache *regcache, int regnum, LONGEST *val)