42#define M32R_ARG_REGISTER_SIZE 4
85 gdb_byte contents_cache[4];
86 gdb_byte bp_entry[] = { 0x10, 0xf1 };
101 buf[0] = bp_entry[0];
102 buf[1] = bp_entry[1];
103 buf[2] = contents_cache[2] & 0x7f;
104 buf[3] = contents_cache[3];
108 buf[0] = contents_cache[0];
109 buf[1] = contents_cache[1];
110 buf[2] = bp_entry[0];
111 buf[3] = bp_entry[1];
118 buf[0] = contents_cache[0];
119 buf[1] = contents_cache[1] & 0x7f;
120 buf[2] = bp_entry[1];
121 buf[3] = bp_entry[0];
125 buf[0] = bp_entry[1];
126 buf[1] = bp_entry[0];
127 buf[2] = contents_cache[2];
128 buf[3] = contents_cache[3];
146 buf[0] = contents_cache[0];
147 buf[1] = contents_cache[1];
148 buf[2] = contents_cache[2];
149 buf[3] = contents_cache[3];
154 if ((buf[0] & 0x80) == 0 && (buf[2] & 0x80) != 0)
159 if ((buf[3] & 0x80) == 0 && (buf[1] & 0x80) != 0)
173 if ((*pcptr & 3) == 0)
181static const gdb_byte *
184 static gdb_byte be_bp_entry[] = {
185 0x10, 0xf1, 0x70, 0x00
187 static gdb_byte le_bp_entry[] = {
188 0x00, 0x70, 0xf1, 0x10
201 return le_bp_entry + 2;
206 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
207 "r8",
"r9",
"r10",
"r11",
"r12",
"fp",
"lr",
"sp",
208 "psw",
"cbr",
"spi",
"spu",
"bpc",
"pc",
"accl",
"acch",
242 const gdb_byte *valbuf)
255 len - 4, byte_order);
265 CORE_ADDR start_pc, CORE_ADDR scan_limit,
266 CORE_ADDR *pl_endptr,
unsigned long *framelength)
269 unsigned long framesize;
273 CORE_ADDR after_push = 0;
274 CORE_ADDR after_stack_adjust = 0;
275 CORE_ADDR current_pc;
276 LONGEST return_value;
281 for (current_pc = start_pc; current_pc < scan_limit; current_pc += 2)
294 if (current_pc & 0x02)
303 if (current_pc == scan_limit)
322 if (((insn >> 8) == 0xe4)
333 if (insn & 0x00800000)
340 after_push = current_pc + 2;
346 if ((insn & 0xf0ff) == 0x207f)
352 if ((insn >> 8) == 0x4f)
355 int stack_adjust = (
signed char) (insn & 0xff);
362 if (stack_adjust < 0)
364 framesize -= stack_adjust;
368 after_stack_adjust = current_pc + 2;
385 if ((insn & 0xfff0) == 0x10f0)
391 if ((op1 == 0x7000) || (op1 == 0xb000) || (op1 == 0xf000))
399 int subop = insn & 0x0ff0;
400 if ((subop == 0x0ec0) || (subop == 0x0fc0))
409 *framelength = framesize;
411 if (current_pc >= scan_limit)
415 if (after_stack_adjust != 0)
420 *pl_endptr = after_stack_adjust;
422 else if (after_push != 0)
427 *pl_endptr = after_push;
435 *pl_endptr = start_pc;
452#define DEFAULT_SEARCH_LIMIT 128
458 CORE_ADDR func_addr, func_end;
460 LONGEST return_value;
468 if (sal.
line != 0 && sal.
end <= func_end)
520 void **this_prologue_cache)
522 CORE_ADDR pc, scan_limit;
530 if ((*this_prologue_cache))
534 (*this_prologue_cache) = info;
539 info->uses_frame = 0;
543 pc > 0 && pc < scan_limit; pc += 2)
548 if ((op & 0x80000000) == 0x80000000)
551 if ((op & 0xffff0000) == 0x8faf0000)
554 short n = op & 0xffff;
555 info->sp_offset += n;
557 else if (((op >> 8) == 0xe4)
562 unsigned long n = op & 0xffffff;
563 info->sp_offset += n;
567 if (pc == scan_limit)
576 if ((op & 0xf0ff) == 0x207f)
579 int regno = ((op >> 8) & 0xf);
580 info->sp_offset -= 4;
581 info->saved_regs[regno].set_addr (info->sp_offset);
583 else if ((op & 0xff00) == 0x4f00)
586 int n = (
signed char) (op & 0xff);
587 info->sp_offset += n;
589 else if (op == 0x1d8f)
592 info->uses_frame = 1;
593 info->r13_offset = info->sp_offset;
596 else if ((op & 0xfff0) == 0x10f0)
603 info->size = -info->sp_offset;
607 if (info->uses_frame)
615 prev_sp = this_base + info->size;
622 prev_sp = this_base + info->size;
627 info->base = this_base;
632 if (info->saved_regs[i].is_addr ())
633 info->saved_regs[i].set_addr (info->prev_sp
634 + info->saved_regs[i].addr ());
652 struct value **args, CORE_ADDR sp,
654 CORE_ADDR struct_addr)
657 int stack_offset, stack_alloc;
684 for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
685 stack_alloc += ((args[argnum]->
type ()->
length () + 3) & ~3);
688 for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
690 type = args[argnum]->type ();
694 memset (valbuf, 0,
sizeof (valbuf));
698 && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
701 args[argnum]->address ());
702 typecode = TYPE_CODE_PTR;
710 (gdb_byte *) args[argnum]->contents ().data (), len);
714 val = (gdb_byte *) args[argnum]->contents ().data ();
778 gdb_byte *readbuf,
const gdb_byte *writebuf)
780 if (valtype->
length () > 8)
786 if (writebuf != NULL)
797 void **this_prologue_cache,
struct frame_id *this_id)
817 base = info->prev_sp;
827 void **this_prologue_cache,
int regnum)
gdb_static_assert(sizeof(splay_tree_key) >=sizeof(CORE_ADDR *))
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep, gdbarch_supports_arch_info_ftype *supports_arch_info)
static std::vector< const char * > arches
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
int safe_read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
int default_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
ULONGEST get_frame_memory_unsigned(frame_info_ptr this_frame, CORE_ADDR addr, int len)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
#define FRAME_OBSTACK_ZALLOC(TYPE)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align)
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)
void set_gdbarch_wchar_bit(struct gdbarch *gdbarch, int wchar_bit)
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
void set_gdbarch_overlay_update(struct gdbarch *gdbarch, gdbarch_overlay_update_ftype *overlay_update)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value)
void set_gdbarch_wchar_signed(struct gdbarch *gdbarch, int wchar_signed)
int gdbarch_num_regs(struct gdbarch *gdbarch)
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than)
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type)
void set_gdbarch_memory_remove_breakpoint(struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call)
void set_gdbarch_memory_insert_breakpoint(struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
std::unique_ptr< gdbarch_tdep_base > gdbarch_tdep_up
struct gdbarch * gdbarch_init_ftype(struct gdbarch_info info, struct gdbarch_list *arches)
function_call_return_method
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
static CORE_ADDR after_prologue(CORE_ADDR pc)
static int m32r_memory_remove_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int m32r_memory_insert_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void _initialize_m32r_tdep()
static const gdb_byte * m32r_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
#define M32R_ARG_REGISTER_SIZE
static int m32r_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
static CORE_ADDR m32r_frame_base_address(frame_info_ptr this_frame, void **this_cache)
static struct type * m32r_register_type(struct gdbarch *gdbarch, int reg_nr)
static void m32r_frame_this_id(frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
static CORE_ADDR m32r_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
static void m32r_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *dst)
static struct m32r_unwind_cache * m32r_frame_unwind_cache(frame_info_ptr this_frame, void **this_prologue_cache)
static const struct frame_unwind m32r_frame_unwind
static const char *const m32r_register_names[]
static gdbarch_init_ftype m32r_gdbarch_init
static const char * m32r_register_name(struct gdbarch *gdbarch, int reg_nr)
static struct value * m32r_frame_prev_register(frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
static CORE_ADDR m32r_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr)
static const struct frame_base m32r_frame_base
#define DEFAULT_SEARCH_LIMIT
static void m32r_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static CORE_ADDR m32r_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static int decode_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR scan_limit, CORE_ADDR *pl_endptr, unsigned long *framelength)
static enum return_value_convention m32r_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
int register_size(struct gdbarch *gdbarch, int regnum)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
void(* func)(remote_target *remote, char *)
CORE_ADDR value_address() const
struct minimal_symbol * minsym
gdb_byte shadow_contents[BREAKPOINT_MAX]
struct type * builtin_func_ptr
struct type * builtin_data_ptr
struct type * builtin_int32
trad_frame_saved_reg * saved_regs
void simple_overlay_update(struct obj_section *osect)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int target_write_raw_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
trad_frame_saved_reg * trad_frame_alloc_saved_regs(struct gdbarch *gdbarch)
struct value * trad_frame_get_prev_register(frame_info_ptr this_frame, trad_frame_saved_reg this_saved_regs[], int regnum)