41 #include "opcode/mips.h"
51 #include "floatformat.h"
81 #define ST0_FR (1 << 26)
151 #define R(n) { "r" #n, n }
152 R(0),
R(1),
R(2),
R(3),
R(4),
R(5),
R(6),
R(7),
153 R(8),
R(9),
R(10),
R(11),
R(12),
R(13),
R(14),
R(15),
154 R(16),
R(17),
R(18),
R(19),
R(20),
R(21),
R(22),
R(23),
155 R(24),
R(25),
R(26),
R(27),
R(28),
R(29),
R(30),
R(31),
174 #define R(n) { #n, n }
175 R(0),
R(1),
R(2),
R(3),
R(4),
R(5),
R(6),
R(7),
176 R(8),
R(9),
R(10),
R(11),
R(12),
R(13),
R(14),
R(15),
177 R(16),
R(17),
R(18),
R(19),
R(20),
R(21),
R(22),
R(23),
178 R(24),
R(25),
R(26),
R(27),
R(28),
R(29),
R(30),
R(31),
182 #ifndef MIPS_DEFAULT_FPU_TYPE
183 #define MIPS_DEFAULT_FPU_TYPE MIPS_FPU_DOUBLE
192 #define PROPERTY_GP32 "internal: transfers-32bit-registers"
193 #define PROPERTY_GP64 "internal: transfers-64bit-registers"
222 #define MIPS_EABI(gdbarch) (gdbarch_tdep (gdbarch)->mips_abi \
224 || gdbarch_tdep (gdbarch)->mips_abi == MIPS_ABI_EABI64)
226 #define MIPS_LAST_FP_ARG_REGNUM(gdbarch) \
227 (gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum)
229 #define MIPS_LAST_ARG_REGNUM(gdbarch) \
230 (gdbarch_tdep (gdbarch)->mips_last_arg_regnum)
232 #define MIPS_FPU_TYPE(gdbarch) (gdbarch_tdep (gdbarch)->mips_fpu_type)
373 elf_symbol_type *elfsym = (elf_symbol_type *) sym;
374 unsigned char st_other;
376 if ((sym->flags & BSF_SYNTHETIC) == 0)
377 st_other = elfsym->internal_elf_sym.st_other;
378 else if ((sym->flags & BSF_FUNCTION) != 0)
379 st_other = sym->udata.i;
383 if (ELF_ST_IS_MICROMIPS (st_other))
388 else if (ELF_ST_IS_MIPS16 (st_other))
456 int reg_num,
int length,
457 enum bfd_endian endian,
gdb_byte *in,
458 const gdb_byte *out,
int buf_offset)
470 case BFD_ENDIAN_LITTLE:
473 case BFD_ENDIAN_UNKNOWN:
481 "xfer $%d, reg offset %d, buf offset %d, length %d, ",
482 reg_num, reg_offset, buf_offset, length);
483 if (mips_debug && out != NULL)
487 for (i = 0; i < length; i++)
496 if (mips_debug && in != NULL)
500 for (i = 0; i < length; i++)
533 #define VM_MIN_ADDRESS (CORE_ADDR)0x400000
554 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
555 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
556 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
557 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
558 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
564 static const char *mips_r3041_reg_names[] = {
565 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
566 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
567 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
568 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
569 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
570 "fsr",
"fir",
"",
"",
571 "",
"",
"bus",
"ccfg",
"",
"",
"",
"",
572 "",
"",
"port",
"cmp",
"",
"",
"epc",
"prid",
578 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
579 "",
"",
"",
"",
"",
"",
"",
"",
580 "",
"",
"",
"",
"",
"",
"",
"",
581 "",
"",
"",
"",
"",
"",
"",
"",
582 "",
"",
"",
"",
"",
"",
"",
"",
584 "",
"",
"",
"",
"",
"",
"",
"",
585 "",
"",
"config",
"cache",
"debug",
"depc",
"epc",
590 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
591 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
592 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
593 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
594 "pc",
"cause",
"bad",
"hi",
"lo",
"fsr",
"fir"
599 "sr",
"lo",
"hi",
"bad",
"cause",
"pc",
600 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
601 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
602 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
603 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
614 static char *mips_gpr_names[] = {
615 "zero",
"at",
"v0",
"v1",
"a0",
"a1",
"a2",
"a3",
616 "t0",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
617 "s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
618 "t8",
"t9",
"k0",
"k1",
"gp",
"sp",
"s8",
"ra",
622 static char *mips_n32_n64_gpr_names[] = {
623 "zero",
"at",
"v0",
"v1",
"a0",
"a1",
"a2",
"a3",
624 "a4",
"a5",
"a6",
"a7",
"t0",
"t1",
"t2",
"t3",
625 "s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
626 "t8",
"t9",
"k0",
"k1",
"gp",
"sp",
"s8",
"ra"
649 if (0 <= rawnum && rawnum < 32)
652 return mips_n32_n64_gpr_names[rawnum];
654 return mips_gpr_names[rawnum];
667 _(
"mips_register_name: bad register number %d"), rawnum);
692 return float_p && pseudo;
694 return vector_p && pseudo;
696 return (!vector_p && !float_p) && pseudo;
701 return raw_p && pseudo;
704 return raw_p && pseudo;
753 if (
gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
784 if (
gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
826 if (!
gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p
843 static const signed char mips_reg3_to_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
849 static int heuristic_fence_post = 0;
855 static int mips64_transfers_32bit_regs_p = 0;
868 mips64_transfers_32bit_regs_p = 0;
869 error (
_(
"32-bit compatibility mode not supported"));
899 && regnum % num_regs > 0 && regnum % num_regs < 32
914 int *optimizedp,
int *unavailablep)
924 optimizedp, unavailablep))
928 optimizedp, unavailablep))
930 *optimizedp = *unavailablep = 0;
940 optimizedp, unavailablep))
943 *optimizedp = *unavailablep = 0;
949 _(
"mips_register_to_value: unrecognized case"));
986 if (from[len-1] & 0x80)
997 _(
"mips_value_to_register: unrecognized case"));
1004 static struct type *
1032 if (rawnum ==
mips_regnum (gdbarch)->fp_control_status
1033 || rawnum ==
mips_regnum (gdbarch)->fp_implementation_revision)
1042 else if (
gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
1062 static struct type *
1066 int rawnum = regnum % num_regs;
1067 struct type *rawtype;
1069 gdb_assert (regnum >= num_regs && regnum < 2 * num_regs);
1129 switch (mask_address_var)
1140 _(
"mips_mask_address_p: bad switch"));
1152 switch (mask_address_var)
1162 (
"The 32 bit address mask is set automatically. Currently %s\n",
1166 internal_error (__FILE__, __LINE__,
_(
"show_mask_address: bad switch"));
1315 pc = rel ? pc + addr : addr;
1317 addr = rel ? isa_pc - adj_pc : isa_pc;
1324 static const char mips_str_mips16_call_stub[] =
"__mips16_call_stub_";
1325 static const char mips_str_mips16_ret_stub[] =
"__mips16_ret_";
1326 static const char mips_str_call_fp_stub[] =
"__call_stub_fp_";
1327 static const char mips_str_call_stub[] =
"__call_stub_";
1328 static const char mips_str_fn_stub[] =
"__fn_stub_";
1332 static const char mips_str_pic[] =
".pic.";
1348 if (
startswith (name, mips_str_mips16_call_stub))
1454 if (statusp != NULL)
1458 if (statusp == NULL)
1466 #define mips32_op(x) (x >> 26)
1467 #define itype_op(x) (x >> 26)
1468 #define itype_rs(x) ((x >> 21) & 0x1f)
1469 #define itype_rt(x) ((x >> 16) & 0x1f)
1470 #define itype_immediate(x) (x & 0xffff)
1472 #define jtype_op(x) (x >> 26)
1473 #define jtype_target(x) (x & 0x03ffffff)
1475 #define rtype_op(x) (x >> 26)
1476 #define rtype_rs(x) ((x >> 21) & 0x1f)
1477 #define rtype_rt(x) ((x >> 16) & 0x1f)
1478 #define rtype_rd(x) ((x >> 11) & 0x1f)
1479 #define rtype_shamt(x) ((x >> 6) & 0x1f)
1480 #define rtype_funct(x) (x & 0x3f)
1483 #define micromips_op(x) ((x) >> 10)
1487 #define b0s4_imm(x) ((x) & 0xf)
1488 #define b0s5_imm(x) ((x) & 0x1f)
1489 #define b0s5_reg(x) ((x) & 0x1f)
1490 #define b0s7_imm(x) ((x) & 0x7f)
1491 #define b0s10_imm(x) ((x) & 0x3ff)
1492 #define b1s4_imm(x) (((x) >> 1) & 0xf)
1493 #define b1s9_imm(x) (((x) >> 1) & 0x1ff)
1494 #define b2s3_cc(x) (((x) >> 2) & 0x7)
1495 #define b4s2_regl(x) (((x) >> 4) & 0x3)
1496 #define b5s5_op(x) (((x) >> 5) & 0x1f)
1497 #define b5s5_reg(x) (((x) >> 5) & 0x1f)
1498 #define b6s4_op(x) (((x) >> 6) & 0xf)
1499 #define b7s3_reg(x) (((x) >> 7) & 0x7)
1503 #define b0s6_op(x) ((x) & 0x3f)
1504 #define b0s11_op(x) ((x) & 0x7ff)
1505 #define b0s12_imm(x) ((x) & 0xfff)
1506 #define b0s16_imm(x) ((x) & 0xffff)
1507 #define b0s26_imm(x) ((x) & 0x3ffffff)
1508 #define b6s10_ext(x) (((x) >> 6) & 0x3ff)
1509 #define b11s5_reg(x) (((x) >> 11) & 0x1f)
1510 #define b12s4_op(x) (((x) >> 12) & 0xf)
1529 if ((insn & 0xf800) == 0xf000)
1554 int cnum = (
itype_rt (inst) >> 2) & (count - 1);
1556 int mask = (1 << count) - 1;
1565 cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
1567 if (((cond >> cnum) & mask) != mask * !tf)
1582 return (info->mach == bfd_mach_mips_octeon
1583 || info->mach == bfd_mach_mips_octeonp
1584 || info->mach == bfd_mach_mips_octeon2);
1598 if (op == 50 || op == 54 || op == 58 || op == 62)
1615 if ((inst & 0xe0000000) != 0)
1630 goto greater_branch;
1635 else if (op == 17 &&
itype_rs (inst) == 8)
1638 else if (op == 17 &&
itype_rs (inst) == 9
1642 else if (op == 17 &&
itype_rs (inst) == 10
1654 pc = ((pc + 4) & ~(
CORE_ADDR) 0x0fffffff) + reg + 1;
1660 branch_if = op == 58 || op == 62;
1664 if (op == 54 || op == 62)
1738 unsigned int pos = (op & 2) ? 64 : 32;
1746 dspctl) & 0x7f) >= pos)
1764 pc = reg + ((pc + 4) & ~(
CORE_ADDR) 0x0fffffff);
1808 return ((
b0s7_imm (insn) ^ 0x40) - 0x40) << 1;
1817 return ((
b0s10_imm (insn) ^ 0x200) - 0x200) << 1;
1826 return ((
b0s16_imm (insn) ^ 0x8000) - 0x8000) << 1;
1850 int cnum =
b2s3_cc (insn >> 16) & (count - 1);
1851 int tf =
b5s5_op (insn >> 16) & 1;
1852 int mask = (1 << count) - 1;
1861 cond = ((fcs >> 24) & 0xfe) | ((fcs >> 23) & 0x01);
1863 if (((cond >> cnum) & mask) != mask * !tf)
1959 if (((insn >> 16) & 0x3) == 0x0)
1967 unsigned int pos = (
b5s5_op (insn >> 16) & 1) ? 32 : 64;
1975 dspctl) & 0x7f) >= pos)
1986 if (((insn >> 16) & 0x2) == 0x0)
1988 ((insn >> 16) & 0x1) + 1);
1993 if (((insn >> 16) & 0x3) == 0x1)
2002 pc = ((pc | 0x7fffffe) ^ 0x7fffffe) | (
b0s26_imm (insn) << 1);
2022 pc = ((pc | 0xfffffff) ^ 0xfffffff) | (
b0s26_imm (insn) << 2);
2032 if ((
b5s5_op (insn) & 0x1c) == 0xc)
2035 else if (
b5s5_op (insn) == 0x18)
2042 int rs = mips_reg3_to_reg[
b7s3_reg (insn)];
2053 int rs = mips_reg3_to_reg[
b7s3_reg (insn)];
2124 value = (extension >> 16) & 0x1f;
2126 value |= (extension >> 21) & 0x3f;
2128 value |= extension & 0x1f;
2153 unsigned int extension,
2160 switch (insn_format)
2168 value = (value ^ 0x8000) - 0x8000;
2172 value = inst & 0x7ff;
2173 value = (value ^ 0x400) - 0x400;
2189 value = (value ^ 0x8000) - 0x8000;
2193 value = inst & 0xff;
2194 value = (value ^ 0x80) - 0x80;
2197 regx = (inst >> 8) & 0x07;
2203 unsigned long value;
2204 unsigned int nexthalf;
2205 value = ((inst & 0x1f) << 5) | ((inst >> 5) & 0x1f);
2206 value = value << 16;
2230 return pc + (offset << 1) + 2;
2235 unsigned int extension,
unsigned int insn)
2238 int op = (insn >> 11);
2254 if ((insn >> 10) & 0x01)
2291 if (((upk.
regx == 0) && (reg == 0))
2292 || ((upk.
regx == 1) && (reg != 0)))
2306 upk.
regx = (insn >> 8) & 0x07;
2307 upk.
regy = (insn >> 5) & 0x07;
2308 if ((upk.
regy & 1) == 0)
2309 reg = mips_reg3_to_reg[upk.
regx];
2369 switch (insn & 0xf800)
2372 return (insn & 0x009f) == 0x80;
2374 return (insn & 0x0600) == 0;
2393 return (
b5s5_op (insn) == 0x18
2398 return (
b5s5_op (insn) & 0x1d) == 0x5;
2426 if (this_cache != NULL
2444 unsigned short inst,
2451 if ((prev_inst & 0xf800) == 0xf000)
2453 offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
2454 if (offset & 0x8000)
2455 offset = 0 - (0x10000 - (offset & 0xffff));
2456 return offset | (inst & 0x1f);
2460 int max_imm = 1 << nbits;
2461 int mask = max_imm - 1;
2462 int sign_bit = max_imm >> 1;
2464 offset = inst & mask;
2465 if (is_signed && (offset & sign_bit))
2466 offset = 0 - (max_imm - offset);
2467 return offset * scale;
2482 int prev_non_prologue_insn = 0;
2483 int this_non_prologue_insn;
2484 int non_prologue_insns = 0;
2489 long frame_offset = 0;
2490 long frame_adjust = 0;
2492 unsigned short prev_inst = 0;
2494 unsigned entry_inst = 0;
2495 unsigned save_inst = 0;
2496 int prev_delay_slot = 0;
2500 int extend_bytes = 0;
2501 int prev_extend_bytes = 0;
2506 if (this_frame != NULL)
2513 if (limit_pc > start_pc + 200)
2514 limit_pc = start_pc + 200;
2522 this_non_prologue_insn = 0;
2538 if ((inst & 0xf800) == 0xf000)
2544 prev_extend_bytes = extend_bytes;
2547 if ((inst & 0xff00) == 0x6300
2548 || (inst & 0xff00) == 0xfb00)
2559 else if ((inst & 0xf800) == 0xd000)
2562 reg = mips_reg3_to_reg[(inst & 0x700) >> 8];
2565 else if ((inst & 0xff00) == 0xf900)
2568 reg = mips_reg3_to_reg[(inst & 0xe0) >> 5];
2571 else if ((inst & 0xff00) == 0x6200)
2576 else if ((inst & 0xff00) == 0xfa00)
2581 else if (inst == 0x673d)
2586 else if ((inst & 0xff00) == 0x0100)
2589 frame_addr = sp +
offset;
2593 else if ((inst & 0xFF00) == 0xd900)
2596 reg = mips_reg3_to_reg[(inst & 0xe0) >> 5];
2599 else if ((inst & 0xFF00) == 0x7900)
2602 reg = mips_reg3_to_reg[(inst & 0xe0) >> 5];
2605 else if ((inst & 0xf81f) == 0xe809
2606 && (inst & 0x700) != 0x700)
2608 else if ((inst & 0xff80) == 0x6480)
2611 if (prev_extend_bytes)
2612 save_inst |= prev_inst << 16;
2614 else if ((inst & 0xff1c) == 0x6704)
2634 this_non_prologue_insn = 1;
2637 non_prologue_insns += this_non_prologue_insn;
2641 if (prev_delay_slot || non_prologue_insns > 1
2645 prev_non_prologue_insn = this_non_prologue_insn;
2646 prev_delay_slot = in_delay_slot;
2647 prev_pc = cur_pc - prev_extend_bytes;
2656 if (entry_inst != 0)
2658 int areg_count = (entry_inst >> 8) & 7;
2659 int sreg_count = (entry_inst >> 6) & 3;
2669 for (reg = 4, offset = 0; reg < areg_count + 4; reg++)
2677 if (entry_inst & 0x20)
2684 for (reg = 16; reg < sreg_count + 16; reg++)
2699 static int args_table[16] = {
2700 0, 0, 0, 0, 1, 1, 1, 1,
2701 2, 2, 2, 0, 3, 3, 4, -1,
2703 static int astatic_table[16] = {
2704 0, 1, 2, 3, 0, 1, 2, 3,
2705 0, 1, 2, 4, 0, 1, 0, -1,
2707 int aregs = (save_inst >> 16) & 0xf;
2708 int xsregs = (save_inst >> 24) & 0x7;
2709 int args = args_table[aregs];
2710 int astatic = astatic_table[aregs];
2715 warning (
_(
"Invalid number of argument registers encoded in SAVE."));
2720 warning (
_(
"Invalid number of static registers encoded in SAVE."));
2725 frame_size = ((save_inst >> 16) & 0xf0) | (save_inst & 0xf);
2726 if (frame_size == 0 && (save_inst >> 16) == 0)
2729 frame_offset += frame_size;
2745 if (save_inst & 0x40)
2759 for (reg = 18 + xsregs - 1; reg > 18 - 1; reg--)
2766 if (save_inst & 0x10)
2772 if (save_inst & 0x20)
2786 if (this_cache != NULL)
2791 + frame_offset - frame_adjust);
2804 end_prologue_addr = (prev_non_prologue_insn || prev_delay_slot
2805 ? prev_pc : cur_pc - prev_extend_bytes);
2807 return end_prologue_addr;
2820 if ((*this_cache) != NULL)
2821 return (*this_cache);
2823 (*this_cache) = cache;
2832 if (start_addr == 0)
2836 if (start_addr == 0)
2847 return (*this_cache);
2857 if (info->
base == 0)
2862 static struct value *
2864 void **this_cache,
int regnum)
2873 struct frame_info *this_frame,
void **this_cache)
2906 mips_insn16_frame_base_address
2927 imm = (imm ^ 0x100) - 0x100;
2928 if (imm > -3 && imm < 2)
2943 int prev_non_prologue_insn = 0;
2945 int this_non_prologue_insn;
2946 int non_prologue_insns = 0;
2947 long frame_offset = 0;
2948 long frame_adjust = 0;
2950 int prev_delay_slot = 0;
2971 if (this_frame != NULL)
2978 if (limit_pc > start_pc + 200)
2979 limit_pc = start_pc + 200;
2985 for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += loc)
2987 this_non_prologue_insn = 0;
2998 this_non_prologue_insn = 1;
3025 else if (op != 0x150
3029 this_non_prologue_insn = 1;
3035 reglist = sreg =
b5s5_reg (insn >> 16);
3036 offset = (
b0s12_imm (insn) ^ 0x800) - 0x800;
3037 if ((op == 0x9 || op == 0xc)
3043 s = 4 << ((
b12s4_op (insn) & 0x4) == 0x4);
3047 sreg + 1, sp + offset + s);
3049 else if ((op == 0xd || op == 0xf)
3054 && ((reglist >= 1 && reglist <= 9)
3055 || (reglist >= 16 && reglist <= 25)))
3057 int sreglist =
min(reglist & 0xf, 8);
3059 s = 4 << ((
b12s4_op (insn) & 0x2) == 0x2);
3060 for (i = 0; i < sreglist; i++)
3062 if ((reglist & 0xf) > 8)
3064 if ((reglist & 0x10) == 0x10)
3069 this_non_prologue_insn = 1;
3078 offset = (
b0s16_imm (insn) ^ 0x8000) - 0x8000;
3085 frame_addr = sp +
offset;
3089 else if (sreg != 28 || dreg != 28)
3091 this_non_prologue_insn = 1;
3097 if (
b5s5_op (insn >> 16) == 0xd
3101 v1_off = ((
b0s16_imm (insn) << 16) ^ 0x80000000) - 0x80000000;
3102 else if (
b5s5_op (insn >> 16) != 0xd
3106 this_non_prologue_insn = 1;
3113 if (sreg == 3 && dreg == 3)
3117 this_non_prologue_insn = 1;
3125 this_non_prologue_insn = 1;
3132 offset = (
b0s16_imm (insn) ^ 0x8000) - 0x8000;
3137 this_non_prologue_insn = 1;
3146 this_non_prologue_insn = 1;
3165 else if ((sreg & 0x1c) != 0x4)
3167 this_non_prologue_insn = 1;
3174 offset = ((
b0s4_imm (insn) << 2) ^ 0x20) - 0x20;
3176 for (i = 0; i <= reglist; i++)
3182 this_non_prologue_insn = 1;
3186 if ((insn & 0x1) == 0x1)
3192 sp_adj = (
b1s4_imm (insn) ^ 8) - 8;
3194 this_non_prologue_insn = 1;
3209 this_non_prologue_insn = 1;
3215 frame_offset -= sp_adj;
3217 non_prologue_insns += this_non_prologue_insn;
3222 if (prev_delay_slot || non_prologue_insns > 1 || sp_adj > 0
3226 prev_non_prologue_insn = this_non_prologue_insn;
3227 prev_delay_slot = in_delay_slot;
3231 if (this_cache != NULL)
3236 + frame_offset - frame_adjust);
3250 = prev_non_prologue_insn || prev_delay_slot ? prev_pc : cur_pc;
3252 return end_prologue_addr;
3265 if ((*this_cache) != NULL)
3266 return (*this_cache);
3269 (*this_cache) = cache;
3278 if (start_addr == 0)
3282 if (start_addr == 0)
3293 return (*this_cache);
3303 if (info->
base == 0)
3308 static struct value *
3310 void **this_cache,
int regnum)
3319 struct frame_info *this_frame,
void **this_cache)
3353 mips_micro_frame_base_address
3374 if (this_cache == NULL || this_cache->
saved_regs == NULL)
3398 int prev_non_prologue_insn;
3399 int this_non_prologue_insn;
3400 int non_prologue_insns;
3403 int prev_delay_slot;
3411 int seen_sp_adjust = 0;
3412 int load_immediate_bytes = 0;
3418 if (this_frame != NULL)
3425 if (limit_pc > start_pc + 200)
3426 limit_pc = start_pc + 200;
3429 prev_non_prologue_insn = 0;
3430 non_prologue_insns = 0;
3431 prev_delay_slot = 0;
3440 unsigned long inst, high_word;
3444 this_non_prologue_insn = 0;
3452 high_word = (inst >> 16) & 0xffff;
3453 offset = ((inst & 0xffff) ^ 0x8000) - 0x8000;
3454 reg = high_word & 0x1f;
3456 if (high_word == 0x27bd
3457 || high_word == 0x23bd
3458 || high_word == 0x67bd)
3469 else if (((high_word & 0xFFE0) == 0xafa0)
3470 && !regsize_is_64_bits)
3474 else if (((high_word & 0xFFE0) == 0xffa0)
3475 && regsize_is_64_bits)
3480 else if (high_word == 0x27be)
3483 if (offset != frame_offset)
3484 frame_addr = sp +
offset;
3487 unsigned alloca_adjust;
3494 alloca_adjust = (unsigned) (frame_addr - (sp + offset));
3495 if (alloca_adjust > 0)
3500 sp += alloca_adjust;
3513 else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
3518 unsigned alloca_adjust;
3524 alloca_adjust = (unsigned) (frame_addr - sp);
3525 if (alloca_adjust > 0)
3540 else if ((high_word & 0xFFE0) == 0xafc0
3541 && !regsize_is_64_bits)
3545 else if ((high_word & 0xFFE0) == 0xE7A0
3546 || (high_word & 0xF3E0) == 0xA3C0
3547 || (inst & 0xFF9F07FF) == 0x00800021
3548 || high_word == 0x3c1c
3549 || high_word == 0x279c
3550 || inst == 0x0399e021
3551 || inst == 0x033ce021
3562 else if (!seen_sp_adjust
3564 && (high_word == 0x3c01
3565 || high_word == 0x3c08
3566 || high_word == 0x3421
3567 || high_word == 0x3508
3568 || high_word == 0x3401
3569 || high_word == 0x3408
3585 this_non_prologue_insn = 1;
3588 non_prologue_insns += this_non_prologue_insn;
3592 if (prev_delay_slot || non_prologue_insns > 1)
3595 prev_non_prologue_insn = this_non_prologue_insn;
3596 prev_delay_slot = in_delay_slot;
3600 if (this_cache != NULL)
3620 = prev_non_prologue_insn || prev_delay_slot ? prev_pc : cur_pc;
3625 if (load_immediate_bytes && !seen_sp_adjust)
3626 end_prologue_addr -= load_immediate_bytes;
3628 return end_prologue_addr;
3642 if ((*this_cache) != NULL)
3643 return (*this_cache);
3646 (*this_cache) = cache;
3655 if (start_addr == 0)
3659 if (start_addr == 0)
3670 return (*this_cache);
3680 if (info->
base == 0)
3685 static struct value *
3687 void **this_cache,
int regnum)
3696 struct frame_info *this_frame,
void **this_cache)
3728 mips_insn32_frame_base_address
3751 if ((*this_cache) != NULL)
3752 return (*this_cache);
3754 (*this_cache) = this_trad_cache;
3773 return this_trad_cache;
3785 static struct value *
3787 void **this_cache,
int regnum)
3845 mips_stub_frame_base_address
3880 return addr &= 0xffffffffUL;
3893 #define LL_OPCODE 0x30
3894 #define LLD_OPCODE 0x34
3895 #define SC_OPCODE 0x38
3896 #define SCD_OPCODE 0x3c
3908 int last_breakpoint = 0;
3909 const int atomic_sequence_length = 16;
3918 for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count)
3934 is_branch = ((
itype_rt (insn) & 0xc) == 0
3959 is_branch = (
itype_rs (insn) == 8);
3965 if (last_breakpoint >= 1)
3968 breaks[1] = branch_bp;
3987 if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0])
3988 last_breakpoint = 0;
3991 for (index = 0; index <= last_breakpoint; index++)
4002 const int atomic_sequence_length = 16;
4003 int last_breakpoint = 0;
4020 if ((
b12s4_op (insn) & 0xb) != 0x3)
4027 for (insn_count = 0;
4028 !sc_found && insn_count < atomic_sequence_length;
4051 if ((
b5s5_op (insn) & 0x18) != 0x0
4054 && (
b5s5_op (insn) & 0x1d) != 0x11
4056 && ((
b5s5_op (insn) & 0x1e) != 0x14
4057 || (insn & 0x3) != 0x0)
4059 && (
b5s5_op (insn) & 0x1e) != 0x1a
4061 && ((
b5s5_op (insn) & 0x1e) != 0x1c
4062 || (insn & 0x3) != 0x0)
4064 && ((
b5s5_op (insn) & 0x1c) != 0x1c
4065 || (insn & 0x3) != 0x1))
4099 if ((
b12s4_op (insn) & 0xb) == 0xb)
4118 if ((
b5s5_op (insn) & 0x1c) != 0xc
4132 if (last_breakpoint >= 1)
4135 breaks[1] = branch_bp;
4147 if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0])
4148 last_breakpoint = 0;
4151 for (index = 0; index <= last_breakpoint; index++)
4206 return (insn & ~hint) == 0x3e00008;
4237 for (start_pc -= instlen;; start_pc -= instlen)
4238 if (start_pc < fence)
4246 static int blurb_printed = 0;
4248 warning (
_(
"GDB can't find the start of the function at %s."),
4260 GDB is unable to find the start of the function at %s\n\
4261 and thus can't determine the size of that function's stack frame.\n\
4262 This means that GDB may be unable to access that stack frame, or\n\
4263 the frames below it.\n\
4264 This problem is most likely caused by an invalid program counter or\n\
4266 However, if you think GDB should simply search farther back\n\
4267 from %s for code which looks like the beginning of a\n\
4268 function, you can increase the range of the search using the `set\n\
4269 heuristic-fence-post' command.\n",
4279 unsigned short inst;
4290 if ((inst & 0xff80) == 0x6480)
4292 if (start_pc - instlen >= fence)
4295 start_pc - instlen, NULL);
4296 if ((inst & 0xf800) == 0xf000)
4297 start_pc -= instlen;
4301 else if (((inst & 0xf81f) == 0xe809
4302 && (inst & 0x700) != 0x700)
4303 || (inst & 0xff80) == 0x6380
4304 || (inst & 0xff80) == 0xfb80
4305 || ((inst & 0xf810) == 0xf010 && seen_adjsp))
4307 else if ((inst & 0xff00) == 0x6300
4308 || (inst & 0xff00) == 0xfb00)
4336 offset = (
b0s16_imm (insn) ^ 0x8000) - 0x8000;
4352 if ((insn & 0x1) == 0x1)
4364 offset = (
b1s4_imm (insn) ^ 8) - 8;
4398 struct type *arg_type)
4431 for (i = 0; i < n; i++)
4456 static gdb_byte nop_insn[] = { 0, 0, 0, 0 };
4461 bp_slot = sp -
sizeof (nop_insn);
4476 nop_addr = bp_slot -
sizeof (nop_insn);
4496 int stack_offset = 0;
4521 for (argnum = 0; argnum < nargs; argnum++)
4527 "mips_eabi_push_dummy_call: sp=%s allocated %ld\n",
4539 "mips_eabi_push_dummy_call: "
4540 "struct_return reg=%d %s\n",
4541 argreg,
paddress (gdbarch, struct_addr));
4548 for (argnum = 0; argnum < nargs; argnum++)
4552 struct value *arg = args[argnum];
4559 "mips_eabi_push_dummy_call: %d len=%d type=%d",
4560 argnum + 1, len, (
int) typecode);
4585 if ((float_argreg & 1))
4612 == BFD_ENDIAN_BIG ? 4 : 0;
4620 float_argreg,
phex (regval, 4));
4628 float_argreg,
phex (regval, 4));
4640 float_argreg,
phex (regval, len));
4654 int odd_sized_struct = (len > regsize && len % regsize != 0);
4661 int stack_used_p = 0;
4662 int partial_len = (len < regsize ? len : regsize);
4675 int longword_offset = 0;
4684 longword_offset = regsize -
len;
4688 longword_offset = regsize -
len;
4696 paddress (gdbarch, longword_offset));
4699 addr = sp + stack_offset + longword_offset;
4706 for (i = 0; i < partial_len; i++)
4729 phex (regval, regsize));
4744 stack_offset +=
align_up (partial_len, regsize);
4765 int fp_return_type = 0;
4809 if (offset + xfer > TYPE_LENGTH (type))
4845 struct type *field_type;
4887 int stack_offset = 0;
4909 for (argnum = 0; argnum < nargs; argnum++)
4915 "mips_n32n64_push_dummy_call: sp=%s allocated %ld\n",
4927 "mips_n32n64_push_dummy_call: "
4928 "struct_return reg=%d %s\n",
4929 argreg,
paddress (gdbarch, struct_addr));
4936 for (argnum = 0; argnum < nargs; argnum++)
4939 struct value *arg = args[argnum];
4946 "mips_n32n64_push_dummy_call: %d len=%d type=%d",
4947 argnum + 1, len, (
int) typecode);
4955 && (float_argreg & 1))
4970 float_argreg,
phex (regval, reglen));
4975 argreg,
phex (regval, reglen));
4982 reglen, byte_order);
4985 float_argreg,
phex (regval, reglen));
4990 argreg,
phex (regval, reglen));
5014 int stack_used_p = 0;
5029 int longword_offset = 0;
5045 paddress (gdbarch, longword_offset));
5048 addr = sp + stack_offset + longword_offset;
5055 for (i = 0; i < partial_len; i++)
5076 if ((partial_len == 4
5192 readbuf, writebuf, 0);
5197 readbuf ? readbuf + 8 : readbuf,
5198 writebuf ? writebuf + 8 : writebuf, 0);
5212 readbuf, writebuf, 0);
5250 readbuf, writebuf, offset);
5255 readbuf, writebuf, offset + 8);
5262 readbuf, writebuf, offset);
5280 if (offset + xfer > TYPE_LENGTH (type))
5284 offset, xfer, regnum);
5287 xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
5303 if (offset + xfer > TYPE_LENGTH (type))
5307 offset, xfer, regnum);
5311 readbuf, writebuf, offset);
5343 int stack_offset = 0;
5365 for (argnum = 0; argnum < nargs; argnum++)
5379 "mips_o32_push_dummy_call: sp=%s allocated %ld\n",
5391 "mips_o32_push_dummy_call: "
5392 "struct_return reg=%d %s\n",
5393 argreg,
paddress (gdbarch, struct_addr));
5401 for (argnum = 0; argnum < nargs; argnum++)
5404 struct value *arg = args[argnum];
5411 "mips_o32_push_dummy_call: %d len=%d type=%d",
5412 argnum + 1, len, (
int) typecode);
5423 if ((float_argreg & 1))
5444 == BFD_ENDIAN_BIG ? 1 : 0;
5445 unsigned long regval;
5451 float_argreg + freg_offset,
5454 float_argreg++ + freg_offset,
5458 argreg,
phex (regval, 4));
5465 float_argreg - freg_offset,
5468 float_argreg++ - freg_offset,
5472 argreg,
phex (regval, 4));
5484 float_argreg,
phex (regval, len));
5486 float_argreg++, regval);
5492 argreg,
phex (regval, len));
5523 int stack_used_p = 0;
5532 || odd_sized_struct)
5536 int longword_offset = 0;
5545 paddress (gdbarch, longword_offset));
5548 addr = sp + stack_offset + longword_offset;
5555 for (i = 0; i < partial_len; i++)
5686 readbuf, writebuf, 0);
5692 readbuf, writebuf, 0);
5716 "Return float in $fp1/$fp0 and $2/$3\n");
5725 case BFD_ENDIAN_LITTLE:
5730 readbuf, writebuf, 0);
5735 readbuf, writebuf, 4);
5737 case BFD_ENDIAN_BIG:
5742 readbuf, writebuf, 0);
5747 readbuf, writebuf, 4);
5760 readbuf, writebuf, 0);
5764 readbuf, writebuf, 4);
5788 for (field = 0, regnum =
mips_regnum (gdbarch)->fp0;
5800 readbuf, writebuf, offset);
5819 if (offset + xfer > TYPE_LENGTH (type))
5823 offset, xfer, regnum);
5826 BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
5843 if (offset + xfer > TYPE_LENGTH (type))
5844 xfer = TYPE_LENGTH (type) -
offset;
5847 offset, xfer, regnum);
5851 readbuf, writebuf, offset);
5871 int stack_offset = 0;
5893 for (argnum = 0; argnum < nargs; argnum++)
5904 "mips_o64_push_dummy_call: sp=%s allocated %ld\n",
5916 "mips_o64_push_dummy_call: "
5917 "struct_return reg=%d %s\n",
5918 argreg,
paddress (gdbarch, struct_addr));
5926 for (argnum = 0; argnum < nargs; argnum++)
5929 struct value *arg = args[argnum];
5936 "mips_o64_push_dummy_call: %d len=%d type=%d",
5937 argnum + 1, len, (
int) typecode);
5957 float_argreg,
phex (regval, len));
5961 argreg,
phex (regval, len));
5981 int stack_used_p = 0;
5990 || odd_sized_struct)
5994 int longword_offset = 0;
6011 paddress (gdbarch, longword_offset));
6014 addr = sp + stack_offset + longword_offset;
6021 for (i = 0; i < partial_len; i++)
6135 readbuf, writebuf, 0);
6141 readbuf, writebuf, 0);
6155 if (offset + xfer > TYPE_LENGTH (type))
6156 xfer = TYPE_LENGTH (type) -
offset;
6159 offset, xfer, regnum);
6163 readbuf, writebuf, offset);
6208 gdb_byte *raw_buffer = alloca (raw_size);
6211 error (
_(
"can't read register %d (%s)"),
6224 memcpy (rare_buffer, raw_buffer + offset, 4);
6228 memcpy (rare_buffer, raw_buffer, 4);
6248 error (
_(
"can't read register %d (%s)"),
6257 _(
"mips_read_fp_register_double: bad access to "
6258 "odd-numbered FP register"));
6398 if (flags & (1 << 0))
6400 if (flags & (1 << 1))
6402 if (flags & (1 << 2))
6404 if (flags & (1 << 3))
6406 if (flags & (1 << 4))
6408 if (flags & (1 << 5))
6440 if (fcs & (1 << 23))
6442 for (i = 1; i <= 7; i++)
6443 if (fcs & (1 << (24 + i)))
6449 fputs (
"mask :", stdout);
6451 fputs (
"flags :", stdout);
6464 if (fcs & (1 << 21))
6466 if (fcs & (1 << 22))
6468 if (fcs & (1 << 24))
6470 if ((fcs & (0xb << 21)) == 0)
6510 for (col = 0, regnum = start_regnum;
6549 for (col = 0, regnum = start_regnum;
6563 error (
_(
"can't read register %d (%s)"),
6577 for (byte = register_size (gdbarch, regnum) - 1;
6599 error (
_(
"Not a valid register for the current processor type"));
6674 if (post_prologue_pc != 0)
6675 return max (pc, post_prologue_pc);
6686 limit_pc = pc + 100;
6709 if (addr < func_addr + 4)
6710 addr = func_addr + 4;
6716 unsigned long high_word;
6720 high_word = (inst >> 16) & 0xffff;
6722 if (high_word != 0x27bd
6723 && high_word != 0x67bd
6724 && inst != 0x03e00008
6725 && inst != 0x00000000)
6754 addr = func_end - 12;
6756 if (addr < func_addr + 2)
6757 addr = func_addr + 2;
6761 for (; pc < func_end; pc += loc)
6785 offset = (
b0s16_imm (insn) ^ 0x8000) - 0x8000;
6804 if (sreg == 0 && dreg == 0)
6821 if ((insn & 0x1) == 0x1
6849 if (addr < func_addr + 4)
6850 addr = func_addr + 4;
6856 unsigned short inst;
6860 if ((inst & 0xf800) == 0xf000)
6906 (
"\"set mips\" must be followed by an appropriate subcommand.\n");
6920 (
"The MIPS floating-point coprocessor is unknown "
6921 "because the current architecture is not MIPS.\n");
6928 fpu =
"single-precision";
6931 fpu =
"double-precision";
6934 fpu =
"absent (none)";
6939 if (mips_fpu_type_auto)
6941 "is set automatically (currently %s)\n",
6945 (
"The MIPS floating-point coprocessor is assumed to be %s\n", fpu);
6953 "\"single\",\"none\" or \"auto\".\n");
6963 mips_fpu_type_auto = 0;
6977 mips_fpu_type_auto = 0;
6991 mips_fpu_type_auto = 0;
7002 mips_fpu_type_auto = 1;
7020 if ((prid & ~0xf) == 0x700)
7037 struct gdbarch *gdbarch = info->application_data;
7044 info->mach = bfd_mach_mips16;
7046 info->mach = bfd_mach_mips_micromips;
7049 memaddr &= (info->mach == bfd_mach_mips16
7050 || info->mach == bfd_mach_mips_micromips) ? ~1 : ~3;
7053 if (!info->disassembler_options)
7059 info->disassembler_options =
"gpr-names=32";
7062 if (info->endian == BFD_ENDIAN_BIG)
7063 return print_insn_big_mips (memaddr, info);
7065 return print_insn_little_mips (memaddr, info);
7073 info->disassembler_options =
"gpr-names=n32";
7074 info->flavour = bfd_target_elf_flavour;
7084 info->disassembler_options =
"gpr-names=64";
7085 info->flavour = bfd_target_elf_flavour;
7107 static gdb_byte mips16_big_breakpoint[] = { 0xe8, 0xa5 };
7109 *lenptr =
sizeof (mips16_big_breakpoint);
7110 return mips16_big_breakpoint;
7114 static gdb_byte micromips16_big_breakpoint[] = { 0x46, 0x85 };
7115 static gdb_byte micromips32_big_breakpoint[] = { 0, 0x5, 0, 0x7 };
7125 return (size == 2) ? micromips16_big_breakpoint
7126 : micromips32_big_breakpoint;
7133 static gdb_byte big_breakpoint[] = { 0, 0x5, 0, 0xd };
7134 static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd };
7135 static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd };
7138 static gdb_byte irix_big_breakpoint[] = { 0, 0, 0, 0xd };
7140 *lenptr =
sizeof (big_breakpoint);
7143 return idt_big_breakpoint;
7147 return pmon_big_breakpoint;
7149 return irix_big_breakpoint;
7151 return big_breakpoint;
7158 static gdb_byte mips16_little_breakpoint[] = { 0xa5, 0xe8 };
7160 *lenptr =
sizeof (mips16_little_breakpoint);
7161 return mips16_little_breakpoint;
7165 static gdb_byte micromips16_little_breakpoint[] = { 0x85, 0x46 };
7166 static gdb_byte micromips32_little_breakpoint[] = { 0x5, 0, 0x7, 0 };
7176 return (size == 2) ? micromips16_little_breakpoint
7177 : micromips32_little_breakpoint;
7181 static gdb_byte little_breakpoint[] = { 0xd, 0, 0x5, 0 };
7182 static gdb_byte pmon_little_breakpoint[] = { 0xd, 0, 0, 0 };
7183 static gdb_byte idt_little_breakpoint[] = { 0xd, 0x0a, 0, 0 };
7185 *lenptr =
sizeof (little_breakpoint);
7188 return idt_little_breakpoint;
7192 return pmon_little_breakpoint;
7194 return little_breakpoint;
7230 *kindptr = size | 1;
7248 if ((inst & 0xe0000000) != 0)
7258 || (rs == 9 && (rt & 0x2) == 0)
7260 || (rs == 10 && (rt & 0x2) == 0))));
7274 return ((rt & 0xc) == 0
7277 || ((rt & 0x1e) == 0x1c && rs == 0));
7324 || (
b5s5_op (major) & 0x1e) == 0xe)));
7335 return ((
b5s5_op (major) & 0x1c) == 0x0
7337 || (
b5s5_op (major) & 0x1d) == 0x4
7339 || (
b5s5_op (major) & 0x1d) == 0x11
7341 || ((
b5s5_op (major) & 0x1e) == 0x14
7342 && (major & 0x3) == 0x0)
7344 || (
b5s5_op (major) & 0x1e) == 0x1a
7346 || ((
b5s5_op (major) & 0x1e) == 0x1c
7347 && (major & 0x3) == 0x0)
7349 || ((
b5s5_op (major) & 0x1c) == 0x1c
7350 && (major & 0x3) == 0x1));
7353 return (
b0s6_op (insn) == 0x3c
7396 if ((inst & 0xf89f) == 0xe800)
7398 return (inst & 0xf800) == 0x1800;
7409 unsigned short insn;
7432 switch (bpaddr >> ((
sizeof (
CORE_ADDR) << 3) - 2) & 3)
7435 if (bpaddr == (bfd_signed_vma) (int32_t) bpaddr)
7447 else if (bpaddr & 0x80000000)
7452 return bpaddr & mask;
7499 && func_addr > boundary && func_addr <= bpaddr)
7500 boundary = func_addr;
7504 if (bpaddr == boundary)
7509 prev_addr = bpaddr - 4;
7516 CORE_ADDR addr, jmpaddr;
7535 for (i = 1; i < 4; i++)
7540 if (i == 1 && insn_at_pc_has_delay_slot (gdbarch, addr, 0))
7545 else if (i > 1 && insn_at_pc_has_delay_slot (gdbarch, addr, 1))
7598 return zero && suffix[1] ==
'\0';
7600 return suffix[1] ==
'\0' || (suffix[1] ==
'0' && suffix[2] ==
'\0');
7605 return suffix[1] ==
'\0';
7617 return ((mode[0] ==
's' || mode[0] ==
'd')
7618 && (mode[1] ==
'f' || mode[1] ==
'c'));
7687 status == 0 && target_pc == 0 && i < 20;
7706 else if (rs == addrreg)
7725 target_pc += ((pc + 4) & ~(
CORE_ADDR) 0x0fffffff);
7736 else if (rt == addrreg)
7761 memset (buf, 0,
sizeof (buf));
7810 prefixlen = strlen (mips_str_mips16_ret_stub);
7811 if (strncmp (name, mips_str_mips16_ret_stub, prefixlen) == 0
7813 && name[prefixlen + 2] ==
'\0')
7819 prefixlen = strlen (mips_str_mips16_call_stub);
7820 if (strncmp (name, mips_str_mips16_call_stub, prefixlen) == 0)
7833 && name[prefixlen + 2] ==
'_'
7836 if (pc == start_addr)
7856 if (pc == start_addr)
7887 prefixlen = strlen (mips_str_mips16_call_stub);
7888 if (pc != start_addr
7889 && strncmp (name, mips_str_mips16_call_stub, prefixlen) == 0
7891 && name[prefixlen + 2] ==
'_'
7897 prefixlen = strlen (mips_str_call_fp_stub);
7898 if (pc != start_addr
7899 && strncmp (name, mips_str_call_fp_stub, prefixlen) == 0)
7906 prefixlen = strlen (mips_str_pic);
7907 if (strncmp (name, mips_str_pic, prefixlen) == 0)
7911 prefixlen = strlen (mips_str_mips16_ret_stub);
7912 if (strncmp (name, mips_str_mips16_ret_stub, prefixlen) == 0
7914 && name[prefixlen + 2] ==
'\0')
7932 int32_t stub_words[4];
7953 for (i = 0; i < 4; i++)
7965 if ((stub_words[0] & 0xffff0000U) == 0x3c190000
7966 && (stub_words[1] & 0xfc000000U) == 0x08000000
7967 && (stub_words[2] & 0xffff0000U) == 0x27390000
7968 && stub_words[3] == 0x00000000)
7969 return ((((stub_words[0] & 0x0000ffff) << 16)
7970 + (stub_words[2] & 0x0000ffff)) ^ 0x8000) - 0x8000;
8000 while (pc != target_pc);
8002 return pc != requested_pc ? pc : 0;
8012 if (num >= 0 && num < 32)
8014 else if (num >= 38 && num < 70)
8020 else if (
mips_regnum (gdbarch)->dspacc != -1 && num >= 72 && num < 78)
8037 if (num >= 0 && num < 32)
8039 else if (num >= 32 && num < 64)
8045 else if (
mips_regnum (gdbarch)->dspacc != -1 && num >= 66 && num < 72)
8066 + regnum)[0] !=
'\0')
8101 const char *
name = bfd_get_section_name (abfd, sect);
8109 if (strcmp (name,
".mdebug.abi32") == 0)
8111 else if (strcmp (name,
".mdebug.abiN32") == 0)
8113 else if (strcmp (name,
".mdebug.abi64") == 0)
8115 else if (strcmp (name,
".mdebug.abiO64") == 0)
8117 else if (strcmp (name,
".mdebug.eabi32") == 0)
8119 else if (strcmp (name,
".mdebug.eabi64") == 0)
8122 warning (
_(
"unsupported ABI %s."), name + 8);
8128 int *lbp = (
int *) obj;
8129 const char *
name = bfd_get_section_name (abfd, sect);
8131 if (
startswith (name,
".gcc_compiled_long32"))
8133 else if (
startswith (name,
".gcc_compiled_long64"))
8135 else if (
startswith (name,
".gcc_compiled_long"))
8136 warning (
_(
"unrecognized .gcc_compiled_longXX"));
8144 for (i = 0; mips_abi_strings[i] != NULL; i++)
8145 if (mips_abi_strings[i] == mips_abi_string)
8161 for (i = 0; mips_compression_strings[i] != NULL; i++)
8162 if (mips_compression_strings[i] == mips_compression_string)
8165 internal_error (__FILE__, __LINE__,
_(
"unknown compressed ISA string"));
8185 static struct value *
8188 const int *reg_p = baton;
8192 static struct gdbarch *
8195 struct gdbarch *gdbarch;
8200 enum mips_fpu_type fpu_type;
8202 int elf_fpu_type = Val_GNU_MIPS_ABI_FP_ANY;
8203 const char **reg_names;
8212 mips_regnum.
fp0 = 32;
8213 mips_regnum.
pc = 64;
8214 mips_regnum.
cause = 65;
8216 mips_regnum.
hi = 67;
8217 mips_regnum.
lo = 68;
8220 mips_regnum.
dspacc = dspacc = -1;
8221 mips_regnum.
dspctl = dspctl = -1;
8227 mips_regnum.
fp0 = 38;
8228 mips_regnum.
pc = 37;
8229 mips_regnum.
cause = 36;
8231 mips_regnum.
hi = 34;
8232 mips_regnum.
lo = 33;
8252 mips_regnum.
dspacc = dspacc = -1;
8253 mips_regnum.
dspctl = dspctl = -1;
8265 static const char *
const mips_gprs[] = {
8266 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
8267 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
8268 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
8269 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31"
8271 static const char *
const mips_fprs[] = {
8272 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
8273 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
8274 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
8275 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
8282 "org.gnu.gdb.mips.cpu");
8283 if (feature == NULL)
8295 mips_regnum.
lo,
"lo");
8297 mips_regnum.
hi,
"hi");
8299 mips_regnum.
pc,
"pc");
8308 "org.gnu.gdb.mips.cp0");
8309 if (feature == NULL)
8321 mips_regnum.
cause,
"cause");
8332 "org.gnu.gdb.mips.fpu");
8333 if (feature == NULL)
8340 for (i = 0; i < 32; i++)
8342 i + mips_regnum.
fp0, mips_fprs[i]);
8361 "org.gnu.gdb.mips.dsp");
8363 if (feature != NULL)
8368 dspacc + i++,
"hi1");
8370 dspacc + i++,
"lo1");
8372 dspacc + i++,
"hi2");
8374 dspacc + i++,
"lo2");
8376 dspacc + i++,
"hi3");
8378 dspacc + i++,
"lo3");
8389 mips_regnum.
dspacc = dspacc;
8390 mips_regnum.
dspctl = dspctl;
8400 if (info.
abfd && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour)
8401 elf_flags = elf_elfheader (info.
abfd)->e_flags;
8402 else if (arches != NULL)
8408 "mips_gdbarch_init: elf_flags = 0x%08x\n", elf_flags);
8411 switch ((elf_flags & EF_MIPS_ABI))
8413 case E_MIPS_ABI_O32:
8416 case E_MIPS_ABI_O64:
8419 case E_MIPS_ABI_EABI32:
8422 case E_MIPS_ABI_EABI64:
8426 if ((elf_flags & EF_MIPS_ABI2))
8449 case bfd_mach_mips3900:
8452 case bfd_mach_mips4100:
8453 case bfd_mach_mips5000:
8456 case bfd_mach_mips8000:
8457 case bfd_mach_mips10000:
8461 if (bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour
8462 && elf_elfheader (info.
abfd)->e_ident[EI_CLASS] == ELFCLASS64)
8472 && info.
abfd != NULL
8473 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour
8474 && elf_elfheader (info.
abfd)->e_ident[EI_CLASS] == ELFCLASS64)
8490 mips_abi = wanted_abi;
8492 mips_abi = found_abi;
8500 if ((elf_flags & EF_MIPS_ARCH_ASE_MICROMIPS) != 0
8501 && (elf_flags & EF_MIPS_ARCH_ASE_M16) == 0)
8503 else if ((elf_flags & EF_MIPS_ARCH_ASE_M16) != 0
8504 && (elf_flags & EF_MIPS_ARCH_ASE_MICROMIPS) == 0)
8508 mips_compression_string = mips_compression_strings[
mips_isa];
8513 "mips_gdbarch_init: "
8514 "mips64_transfers_32bit_regs_p = %d\n",
8515 mips64_transfers_32bit_regs_p);
8520 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour)
8521 elf_fpu_type = bfd_elf_get_obj_attr_int (info.
abfd, OBJ_ATTR_GNU,
8522 Tag_GNU_MIPS_ABI_FP);
8525 if (!mips_fpu_type_auto)
8527 else if (elf_fpu_type != Val_GNU_MIPS_ABI_FP_ANY)
8529 switch (elf_fpu_type)
8531 case Val_GNU_MIPS_ABI_FP_DOUBLE:
8534 case Val_GNU_MIPS_ABI_FP_SINGLE:
8537 case Val_GNU_MIPS_ABI_FP_SOFT:
8548 case bfd_mach_mips3900:
8549 case bfd_mach_mips4100:
8550 case bfd_mach_mips4111:
8551 case bfd_mach_mips4120:
8554 case bfd_mach_mips4650:
8561 else if (arches != NULL)
8567 "mips_gdbarch_init: fpu_type = %d\n", fpu_type);
8578 if (tdesc_data != NULL)
8605 if (tdesc_data != NULL)
8764 if (info.
abfd != NULL)
8937 for (i = 0; i < ARRAY_SIZE (mips_n32_n64_aliases); i++)
8941 for (i = 0; i < ARRAY_SIZE (mips_o32_aliases); i++)
8946 for (i = 0; i < ARRAY_SIZE (mips_register_aliases); i++)
8950 for (i = 0; i < ARRAY_SIZE (mips_numeric_register_aliases); i++)
8951 user_reg_add (gdbarch, mips_numeric_register_aliases[i].name,
8953 &mips_numeric_register_aliases[i].regnum);
8975 const char *ignored_value)
8980 "The MIPS ABI is unknown because the current architecture "
8986 const char *actual_abi_str = mips_abi_strings[actual_abi];
8991 "The MIPS ABI is set automatically (currently \"%s\").\n",
8993 else if (global_abi == actual_abi)
8996 "The MIPS ABI is assumed to be \"%s\" (due to user setting).\n",
9002 "The (auto detected) MIPS ABI \"%s\" is in use "
9003 "even though the user setting was \"%s\".\n",
9004 actual_abi_str, mips_abi_strings[global_abi]);
9026 int ef_mips_32bitmode;
9047 ef_mips_32bitmode = (tdep->
elf_flags & EF_MIPS_32BITMODE);
9049 "mips_dump_tdep: tdep->elf_flags = 0x%x\n",
9052 "mips_dump_tdep: ef_mips_32bitmode = %d\n",
9055 "mips_dump_tdep: ef_mips_arch = %d\n",
9058 "mips_dump_tdep: tdep->mips_abi = %d (%s)\n",
9062 "mips_mask_address_p() %d (default %d)\n",
9067 "mips_dump_tdep: MIPS_DEFAULT_FPU_TYPE = %d (%s)\n",
9076 "mips_dump_tdep: MIPS_FPU_TYPE = %d (%s)\n",
9094 !=
sizeof (mips_abi_strings) /
sizeof (mips_abi_strings[0]))
9095 internal_error (__FILE__, __LINE__,
_(
"mips_abi_strings out of sync"));
9099 mips_pdr_data = register_objfile_data ();
9111 _(
"Various MIPS specific commands."),
9112 &setmipscmdlist,
"set mips ", 0, &
setlist);
9115 _(
"Various MIPS specific commands."),
9116 &showmipscmdlist,
"show mips ", 0, &
showlist);
9120 &mips_abi_string,
_(
"\
9121 Set the MIPS ABI used by this program."),
_(
"\
9122 Show the MIPS ABI used by this program."),
_(
"\
9123 This option can be set to one of:\n\
9124 auto - the default ABI associated with the current binary\n\
9133 &setmipscmdlist, &showmipscmdlist);
9140 &mips_compression_string,
_(
"\
9141 Set the compressed ISA encoding used by MIPS code."),
_(
"\
9142 Show the compressed ISA encoding used by MIPS code."),
_(
"\
9143 Select the compressed ISA encoding used in functions that have no symbol\n\
9144 information available. The encoding can be set to either of:\n\
9147 and is updated automatically from ELF file flags if available."),
9150 &setmipscmdlist, &showmipscmdlist);
9156 _(
"Set use of MIPS floating-point coprocessor."),
9157 &mipsfpulist,
"set mipsfpu ", 0, &
setlist);
9159 _(
"Select single-precision MIPS floating-point coprocessor."),
9162 _(
"Select double-precision MIPS floating-point coprocessor."),
9168 _(
"Select no MIPS floating-point coprocessor."), &mipsfpulist);
9173 _(
"Select MIPS floating-point coprocessor automatically."),
9176 _(
"Show current use of MIPS floating-point coprocessor target."),
9183 &heuristic_fence_post,
_(
"\
9184 Set the distance searched for the start of a function."),
_(
"\
9185 Show the distance searched for the start of a function."),
_(
"\
9186 If you are debugging a stripped executable, GDB needs to search through the\n\
9187 program for the start of a function. This command sets the distance of the\n\
9188 search. The only need to set it is when debugging a stripped executable."),
9197 &mask_address_var,
_(
"\
9198 Set zeroing of upper 32 bits of 64-bit addresses."),
_(
"\
9199 Show zeroing of upper 32 bits of 64-bit addresses."),
_(
"\
9200 Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to\n\
9201 allow GDB to determine the correct value."),
9203 &setmipscmdlist, &showmipscmdlist);
9208 &mips64_transfers_32bit_regs_p,
_(
"\
9209 Set compatibility with 64-bit MIPS target that transfers 32-bit quantities."),
9211 Show compatibility with 64-bit MIPS target that transfers 32-bit quantities."),
9213 Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\
9214 that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\
9215 64 bits for others. Use \"off\" to disable compatibility mode"),
9225 Set mips debugging."),
_(
"\
9226 Show mips debugging."),
_(
"\
9227 When non-zero, mips specific debugging is enabled."),
struct gdbarch * target_gdbarch(void)
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)
void val_print_scalar_formatted(struct type *type, const gdb_byte *valaddr, int embedded_offset, const struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
static int gdb_print_insn_mips_n64(bfd_vma memaddr, struct disassemble_info *info)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
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_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)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
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)
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)
int mips_pc_is_micromips(struct gdbarch *gdbarch, CORE_ADDR memaddr)
static int mips_insn16_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static CORE_ADDR mips32_next_pc(struct frame_info *frame, CORE_ADDR pc)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
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)
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 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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
#define MSYMBOL_LINKAGE_NAME(symbol)
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 store_signed_integer(gdb_byte *, int, enum bfd_endian, LONGEST)
CORE_ADDR mips_unmake_compact_addr(CORE_ADDR addr)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
static CORE_ADDR mips16_next_pc(struct frame_info *frame, CORE_ADDR pc)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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,...)
static void reinit_frame_cache_sfunc(char *, int, struct cmd_list_element *)
int fputc_filtered(int c, struct ui_file *stream)
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)
initialize_file_ftype _initialize_mips_tdep
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
struct ui_file * gdb_stdout
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)
enum breakpoint_here breakpoint_here_p(struct address_space *aspace, CORE_ADDR pc)
int mips_isa_regsize(struct gdbarch *gdbarch)
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 mips_remote_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
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)
static void set_reg_offset(struct gdbarch *gdbarch, struct mips_frame_cache *this_cache, int regnum, CORE_ADDR offset)
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype register_reggroup_p)
static void mips_read_fp_register_double(struct frame_info *frame, int regno, gdb_byte *rare_buffer)
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 mips_deal_with_atomic_sequence(struct gdbarch *gdbarch, struct address_space *aspace, CORE_ADDR pc)
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)
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)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
DOUBLEST unpack_double(struct type *type, const gdb_byte *valaddr, int *invp)
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)
struct address_space * get_frame_address_space(struct frame_info *frame)
int gdbarch_num_regs(struct gdbarch *gdbarch)
static int deal_with_atomic_sequence(struct gdbarch *gdbarch, struct address_space *aspace, CORE_ADDR pc)
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)
const gdb_byte * value_contents_for_printing(struct value *value)
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
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
struct gdbarch_tdep_info * tdep_info
#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)
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)
struct regcache * get_current_regcache(void)
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 store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
void printf_filtered(const char *format,...)
static void set_mips64_transfers_32bit_regs(char *args, int from_tty, struct cmd_list_element *c)
#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)
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)
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)
static CORE_ADDR mips32_bc1_pc(struct gdbarch *gdbarch, struct frame_info *frame, ULONGEST inst, CORE_ADDR pc, int count)
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)
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)
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)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void set_mipsfpu_single_command(char *args, int from_tty)
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)
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 CORE_ADDR extended_mips16_next_pc(struct frame_info *frame, CORE_ADDR pc, unsigned int extension, unsigned int insn)
static const char mips_compression_micromips[]
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)
void initialize_file_ftype(void)
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)
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 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)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
static int micromips_deal_with_atomic_sequence(struct gdbarch *gdbarch, struct address_space *aspace, CORE_ADDR pc)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
static LONGEST mips32_relative_offset(ULONGEST inst)
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
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
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
struct inferior_control_state control
void set_gdbarch_address_to_pointer(struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype address_to_pointer)
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)
void insert_single_step_breakpoint(struct gdbarch *gdbarch, struct address_space *aspace, CORE_ADDR next_pc)
static int mips_stab_reg_to_regnum(struct gdbarch *gdbarch, int num)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
#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 int is_branch(unsigned long inst)
static const struct frame_base mips_insn32_frame_base
static const struct objfile_data * mips_pdr_data
static void mips_print_float_info(struct gdbarch *, struct ui_file *, struct frame_info *, const char *)
struct target_desc * allocate_target_description(void)
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)
void deprecated_mips_set_processor_regs_hack(void)
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)
static void set_mips_command(char *args, int from_tty)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
unsigned int gdbarch_debug
void set_gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
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 CORE_ADDR micromips_next_pc(struct frame_info *frame, CORE_ADDR pc)
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)
void ax_simple(struct agent_expr *x, enum agent_op op)
static int startswith(const char *string, const char *pattern)
static CORE_ADDR micromips_bc1_pc(struct gdbarch *gdbarch, struct frame_info *frame, ULONGEST insn, CORE_ADDR pc, int count)
struct cmd_list_element * add_alias_cmd(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
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
void set_gdbarch_remote_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
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
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
int mips_pc_is_mips(CORE_ADDR memaddr)
struct ui_file * gdb_stdlog
static void mips_abi_update(char *ignore_args, int from_tty, struct cmd_list_element *c)
static void set_mipsfpu_auto_command(char *args, int from_tty)
void set_tdesc_property(struct target_desc *target_desc, const char *key, const char *value)
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)
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 print_scalar_formatted(const void *, struct type *, const struct value_print_options *, int, struct ui_file *)
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 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)
struct trad_frame_saved_reg * trad_frame_alloc_saved_regs(struct frame_info *this_frame)
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, struct tdesc_arch_data *early_data)
const char const char int
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
static int msymbol_is_mips(struct minimal_symbol *msym)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
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)
struct type * builtin_double
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)
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)
void gdbarch_info_init(struct gdbarch_info *info)
static int mips_convert_register_float_case_p(struct gdbarch *gdbarch, int regnum, struct type *type)
struct ui_file * gdb_stderr
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_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 void set_mipsfpu_command(char *args, int from_tty)
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 const char * mips_register_name(struct gdbarch *gdbarch, int regno)
static const gdb_byte * mips_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
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 mips_next_pc(struct frame_info *frame, 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
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)
static CORE_ADDR mips_read_pc(struct regcache *regcache)
static ULONGEST mips_fetch_instruction(struct gdbarch *gdbarch, enum mips_isa isa, CORE_ADDR addr, int *statusp)
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)
int value_embedded_offset(struct value *value)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int register_size(struct gdbarch *gdbarch, int regnum)
static const char * mips_irix_reg_names[NUM_MIPS_PROCESSOR_REGS]
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)
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)
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(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)
static void set_mipsfpu_double_command(char *args, int from_tty)
#define FIELD_BITPOS(thisfld)
LONGEST extract_signed_integer(const gdb_byte *, int, enum bfd_endian)
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 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
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)
static const char * mips_r3041_reg_names[]
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 void set_mipsfpu_none_command(char *args, int from_tty)
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)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
static unsigned int mips_debug
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)
int mips_software_single_step(struct frame_info *frame)
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)
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 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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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
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)
const ULONGEST const LONGEST len
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)
static void show_mips_command(char *args, int from_tty)