36 #include "floatformat.h"
54 #include "gdb/sim-sh.h"
70 #define SH_NUM_REGS 67
113 static char *register_names[] = {
114 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
115 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
116 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
118 "",
"",
"",
"",
"",
"",
"",
"",
119 "",
"",
"",
"",
"",
"",
"",
"",
121 "",
"",
"",
"",
"",
"",
"",
"",
122 "",
"",
"",
"",
"",
"",
"",
"",
123 "",
"",
"",
"",
"",
"",
"",
"",
127 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
129 return register_names[reg_nr];
135 static char *register_names[] = {
136 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
137 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
138 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
140 "",
"",
"",
"",
"",
"",
"",
"",
141 "",
"",
"",
"",
"",
"",
"",
"",
143 "r0b0",
"r1b0",
"r2b0",
"r3b0",
"r4b0",
"r5b0",
"r6b0",
"r7b0",
144 "r0b1",
"r1b1",
"r2b1",
"r3b1",
"r4b1",
"r5b1",
"r6b1",
"r7b1"
145 "",
"",
"",
"",
"",
"",
"",
"",
149 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
151 return register_names[reg_nr];
157 static char *register_names[] = {
158 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
159 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
160 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
162 "fr0",
"fr1",
"fr2",
"fr3",
"fr4",
"fr5",
"fr6",
"fr7",
163 "fr8",
"fr9",
"fr10",
"fr11",
"fr12",
"fr13",
"fr14",
"fr15",
165 "r0b0",
"r1b0",
"r2b0",
"r3b0",
"r4b0",
"r5b0",
"r6b0",
"r7b0",
166 "r0b1",
"r1b1",
"r2b1",
"r3b1",
"r4b1",
"r5b1",
"r6b1",
"r7b1",
167 "",
"",
"",
"",
"",
"",
"",
"",
171 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
173 return register_names[reg_nr];
179 static char *register_names[] = {
180 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
181 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
182 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
184 "fr0",
"fr1",
"fr2",
"fr3",
"fr4",
"fr5",
"fr6",
"fr7",
185 "fr8",
"fr9",
"fr10",
"fr11",
"fr12",
"fr13",
"fr14",
"fr15",
187 "",
"",
"",
"",
"",
"",
"",
"",
188 "",
"",
"",
"",
"",
"",
"",
"",
189 "",
"",
"",
"",
"",
"",
"",
"",
193 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
195 return register_names[reg_nr];
201 static char *register_names[] = {
203 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
204 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
206 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
210 "fr0",
"fr1",
"fr2",
"fr3",
"fr4",
"fr5",
"fr6",
"fr7",
211 "fr8",
"fr9",
"fr10",
"fr11",
"fr12",
"fr13",
"fr14",
"fr15",
216 "r0b",
"r1b",
"r2b",
"r3b",
"r4b",
"r5b",
"r6b",
"r7b",
217 "r8b",
"r9b",
"r10b",
"r11b",
"r12b",
"r13b",
"r14b",
218 "machb",
"ivnb",
"prb",
"gbrb",
"maclb",
225 "ibcr",
"ibnr",
"tbr",
229 "dr0",
"dr2",
"dr4",
"dr6",
"dr8",
"dr10",
"dr12",
"dr14",
233 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
235 return register_names[reg_nr];
241 static char *register_names[] = {
243 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
244 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
246 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
250 "",
"",
"",
"",
"",
"",
"",
"",
251 "",
"",
"",
"",
"",
"",
"",
"",
256 "r0b",
"r1b",
"r2b",
"r3b",
"r4b",
"r5b",
"r6b",
"r7b",
257 "r8b",
"r9b",
"r10b",
"r11b",
"r12b",
"r13b",
"r14b",
258 "machb",
"ivnb",
"prb",
"gbrb",
"maclb",
265 "ibcr",
"ibnr",
"tbr",
269 "",
"",
"",
"",
"",
"",
"",
"",
273 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
275 return register_names[reg_nr];
281 static char *register_names[] = {
282 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
283 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
284 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
286 "a0g",
"a0",
"a1g",
"a1",
"m0",
"m1",
"x0",
"x1",
287 "y0",
"y1",
"",
"",
"",
"",
"",
"mod",
289 "rs",
"re",
"",
"",
"",
"",
"",
"",
290 "",
"",
"",
"",
"",
"",
"",
"",
291 "",
"",
"",
"",
"",
"",
"",
"",
295 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
297 return register_names[reg_nr];
303 static char *register_names[] = {
304 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
305 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
306 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
308 "a0g",
"a0",
"a1g",
"a1",
"m0",
"m1",
"x0",
"x1",
309 "y0",
"y1",
"",
"",
"",
"",
"",
"mod",
311 "rs",
"re",
"",
"",
"",
"",
"",
"",
312 "r0b",
"r1b",
"r2b",
"r3b",
"r4b",
"r5b",
"r6b",
"r7b",
313 "",
"",
"",
"",
"",
"",
"",
"",
314 "",
"",
"",
"",
"",
"",
"",
"",
318 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
320 return register_names[reg_nr];
326 static char *register_names[] = {
328 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
329 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
331 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
335 "fr0",
"fr1",
"fr2",
"fr3",
"fr4",
"fr5",
"fr6",
"fr7",
336 "fr8",
"fr9",
"fr10",
"fr11",
"fr12",
"fr13",
"fr14",
"fr15",
340 "r0b0",
"r1b0",
"r2b0",
"r3b0",
"r4b0",
"r5b0",
"r6b0",
"r7b0",
342 "r0b1",
"r1b1",
"r2b1",
"r3b1",
"r4b1",
"r5b1",
"r6b1",
"r7b1",
344 "",
"",
"",
"",
"",
"",
"",
"",
348 "dr0",
"dr2",
"dr4",
"dr6",
"dr8",
"dr10",
"dr12",
"dr14",
350 "fv0",
"fv4",
"fv8",
"fv12",
356 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
358 return register_names[reg_nr];
364 static char *register_names[] = {
366 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
367 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
369 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
373 "",
"",
"",
"",
"",
"",
"",
"",
374 "",
"",
"",
"",
"",
"",
"",
"",
378 "r0b0",
"r1b0",
"r2b0",
"r3b0",
"r4b0",
"r5b0",
"r6b0",
"r7b0",
380 "r0b1",
"r1b1",
"r2b1",
"r3b1",
"r4b1",
"r5b1",
"r6b1",
"r7b1",
382 "",
"",
"",
"",
"",
"",
"",
"",
386 "",
"",
"",
"",
"",
"",
"",
"",
392 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
394 return register_names[reg_nr];
400 static char *register_names[] = {
401 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
402 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
403 "pc",
"pr",
"gbr",
"vbr",
"mach",
"macl",
"sr",
405 "a0g",
"a0",
"a1g",
"a1",
"m0",
"m1",
"x0",
"x1",
406 "y0",
"y1",
"",
"",
"",
"",
"",
"mod",
408 "rs",
"re",
"",
"",
"",
"",
"",
"",
409 "r0b",
"r1b",
"r2b",
"r3b",
"r4b",
"r5b",
"r6b",
"r7b",
410 "",
"",
"",
"",
"",
"",
"",
"",
411 "",
"",
"",
"",
"",
"",
"",
"",
415 if (reg_nr >= (
sizeof (register_names) /
sizeof (*register_names)))
417 return register_names[reg_nr];
420 static const unsigned char *
424 static unsigned char breakpoint[] = { 0xc3, 0xc3 };
429 static unsigned char big_remote_breakpoint[] = { 0xc3, 0x20 };
430 static unsigned char little_remote_breakpoint[] = { 0x20, 0xc3 };
434 *lenptr =
sizeof (big_remote_breakpoint);
435 return big_remote_breakpoint;
439 *lenptr =
sizeof (little_remote_breakpoint);
440 return little_remote_breakpoint;
444 *lenptr =
sizeof (breakpoint);
457 #define GET_SOURCE_REG(x) (((x) >> 4) & 0xf)
458 #define GET_TARGET_REG(x) (((x) >> 8) & 0xf)
461 #define IS_JSR(x) (((x) & 0xf0ff) == 0x400b)
465 #define IS_STS(x) ((x) == 0x4f22)
469 #define IS_MACL_STS(x) ((x) == 0x4f12)
473 #define IS_PUSH(x) (((x) & 0xff0f) == 0x2f06)
477 #define IS_MOV_SP_FP(x) ((x) == 0x6ef3)
481 #define IS_ADD_IMM_SP(x) (((x) & 0xff00) == 0x7f00)
483 #define IS_MOV_R3(x) (((x) & 0xff00) == 0x1a00)
484 #define IS_SHLL_R3(x) ((x) == 0x4300)
488 #define IS_ADD_R3SP(x) ((x) == 0x3f3c)
496 #define IS_FPUSH(x) (((x) & 0xff0f) == 0xff0b)
499 #define IS_MOV_ARG_TO_REG(x) \
500 (((x) & 0xf00f) == 0x6003 && \
501 ((x) & 0x00f0) >= 0x0040 && \
502 ((x) & 0x00f0) <= 0x0070)
504 #define IS_MOV_ARG_TO_IND_R14(x) \
505 (((x) & 0xff0f) == 0x2e02 && \
506 ((x) & 0x00f0) >= 0x0040 && \
507 ((x) & 0x00f0) <= 0x0070)
509 #define IS_MOV_ARG_TO_IND_R14_WITH_DISP(x) \
510 (((x) & 0xff00) == 0x1e00 && \
511 ((x) & 0x00f0) >= 0x0040 && \
512 ((x) & 0x00f0) <= 0x0070)
515 #define IS_MOVW_PCREL_TO_REG(x) (((x) & 0xf000) == 0x9000)
517 #define IS_MOVL_PCREL_TO_REG(x) (((x) & 0xf000) == 0xd000)
519 #define IS_MOVI20(x) (((x) & 0xf00f) == 0x0000)
521 #define IS_SUB_REG_FROM_SP(x) (((x) & 0xff0f) == 0x3f08)
523 #define FPSCR_SZ (1 << 20)
526 #define IS_RESTORE_FP(x) ((x) == 0x6ef6)
527 #define IS_RTS(x) ((x) == 0x000b)
528 #define IS_LDS(x) ((x) == 0x4f26)
529 #define IS_MACL_LDS(x) ((x) == 0x4f16)
530 #define IS_MOV_FP_SP(x) ((x) == 0x6fe3)
531 #define IS_ADD_REG_TO_FP(x) (((x) & 0xff0f) == 0x3e0c)
532 #define IS_ADD_IMM_FP(x) (((x) & 0xff00) == 0x7e00)
544 int reg, sav_reg = -1;
547 for (; pc < limit_pc; pc += 2)
568 r3_val = ((inst & 0xff) ^ 0x80) - 0x80;
580 offset = ((inst & 0xff) ^ 0x80) - 0x80;
591 offset = (inst & 0xff) << 1;
605 offset = (inst & 0xff) << 2;
613 && (pc + 2 < limit_pc))
628 if (sav_offset & 0x00080000)
629 sav_offset |= 0xfff00000;
636 if (sav_reg > 0 && reg == sav_reg)
657 limit_pc =
min (limit_pc, pc + (2 * 6));
665 for (; pc < limit_pc; pc += 2)
677 offset = (inst & 0xf) * 4;
697 if (pc + 2 < limit_pc)
721 CORE_ADDR post_prologue_pc, func_addr, func_end_addr, limit_pc;
730 if (post_prologue_pc != 0)
731 return max (pc, post_prologue_pc);
743 limit_pc = pc + (2 * 28);
747 if (func_end_addr != 0)
748 limit_pc =
min (limit_pc, func_end_addr);
753 pc = post_prologue_pc;
818 if (len != 1 && len != 2 && len != 4 && len != 8)
914 memset (valbuf, 0,
sizeof (valbuf));
1002 return FLOAT_ARG0_REGNUM + argreg;
1054 struct value *
function,
1057 struct value **args,
1062 int stack_offset = 0;
1070 int len, reg_size = 0;
1094 for (argnum = 0; argnum < nargs; argnum++)
1126 || argnum > last_reg_arg)
1129 reg_size = (len + 3) & ~3;
1131 stack_offset += reg_size;
1196 struct value *
function,
1199 int nargs,
struct value **args,
1204 int stack_offset = 0;
1211 int len, reg_size = 0;
1231 for (argnum = 0; argnum < nargs; argnum++)
1251 || argnum > last_reg_arg)
1255 reg_size = (len + 3) & ~3;
1257 stack_offset += reg_size;
1321 for (i = 0; i <
len; i += 4)
1325 error (
_(
"bad size for return value"));
1337 for (i = 0; i <
len; i += 4)
1340 valbuf + len - 4 - i);
1371 for (i = 0; i <
len; i += 4)
1385 for (i = 0; i <
len; i += 4)
1388 valbuf + len - 4 - i);
1430 static struct type *
1444 static struct type *
1454 static struct type *
1461 static struct type *
1475 static struct type *
1568 (
"sh_register_convert_to_virtual called with non DR register number");
1589 error (
_(
"sh_register_convert_to_raw called with non DR register number"));
1625 for (portion = 0; portion < portions; portion++)
1630 b = buffer +
register_size (gdbarch, base_regnum) * portion;
1656 2, base_regnum, temp_buffer);
1662 temp_buffer, buffer);
1672 4, base_regnum, buffer);
1682 int base_regnum, portion;
1703 reg_nr, buffer, temp_buffer);
1706 for (portion = 0; portion < 2; portion++)
1710 base_regnum) * portion));
1717 for (portion = 0; portion < 4; portion++)
1721 base_regnum) * portion));
1733 return SIM_SH_MOD_REGNUM;
1735 return SIM_SH_RS_REGNUM;
1737 return SIM_SH_RE_REGNUM;
1749 return SIM_SH_TBR_REGNUM;
1751 return SIM_SH_IBNR_REGNUM;
1753 return SIM_SH_IBCR_REGNUM;
1755 return SIM_SH_BANK_REGNUM;
1757 return SIM_SH_BANK_MACL_REGNUM;
1759 return SIM_SH_BANK_GBR_REGNUM;
1761 return SIM_SH_BANK_PR_REGNUM;
1763 return SIM_SH_BANK_IVN_REGNUM;
1765 return SIM_SH_BANK_MACH_REGNUM;
1863 *this_cache = cache;
1871 if (cache->
base == 0)
1918 static struct value *
1920 void **this_cache,
int regnum)
1936 if (regnum < SH_NUM_REGS && cache->
saved_regs[regnum] != -1)
1950 if (cache->
base == 0)
1999 sh_frame_base_address
2022 if (*this_cache == NULL)
2024 cache = *this_cache;
2032 void **this_prologue_cache)
2073 if (addr < func_addr + 4)
2074 addr = func_addr + 4;
2079 while (addr < func_end
2082 if (addr >= func_end)
2121 while (addr > func_addr + 4
2132 && addr > func_addr + 6
2152 int regnum,
const void *regs,
size_t len)
2161 for (i = 0; regmap[i].
regnum != -1; i++)
2163 if ((regnum == -1 || regnum == regmap[i].regnum)
2166 (
char *)regs + regmap[i].
offset);
2187 for (i = 0; regmap[i].
regnum != -1; i++)
2189 if ((regnum == -1 || regnum == regmap[i].regnum)
2192 (
char *)regs + regmap[i].
offset);
2206 static const struct regset sh_corefile_fpregset =
2222 cb (
".reg", tdep->
sizeof_gregset, &sh_corefile_gregset, NULL, cb_data);
2225 cb (
".reg2", tdep->
sizeof_fpregset, &sh_corefile_fpregset, NULL, cb_data);
2240 static struct gdbarch *
2243 struct gdbarch *gdbarch;
2342 case bfd_mach_sh2a_nofpu:
2351 case bfd_mach_sh_dsp:
2357 case bfd_mach_sh3_nommu:
2358 case bfd_mach_sh2a_nofpu_or_sh3_nommu:
2363 case bfd_mach_sh2a_or_sh3e:
2375 case bfd_mach_sh3_dsp:
2382 case bfd_mach_sh2a_or_sh4:
2393 case bfd_mach_sh4_nofpu:
2394 case bfd_mach_sh4a_nofpu:
2395 case bfd_mach_sh4_nommu_nofpu:
2396 case bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu:
2400 case bfd_mach_sh4al_dsp:
2430 (
"\"set sh\" must be followed by an appropriate subcommand.\n");
2442 &setshcmdlist,
"set sh ", 0, &
setlist);
2444 &showshcmdlist,
"show sh ", 0, &
showlist);
2448 _(
"Set calling convention used when calling target "
2449 "functions from GDB."),
2450 _(
"Show calling convention used when calling target "
2451 "functions from GDB."),
2452 _(
"gcc - Use GCC calling convention (default).\n"
2453 "renesas - Enforce Renesas calling convention."),
2455 &setshcmdlist, &showshcmdlist);
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_double_bit(struct gdbarch *gdbarch, int double_bit)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
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)
#define IS_MOVL_PCREL_TO_REG(x)
#define IS_MOV_ARG_TO_IND_R14(x)
static int sh_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
static int sh_treat_as_flt_p(struct type *type)
CORE_ADDR get_frame_address_in_block(struct frame_info *this_frame)
static CORE_ADDR sh_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit_pc, struct sh_frame_cache *cache, ULONGEST fpscr)
static struct type * sh_default_register_type(struct gdbarch *gdbarch, int reg_nr)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
CORE_ADDR get_frame_pc(struct frame_info *frame)
static void pass_on_stack(struct aarch64_call_info *info, struct type *type, const bfd_byte *buf)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
void floatformat_from_doublest(const struct floatformat *fmt, const DOUBLEST *in, void *out)
#define IS_MOV_ARG_TO_IND_R14_WITH_DISP(x)
#define IS_MOV_ARG_TO_REG(x)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
#define IS_MOVW_PCREL_TO_REG(x)
static void sh_store_return_value_nofpu(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static int dr_reg_base_num(struct gdbarch *gdbarch, int dr_regnum)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
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 sh_corefile_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *regs, size_t len)
static CORE_ADDR sh_push_dummy_call_fpu(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 enum register_status sh_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, gdb_byte *buffer)
struct sh_corefile_regmap * core_fpregmap
struct sh_corefile_regmap * core_gregmap
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
#define IS_ADD_REG_TO_FP(x)
struct ui_file * gdb_stdout
static struct type * sh_sh4_build_float_register_type(struct gdbarch *gdbarch, int high)
static void sh_init_flt_argreg(void)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static struct value * sh_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static const char * sh_sh_dsp_register_name(struct gdbarch *gdbarch, int reg_nr)
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype register_reggroup_p)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
static CORE_ADDR sh_frame_base_address(struct frame_info *this_frame, void **this_cache)
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
static CORE_ADDR sh_stack_allocsize(int nargs, struct value **args)
CORE_ADDR saved_regs[SH_NUM_REGS]
struct reggroup *const all_reggroup
const struct bfd_arch_info * bfd_arch_info
void set_gdbarch_return_in_first_hidden_param_p(struct gdbarch *gdbarch, gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p)
static void sh_register_convert_to_virtual(struct gdbarch *gdbarch, int regnum, struct type *type, gdb_byte *from, gdb_byte *to)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
#define TYPE_FIELD_TYPE(thistype, n)
static const gdb_byte * sh_justify_value_in_reg(struct gdbarch *gdbarch, struct value *val, int len)
static CORE_ADDR sh_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
DOUBLEST extract_typed_floating(const void *addr, const struct type *type)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
void floatformat_to_doublest(const struct floatformat *fmt, const void *in, DOUBLEST *out)
static const char * sh_sh3_dsp_register_name(struct gdbarch *gdbarch, int reg_nr)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
static CORE_ADDR sh_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep)
static void sh_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static void sh_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
initialize_file_ftype _initialize_sh_tdep
#define IS_SUB_REG_FROM_SP(x)
static const char * sh_sh4al_dsp_register_name(struct gdbarch *gdbarch, int reg_nr)
struct reggroup *const float_reggroup
static CORE_ADDR sh_frame_align(struct gdbarch *ignore, CORE_ADDR sp)
static void sh_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const gdb_byte *buffer)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
struct cmd_list_element * setlist
static int sh_use_struct_convention(int renesas_abi, struct type *type)
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
struct type * check_typedef(struct type *type)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
const gdb_byte * value_contents(struct value *value)
struct reggroup *const general_reggroup
static const char * sh_sh2a_register_name(struct gdbarch *gdbarch, int reg_nr)
static const char *const sh_cc_enum[]
static struct type * sh_sh3e_register_type(struct gdbarch *gdbarch, int reg_nr)
void dwarf2_frame_set_init_reg(struct gdbarch *gdbarch, void(*init_reg)(struct gdbarch *, int, struct dwarf2_frame_state_reg *, struct frame_info *))
void initialize_file_ftype(void)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
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)
struct reggroup *const system_reggroup
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
static const char * sh_sh3_register_name(struct gdbarch *gdbarch, int reg_nr)
static int fv_reg_base_num(struct gdbarch *gdbarch, int fv_regnum)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
static int sh_dsp_register_sim_regno(struct gdbarch *gdbarch, int nr)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
static void set_sh_command(char *args, int from_tty)
struct cmd_list_element * showlist
int legacy_register_sim_regno(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_believe_pcc_promotion(struct gdbarch *gdbarch, int believe_pcc_promotion)
static struct type * sh_sh4_register_type(struct gdbarch *gdbarch, int reg_nr)
#define gdb_assert_not_reached(message)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
static int sh_is_renesas_calling_convention(struct type *func_type)
void set_gdbarch_register_sim_regno(struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype register_sim_regno)
static int flt_argreg_array[FLOAT_ARGLAST_REGNUM-FLOAT_ARG0_REGNUM+1]
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
void set_gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
static CORE_ADDR sh_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static enum register_status pseudo_register_read_portions(struct gdbarch *gdbarch, struct regcache *regcache, int portions, int base_regnum, gdb_byte *buffer)
static struct sh_frame_cache * sh_make_stub_cache(struct frame_info *this_frame)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
#define GET_SOURCE_REG(x)
static const char * sh_sh2a_nofpu_register_name(struct gdbarch *gdbarch, int reg_nr)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
void printf_unfiltered(const char *format,...)
#define GET_TARGET_REG(x)
void( iterate_over_regset_sections_cb)(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
static const char sh_cc_gcc[]
struct reggroup *const vector_reggroup
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
static int sh_sh2a_register_sim_regno(struct gdbarch *gdbarch, int nr)
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
void sh_corefile_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *regs, size_t len)
void regcache_invalidate(struct regcache *regcache, int regnum)
static const char * sh_sh2e_register_name(struct gdbarch *gdbarch, int reg_nr)
static int sh_use_struct_convention_nofpu(int renesas_abi, struct type *type)
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
static void show_sh_command(char *args, int from_tty)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
static enum return_value_convention sh_return_value_fpu(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static void sh_register_convert_to_raw(struct gdbarch *gdbarch, struct type *type, int regnum, const gdb_byte *from, gdb_byte *to)
void set_gdbarch_pseudo_register_read(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype pseudo_register_read)
static void sh_stub_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
#define TYPE_TARGET_TYPE(thistype)
struct type * builtin_double
int gdbarch_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
static void sh_dwarf2_frame_init_reg(struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, struct frame_info *this_frame)
static struct type * sh_sh2a_register_type(struct gdbarch *gdbarch, int reg_nr)
static void sh_store_return_value_fpu(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
static struct gdbarch * sh_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static int sh_next_flt_argreg(struct gdbarch *gdbarch, int len, struct type *func_type)
#define TYPE_CODE(thistype)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
static int in_plt_section(CORE_ADDR pc)
#define TYPE_CALLING_CONVENTION(thistype)
static const char * sh_sh_register_name(struct gdbarch *gdbarch, int reg_nr)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
static void sh_extract_return_value_fpu(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
#define TYPE_NFIELDS(thistype)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
static void sh_extract_return_value_nofpu(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static const char * sh_sh4_nofpu_register_name(struct gdbarch *gdbarch, int reg_nr)
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
static const char * sh_active_calling_convention
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static const struct frame_unwind sh_frame_unwind
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
int register_size(struct gdbarch *gdbarch, int regnum)
static struct sh_frame_cache * sh_alloc_frame_cache(void)
static struct frame_id sh_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
static const char sh_cc_renesas[]
struct type * value_type(const struct value *value)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
static struct sh_frame_cache * sh_frame_cache(struct frame_info *this_frame, void **this_cache)
int default_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *group)
static const char * sh_sh3e_register_name(struct gdbarch *gdbarch, int reg_nr)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
static int sh_stub_unwind_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
gdbarch_init_ftype sh64_gdbarch_init
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype iterate_over_regset_sections)
static int sh_return_in_first_hidden_param_p(struct gdbarch *gdbarch, struct type *type)
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 CORE_ADDR sh_push_dummy_call_nofpu(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static const char * sh_sh4_register_name(struct gdbarch *gdbarch, int reg_nr)
static int sh_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
enum bfd_endian byte_order
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
static enum return_value_convention sh_return_value_nofpu(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
enum dwarf2_frame_reg_rule how
void error(const char *fmt,...)
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)
void store_typed_floating(void *addr, const struct type *type, DOUBLEST val)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
static const unsigned char * sh_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
struct type * builtin_float
struct type * builtin_int
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
const ULONGEST const LONGEST len