124 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
125 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
126 "usp",
"isp",
"psw",
"pc",
"intb",
"bpsw",
"bpc",
"fintv",
186 CORE_ADDR
pc, next_pc;
189 CORE_ADDR after_last_frame_setup_insn = start_pc;
191 memset (result, 0,
sizeof (*result));
229 while (
pc < limit_pc)
233 RX_Opcode_Decoded opc;
235 opcode_handle.
pc =
pc;
238 next_pc =
pc + bytes_read;
240 if (opc.id == RXO_pushm
241 && opc.op[1].type == RX_Operand_Register
242 && opc.op[2].type == RX_Operand_Register)
249 for (r = r2; r >= r1; r--)
254 after_last_frame_setup_insn = next_pc;
256 else if (opc.id == RXO_mov
257 && opc.op[0].type == RX_Operand_Register
258 && opc.op[1].type == RX_Operand_Register
259 && opc.size == RX_Long)
263 rdst = opc.op[0].reg;
264 rsrc = opc.op[1].reg;
265 reg[rdst] = reg[rsrc];
267 after_last_frame_setup_insn = next_pc;
269 else if (opc.id == RXO_mov
270 && opc.op[0].type == RX_Operand_Predec
272 && opc.op[1].type == RX_Operand_Register
273 && opc.size == RX_Long)
277 rsrc = opc.op[1].
reg;
280 after_last_frame_setup_insn = next_pc;
282 else if (opc.id == RXO_add
283 && opc.op[0].type == RX_Operand_Register
284 && opc.op[1].type == RX_Operand_Immediate
285 && opc.op[2].type == RX_Operand_Register)
287 int rdst = opc.op[0].reg;
288 int addend = opc.op[1].addend;
289 int rsrc = opc.op[2].reg;
294 after_last_frame_setup_insn = next_pc;
296 else if (opc.id == RXO_mov
297 && opc.op[0].type == RX_Operand_Indirect
298 && opc.op[1].type == RX_Operand_Register
299 && opc.size == RX_Long
308 else if (opc.id == RXO_branch
309 && opc.op[0].type == RX_Operand_Immediate
310 && next_pc < opc.op[0].addend)
331 after_last_frame_setup_insn = opc.op[0].addend;
366 CORE_ADDR func_addr, func_end;
387 void **this_prologue_cache)
389 if (!*this_prologue_cache)
391 CORE_ADDR func_start, stop_addr;
401 stop_addr = func_start;
407 return (
struct rx_prologue *) *this_prologue_cache;
417 CORE_ADDR pc, start_pc, lim_pc;
420 RX_Opcode_Decoded opc;
422 gdb_assert (this_cache != NULL);
426 if (*this_cache != NULL)
446 opcode_handle.
pc = pc;
450 if (bytes_read <= 0 || opc.id == RXO_rts)
452 else if (opc.id == RXO_rtfi)
454 else if (opc.id == RXO_rte)
517 struct value *psw_val;
526 if ((psw & 0x20000 ) != 0)
583 gdb_assert (this_cache != NULL);
585 if (*this_cache == NULL)
661 struct value **args, CORE_ADDR sp,
663 CORE_ADDR struct_addr)
669 int num_register_candidate_args;
674 while (
func_type->code () == TYPE_CODE_PTR)
678 gdb_assert (
func_type->code () == TYPE_CODE_FUNC
679 ||
func_type->code () == TYPE_CODE_METHOD);
693 num_register_candidate_args =
func_type->num_fields () - 1;
695 num_register_candidate_args = 4;
699 for (write_pass = 0; write_pass <= 1; write_pass++)
705 sp = align_down (sp - sp_off, 4);
712 gdb_assert (return_type->code () == TYPE_CODE_STRUCT
713 ||
func_type->code () == TYPE_CODE_UNION);
715 if (return_type->length () > 16
716 || return_type->length () % 4 != 0)
725 for (i = 0; i < nargs; i++)
727 struct value *arg = args[i];
728 const gdb_byte *arg_bits = arg->
contents_all ().data ();
730 ULONGEST arg_size = arg_type->
length ();
732 if (i == 0 && struct_addr != 0
734 && arg_type->
code () == TYPE_CODE_PTR
736 byte_order) == struct_addr)
745 else if (arg_type->
code () != TYPE_CODE_STRUCT
746 && arg_type->
code () != TYPE_CODE_UNION
752 if (i < num_register_candidate_args
774 sp_off = align_up (sp_off, 4);
785 gdb_assert (arg_size <= 4);
790 if (i < num_register_candidate_args
804 struct type *p_arg_type =
806 p_arg_size = p_arg_type->
length ();
809 sp_off = align_up (sp_off, p_arg_size);
813 p_arg_size, byte_order,
815 sp_off += p_arg_size;
825 if (i < num_register_candidate_args
828 && arg_size % 4 == 0)
830 int len = std::min (arg_size, (ULONGEST) 4);
843 sp_off = align_up (sp_off, 4);
846 sp_off += align_up (arg_size, 4);
871 struct value *function,
872 struct type *valtype,
874 gdb_byte *readbuf,
const gdb_byte *writebuf)
877 ULONGEST valtype_len = valtype->
length ();
879 if (valtype->
length () > 16
880 || ((valtype->
code () == TYPE_CODE_STRUCT
881 || valtype->
code () == TYPE_CODE_UNION)
882 && valtype->
length () % 4 != 0))
891 while (valtype_len > 0)
893 int len = std::min (valtype_len, (ULONGEST) 4);
909 while (valtype_len > 0)
911 int len = std::min (valtype_len, (ULONGEST) 4);
933 if (0 <= reg && reg <= 15)
949 const struct target_desc *tdesc = info.target_desc;
952 if (info.abfd != NULL
953 && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
954 elf_flags = elf_elfheader (info.abfd)->e_flags;
966 = gdbarch_tdep<rx_gdbarch_tdep> (
arches->gdbarch);
980 const struct tdesc_feature *feature;
1027 if (elf_flags & E_FLAG_RX_64BIT_DOUBLES)
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)
struct gdbarch * target_gdbarch(void)
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)
#define BP_MANIPULATION(BREAK_INSN)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
void scan(void(*func)(void *closure, pv_t addr, CORE_ADDR size, pv_t value), void *closure)
void store(pv_t addr, CORE_ADDR size, pv_t value)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST 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 dwarf2_append_unwinders(struct gdbarch *gdbarch)
struct value * frame_unwind_got_memory(frame_info_ptr frame, int regnum, CORE_ADDR addr)
struct value * frame_unwind_got_register(frame_info_ptr frame, int regnum, int new_regnum)
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
struct value * frame_unwind_got_constant(frame_info_ptr frame, int regnum, ULONGEST val)
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)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
void set_gdbarch_char_signed(struct gdbarch *gdbarch, int char_signed)
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_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value)
void set_gdbarch_decr_pc_after_break(struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)
void set_gdbarch_double_bit(struct gdbarch *gdbarch, int double_bit)
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_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum)
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind)
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
void set_gdbarch_float_format(struct gdbarch *gdbarch, const struct floatformat **float_format)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call)
void set_gdbarch_vbit_in_delta(struct gdbarch *gdbarch, int vbit_in_delta)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
std::unique_ptr< gdbarch_tdep_base > gdbarch_tdep_up
function_call_return_method
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
struct type * check_typedef(struct type *type)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
pv_t pv_register(int reg, CORE_ADDR k)
pv_t pv_add_constant(pv_t v, CORE_ADDR k)
int pv_is_register(pv_t a, int r)
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)
static void check_for_saved(void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
static struct rx_prologue * rx_analyze_frame_prologue(frame_info_ptr this_frame, enum rx_frame_type frame_type, void **this_prologue_cache)
static void rx_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static CORE_ADDR rx_frame_base(frame_info_ptr this_frame, void **this_cache)
constexpr gdb_byte rx_break_insn[]
static enum return_value_convention rx_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int exception_frame_p(enum rx_frame_type frame_type)
static const struct frame_unwind rx_exception_unwind
static void rx_analyze_prologue(CORE_ADDR start_pc, CORE_ADDR limit_pc, enum rx_frame_type frame_type, struct rx_prologue *result)
static struct value * rx_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static int rx_frame_sniffer_common(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache, int(*sniff_p)(enum rx_frame_type))
static const char *const rx_register_names[]
@ RX_FRAME_TYPE_EXCEPTION
@ RX_FRAME_TYPE_FAST_INTERRUPT
void _initialize_rx_tdep()
static int normal_frame_p(enum rx_frame_type frame_type)
static const struct frame_unwind rx_frame_unwind
static struct gdbarch * rx_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static CORE_ADDR rx_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 int rx_get_opcode_byte(void *handle)
static int rx_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache)
static int rx_exception_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache)
static CORE_ADDR rx_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static void initialize_tdesc_rx(void)
const struct target_desc * tdesc_rx
struct type * rx_fpsw_type
struct type * rx_psw_type
int reg_offset[RX_NUM_REGS]
enum rx_frame_type frame_type
unsigned int num_fields() const
gdb::array_view< const gdb_byte > contents_all()
struct type * type() const
struct value::@203::@204 reg
tdesc_arch_data_up tdesc_data_alloc(void)
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
static const registry< gdbarch >::key< tdesc_arch_data > tdesc_data
void tdesc_use_registers(struct gdbarch *gdbarch, const struct target_desc *target_desc, tdesc_arch_data_up &&early_data, tdesc_unknown_register_ftype unk_reg_cb)
int tdesc_has_registers(const struct target_desc *target_desc)
std::unique_ptr< tdesc_arch_data, tdesc_arch_data_deleter > tdesc_arch_data_up
int target_read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)