303 static const char *v850_reg_names[] =
304 {
"r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
305 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
306 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
307 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
308 "eipc",
"eipsw",
"fepc",
"fepsw",
"ecr",
"psw",
"sr6",
"sr7",
309 "sr8",
"sr9",
"sr10",
"sr11",
"sr12",
"sr13",
"sr14",
"sr15",
310 "sr16",
"sr17",
"sr18",
"sr19",
"sr20",
"sr21",
"sr22",
"sr23",
311 "sr24",
"sr25",
"sr26",
"sr27",
"sr28",
"sr29",
"sr30",
"sr31",
316 return v850_reg_names[
regnum];
322 static const char *v850e_reg_names[] =
324 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
325 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
326 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
327 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
328 "eipc",
"eipsw",
"fepc",
"fepsw",
"ecr",
"psw",
"sr6",
"sr7",
329 "sr8",
"sr9",
"sr10",
"sr11",
"sr12",
"sr13",
"sr14",
"sr15",
330 "ctpc",
"ctpsw",
"dbpc",
"dbpsw",
"ctbp",
"sr21",
"sr22",
"sr23",
331 "sr24",
"sr25",
"sr26",
"sr27",
"sr28",
"sr29",
"sr30",
"sr31",
336 return v850e_reg_names[
regnum];
342 static const char *v850e2_reg_names[] =
345 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
346 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
347 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
348 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
351 "eipc",
"eipsw",
"fepc",
"fepsw",
"ecr",
"psw",
"pid",
"cfg",
352 "",
"",
"",
"sccfg",
"scbp",
"eiic",
"feic",
"dbic",
353 "ctpc",
"ctpsw",
"dbpc",
"dbpsw",
"ctbp",
"dir",
"",
"",
354 "",
"",
"",
"",
"eiwr",
"fewr",
"dbwr",
"bsel",
361 "vsecr",
"vstid",
"vsadr",
"",
"vmecr",
"vmtid",
"vmadr",
"",
362 "vpecr",
"vptid",
"vpadr",
"",
"",
"",
"",
"",
363 "",
"",
"",
"",
"",
"",
"",
"",
364 "mca",
"mcs",
"mcc",
"mcr",
367 "mpm",
"mpc",
"tid",
"",
"",
"",
"ipa0l",
"ipa0u",
368 "ipa1l",
"ipa1u",
"ipa2l",
"ipa2u",
"ipa3l",
"ipa3u",
"ipa4l",
"ipa4u",
369 "dpa0l",
"dpa0u",
"dpa1l",
"dpa1u",
"dpa2l",
"dpa2u",
"dpa3l",
"dpa3u",
370 "dpa4l",
"dpa4u",
"dpa5l",
"dpa5u",
373 "",
"",
"",
"",
"",
"",
"fpsr",
"fpepc",
374 "fpst",
"fpcc",
"fpcfg",
"fpec",
"",
"",
"",
"",
375 "",
"",
"",
"",
"",
"",
"",
"",
380 return v850e2_reg_names[
regnum];
388 static const char *v850e3v5_reg_names[] =
391 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
392 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
393 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
394 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
398 "eipc",
"eipsw",
"fepc",
"fepsw",
401 "sesr",
"eiic",
"feic",
"",
402 "ctpc",
"ctpsw",
"",
"",
"ctbp",
"",
"",
"",
403 "",
"",
"",
"",
"eiwr",
"fewr",
"",
"bsel",
410 "",
"",
"",
"",
"",
"",
"",
"",
411 "",
"",
"",
"",
"",
"",
"",
"",
412 "",
"",
"",
"",
"",
"",
"",
"",
417 "",
"",
"",
"",
"",
"",
"",
"",
418 "",
"",
"",
"",
"",
"",
"",
"",
419 "",
"",
"",
"",
"",
"",
"",
"",
425 "",
"",
"",
"",
"",
"",
"fpsr",
"fpepc",
426 "fpst",
"fpcc",
"fpcfg",
"fpec",
"",
"",
"",
"",
427 "",
"",
"",
"",
"",
"",
"",
"",
431 "mcfg0",
"mcfg1",
"rbase",
"ebase",
"intbp",
"mctl",
"pid",
"fpipr",
432 "",
"",
"tcsel",
"sccfg",
"scbp",
"hvccfg",
"hvcbp",
"vsel",
433 "vmprt0",
"vmprt1",
"vmprt2",
"",
"",
"",
"",
"vmscctl",
434 "vmsctbl0",
"vmsctbl1",
"vmsctbl2",
"vmsctbl3",
"",
"",
"",
"",
437 "htcfg0",
"",
"",
"",
"",
"htctl",
"mea",
"asid",
438 "mei",
"ispr",
"pmr",
"icsr",
"intcfg",
"",
"",
"",
439 "tlbsch",
"",
"",
"",
"",
"",
"",
"htscctl",
440 "htsctbl0",
"htsctbl1",
"htsctbl2",
"htsctbl3",
441 "htsctbl4",
"htsctbl5",
"htsctbl6",
"htsctbl7",
444 "",
"",
"",
"",
"",
"",
"",
"",
445 "",
"",
"",
"",
"",
"",
"",
"",
446 "",
"",
"",
"",
"",
"",
"",
"",
447 "",
"",
"",
"",
"",
"",
"",
"",
450 "tlbidx",
"",
"",
"",
"telo0",
"telo1",
"tehi0",
"tehi1",
451 "",
"",
"tlbcfg",
"",
"bwerrl",
"bwerrh",
"brerrl",
"brerrh",
452 "ictagl",
"ictagh",
"icdatl",
"icdath",
453 "dctagl",
"dctagh",
"dcdatl",
"dcdath",
454 "icctrl",
"dcctrl",
"iccfg",
"dccfg",
"icerr",
"dcerr",
"",
"",
457 "mpm",
"mprc",
"",
"",
"mpbrgn",
"mptrgn",
"",
"",
458 "mca",
"mcs",
"mcc",
"mcr",
"",
"",
"",
"",
459 "",
"",
"",
"",
"mpprt0",
"mpprt1",
"mpprt2",
"",
460 "",
"",
"",
"",
"",
"",
"",
"",
463 "mpla0",
"mpua0",
"mpat0",
"",
"mpla1",
"mpua1",
"mpat1",
"",
464 "mpla2",
"mpua2",
"mpat2",
"",
"mpla3",
"mpua3",
"mpat3",
"",
465 "mpla4",
"mpua4",
"mpat4",
"",
"mpla5",
"mpua5",
"mpat5",
"",
466 "mpla6",
"mpua6",
"mpat6",
"",
"mpla7",
"mpua7",
"mpat7",
"",
469 "mpla8",
"mpua8",
"mpat8",
"",
"mpla9",
"mpua9",
"mpat9",
"",
470 "mpla10",
"mpua10",
"mpat10",
"",
"mpla11",
"mpua11",
"mpat11",
"",
471 "mpla12",
"mpua12",
"mpat12",
"",
"mpla13",
"mpua13",
"mpat13",
"",
472 "mpla14",
"mpua14",
"mpat14",
"",
"mpla15",
"mpua15",
"mpat15",
"",
475 "vr0",
"vr1",
"vr2",
"vr3",
"vr4",
"vr5",
"vr6",
"vr7",
476 "vr8",
"vr9",
"vr10",
"vr11",
"vr12",
"vr13",
"vr14",
"vr15",
477 "vr16",
"vr17",
"vr18",
"vr19",
"vr20",
"vr21",
"vr22",
"vr23",
478 "vr24",
"vr25",
"vr26",
"vr27",
"vr28",
"vr29",
"vr30",
"vr31",
483 return v850e3v5_reg_names[
regnum];
512 struct type *fld_type, *tgt_type;
602 long next = insn2 & 0xffff;
603 long list12 = ((insn & 1) << 16) + (next & 0xffe0);
604 long offset = (insn & 0x3e) << 1;
605 static struct reg_list reg_table[] =
623 if ((next & 0x1f) == 0x0b)
625 else if ((next & 0x1f) == 0x13)
627 else if ((next & 0x1f) == 0x1b)
632 for (i = 0; reg_table[i].
mask != 0; i++)
633 if (list12 & reg_table[i].
mask)
642 for (i = 0; reg_table[i].
mask != 0; i++)
644 if (list12 & reg_table[i].mask)
657 *current_pc_ptr = current_pc;
668 struct pifsr **pifsr_ptr)
671 long list12 = ((insn & 0x0f) << 16) + (insn2 & 0xfff0);
673 static struct reg_list pushml_reg_table[] =
693 static struct reg_list pushmh_reg_table[] =
717 if ((insn2 & 7) == 1)
718 reg_table = pushml_reg_table;
720 reg_table = pushmh_reg_table;
724 for (i = 0; reg_table[i].
mask != 0; i++)
725 if (list12 & reg_table[i].
mask)
734 for (i = 0; reg_table[i].
mask != 0; i++)
736 if (list12 & reg_table[i].mask)
781 struct pifsr pifsrs[E_NUM_REGS + 1];
789 memset (&pifsrs, 0,
sizeof pifsrs);
806 for (current_pc = func_addr; current_pc < prologue_end;)
813 if ((insn & 0x0780) >= 0x0600)
819 if ((insn & 0xffc0) == ((10 << 11) | 0x0780) && !regsave_func_p)
821 long low_disp = insn2 & ~(
long) 1;
822 long disp = (((((insn & 0x3f) << 16) + low_disp)
823 & ~(
long) 1) ^ 0x00200000) - 0x00200000;
825 save_pc = current_pc;
826 save_end = prologue_end;
828 current_pc += disp - 4;
829 prologue_end = (current_pc
836 else if ((insn & 0xffc0) == 0x0200 && !regsave_func_p)
838 long adr = ctbp + ((insn & 0x3f) << 1);
840 save_pc = current_pc;
841 save_end = prologue_end;
845 prologue_end = (current_pc
851 else if ((insn & 0xffc0) == 0x0780)
856 else if (insn == 0x07e0 && regsave_func_p && insn2 == 0x0144)
858 current_pc = save_pc;
859 prologue_end = save_end;
863 else if ((insn & 0xfff0) == 0x07e0 && (insn2 & 5) == 1)
868 else if ((insn & 0xffe0) == 0x0060 && regsave_func_p)
870 current_pc = save_pc;
871 prologue_end = save_end;
875 else if ((insn & 0x07c0) == 0x0780
876 || (insn & 0xffe0) == 0x0060
877 || (insn & 0x0780) == 0x0580)
882 else if ((insn & 0xffe0) == ((
E_SP_REGNUM << 11) | 0x0240))
884 pi->
sp_offset += ((insn & 0x1f) ^ 0x10) - 0x10;
893 r12_tmp = insn2 << 16;
906 else if (((insn & 0x07ff) == (0x0760 |
E_SP_REGNUM)
914 pifsr->
offset = insn2 & ~1;
919 && ((insn & 0x0781) == 0x0501)
925 pifsr->
offset = (insn & 0x007e) << 1;
933 for (pifsr_tmp = pifsrs; pifsr_tmp != pifsr; pifsr_tmp++)
956 if (sal.line != 0 && sal.end < func_end)
1010 struct value *
function,
1014 struct value **args,
1036 for (argnum = 0; argnum < nargs; argnum++)
1038 sp -= len + stack_offset;
1048 for (argnum = 0; argnum < nargs; argnum++)
1074 else if (stack_offset & 0x4)
1129 for (i = 0; len > 0; i += 4, len -= 4)
1132 memcpy (valbuf + i, buf, len > 4 ? 4 : len);
1152 for (i = 0; i <
len; i += 4)
1171 static const unsigned char *
1175 static unsigned char breakpoint[] = { 0x85, 0x05 };
1177 *lenptr =
sizeof (breakpoint);
1185 static const unsigned char *
1189 static unsigned char breakpoint[] = { 0x40, 0xf8 };
1191 *lenptr =
sizeof (breakpoint);
1226 *this_cache = cache;
1234 if (cache->
base == 0)
1280 static struct value *
1282 void **this_cache,
int regnum)
1298 if (cache->
base == 0)
1347 v850_frame_base_address
1350 static struct gdbarch *
1353 struct gdbarch *gdbarch;
1358 if (info.
abfd != NULL
1359 && bfd_get_flavour (info.
abfd) == bfd_target_elf_flavour)
1361 e_flags = elf_elfheader (info.
abfd)->e_flags;
1362 e_machine = elf_elfheader (info.
abfd)->e_machine;
1406 case bfd_mach_v850e:
1407 case bfd_mach_v850e1:
1411 case bfd_mach_v850e2:
1412 case bfd_mach_v850e2v3:
1416 case bfd_mach_v850e3v5:
1445 case bfd_mach_v850e2:
1446 case bfd_mach_v850e2v3:
1447 case bfd_mach_v850e3v5:
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)
static CORE_ADDR v850_frame_align(struct gdbarch *ignore, CORE_ADDR sp)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct type * builtin_func_ptr
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
CORE_ADDR get_frame_pc(struct frame_info *frame)
static CORE_ADDR v850_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
void set_gdbarch_fp0_regnum(struct gdbarch *gdbarch, int fp0_regnum)
static CORE_ADDR v850_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
struct value * trad_frame_get_prev_register(struct frame_info *this_frame, struct trad_frame_saved_reg this_saved_regs[], int regnum)
static const unsigned char * v850_dbtrap_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
int trad_frame_addr_p(struct trad_frame_saved_reg this_saved_regs[], int regnum)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
void trad_frame_set_value(struct trad_frame_saved_reg this_saved_regs[], int regnum, LONGEST val)
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
struct gdbarch_list * next
static struct v850_frame_cache * v850_frame_cache(struct frame_info *this_frame, void **this_cache)
int gdbarch_num_regs(struct gdbarch *gdbarch)
static const char * v850e2_register_name(struct gdbarch *gdbarch, int regnum)
const struct bfd_arch_info * bfd_arch_info
static void v850_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static void v850_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
#define TYPE_FIELD_TYPE(thistype, n)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
struct type * builtin_int32
#define FRAME_OBSTACK_ZALLOC(TYPE)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
static struct frame_id v850_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
static enum return_value_convention v850_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
void set_gdbarch_addr_bit(struct gdbarch *gdbarch, int addr_bit)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static CORE_ADDR v850_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR func_addr, CORE_ADDR pc, struct v850_frame_cache *pi, ULONGEST ctbp)
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)
static int v850_type_is_scalar(struct type *t)
void initialize_file_ftype(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
initialize_file_ftype _initialize_v850_tdep
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
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)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static void v850_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static int v850_use_struct_convention(struct gdbarch *gdbarch, struct type *type)
static struct type * v850_register_type(struct gdbarch *gdbarch, int regnum)
static CORE_ADDR v850_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static const char * v850_register_name(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
static const unsigned char * v850_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
static struct v850_frame_cache * v850_alloc_frame_cache(struct frame_info *this_frame)
static struct value * v850_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
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 const char * v850e3v5_register_name(struct gdbarch *gdbarch, int regnum)
static int v850_eight_byte_align_p(struct type *type)
static int v850_is_save_register(int reg)
struct trad_frame_saved_reg * trad_frame_alloc_saved_regs(struct frame_info *this_frame)
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
void set_gdbarch_char_signed(struct gdbarch *gdbarch, int char_signed)
#define TYPE_TARGET_TYPE(thistype)
static const char * v850e_register_name(struct gdbarch *gdbarch, int regnum)
#define TYPE_CODE(thistype)
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)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
static CORE_ADDR v850_frame_base_address(struct frame_info *this_frame, void **this_cache)
#define TYPE_NFIELDS(thistype)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
static void v850_handle_prepare(int insn, int insn2, CORE_ADDR *current_pc_ptr, struct v850_frame_cache *pi, struct pifsr **pifsr_ptr)
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
struct type * value_type(const struct value *value)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
static const struct frame_unwind v850_frame_unwind
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
struct type * builtin_uint64
static CORE_ADDR v850_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
void register_gdbarch_init(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init)
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)
CORE_ADDR value_address(const struct value *value)
struct trad_frame_saved_reg * saved_regs
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)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, struct gdbarch_tdep *tdep)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype inner_than)
static struct gdbarch * v850_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
static void v850_handle_pushm(int insn, int insn2, struct v850_frame_cache *pi, struct pifsr **pifsr_ptr)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
const ULONGEST const LONGEST len