75 return addr & 0x7fffffffL;
81 return (ptr & 0x7fffffffL) | 0x80000000L;
89 struct type *
type,
const gdb_byte * buf)
96 if (target == TYPE_CODE_FUNC
97 || target == TYPE_CODE_METHOD
109 struct type *
type, gdb_byte *buf, CORE_ADDR addr)
114 if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
129 "r0",
"r1",
"r2",
"r3",
"r4",
130 "r5",
"r6",
"r7",
"r8",
"r9",
131 "r10",
"r11",
"r12",
"r13",
"r14",
132 "r15",
"r16",
"r17",
"r18",
"r19",
133 "r20",
"r21",
"r22",
"r23",
"r24",
134 "r25",
"r26",
"r27",
"r28",
"r29",
145#define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000)
146#define ADDIU_REG_SRC(X) (((X) & 0x03e00000) >> 21)
147#define ADDIU_REG_TGT(X) (((X) & 0x001f0000) >> 16)
148#define ADDIU_IMMEDIATE(X) ((signed short) ((X) & 0x0000ffff))
151#define INSN_IS_MOVE(X) (((X) & 0xffe007ff) == 0x00000025)
152#define MOVE_REG_SRC(X) (((X) & 0x001f0000) >> 16)
153#define MOVE_REG_TGT(X) (((X) & 0x0000f800) >> 11)
156#define INSN_IS_STORE_WORD(X) (((X) & 0xfc000000) == 0xac000000)
157#define SW_REG_INDEX(X) (((X) & 0x03e00000) >> 21)
158#define SW_REG_SRC(X) (((X) & 0x001f0000) >> 16)
159#define SW_OFFSET(X) ((signed short) ((X) & 0x0000ffff))
176 if (sal.
pc == 0 || sal.
line == 0 || sal.
end == 0)
185 while (sal.
pc && sal.
pc <
end);
199 CORE_ADDR scan_start,
212 if (scan_end == (CORE_ADDR) 0)
214 loop_end = scan_start + 100;
215 sal.
end = sal.
pc = 0;
232 for (srcreg = 0; srcreg <
E_NUM_REGS; srcreg ++)
237 for (
pc = scan_start;
pc < loop_end;
pc += 4)
242 if ((insn & 0xffe00000) == 0xac200000)
246 tgtreg = ((insn >> 16) & 0x1f);
248 cache->
saved_regs[tgtreg] = -((
signed short) (insn & 0xffff));
253 if ((insn & 0xffff8000) == 0x20218000)
257 cache->
framesize = -((
signed short) (insn & 0xffff));
303 if (fi && sal.
end && (
pc < sal.
end))
338 CORE_ADDR func_addr = 0 , func_end = 0;
347 if (sal.
end && sal.
end < func_end)
357 return (CORE_ADDR)
pc;
365 CORE_ADDR current_pc;
421 if (cache->
base == 0)
456 if ((*pcptr & 3) != 0)
457 error (_(
"breakpoint_from_pc: invalid breakpoint address 0x%lx"),
463static const gdb_byte *
466 static const unsigned char big_breakpoint[] = { 0x00, 0x00, 0x00, 0x0d };
490 int size = len % 4 ?: 4;
493 memcpy (buf + 4 -
size, valbuf,
size);
496 valbuf = ((
char *) valbuf) +
size;
507 return ((
type->
code () == TYPE_CODE_STRUCT)
508 || (
type->
code () == TYPE_CODE_UNION))
541 int size = len % 4 ?: 4;
555 ULONGEST return_buffer;
565 gdb_byte *readbuf,
const gdb_byte *writebuf)
589 return ((sp + 7) & ~7);
600 while (
type->
code () == TYPE_CODE_TYPEDEF)
603 if (
type->
code () != TYPE_CODE_STRUCT
604 &&
type->
code () != TYPE_CODE_UNION)
612 if (ftype->
length () != 8)
615 while (ftype->
code () == TYPE_CODE_TYPEDEF)
618 if (ftype->
code () == TYPE_CODE_FLT
619 || ftype->
code () == TYPE_CODE_INT)
628 int nargs,
struct value **args, CORE_ADDR sp,
630 CORE_ADDR struct_addr)
636 int i, argreg, typelen, slacklen;
639 CORE_ADDR struct_ptr;
646 type = args[i]->type ();
675 stackspace = ((stackspace + 7) & ~7);
689 stackspace += ((typelen + 7) & ~7);
710 for (i = 0; i < nargs; i++)
712 type = args[i]->type ();
714 val = args[i]->contents ().data ();
718 slacklen = (4 - (typelen % 4)) % 4;
719 memset (buf, 0,
sizeof (buf));
720 memcpy (buf + slacklen, val, typelen);
750 stackspace = ((stackspace + 7) & ~7);
760 struct_ptr -= ((typelen + 7) & ~7);
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 raw_write(int regnum, const gdb_byte *buf)
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)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
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)
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)
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)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
void set_gdbarch_address_to_pointer(struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer)
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_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)
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_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_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type)
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_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_pointer_to_address(struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address)
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_frame_args_skip(struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, gdbarch_tdep_up tdep)
function_call_return_method
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
#define TYPE_CODE_SPACE(t)
static CORE_ADDR iq2000_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 struct symtab_and_line find_last_line_symbol(CORE_ADDR start, CORE_ADDR end, int notcurrent)
static struct gdbarch * iq2000_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static struct iq2000_frame_cache * iq2000_frame_cache(frame_info_ptr this_frame, void **this_cache)
static void iq2000_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
static struct value * iq2000_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static struct type * iq2000_register_type(struct gdbarch *gdbarch, int regnum)
static void iq2000_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static CORE_ADDR insn_addr_from_ptr(CORE_ADDR ptr)
void _initialize_iq2000_tdep()
static const char * iq2000_register_name(struct gdbarch *gdbarch, int regnum)
static CORE_ADDR iq2000_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
static enum return_value_convention iq2000_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static void iq2000_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
static CORE_ADDR iq2000_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static void iq2000_init_frame_cache(struct iq2000_frame_cache *cache)
static CORE_ADDR insn_ptr_from_addr(CORE_ADDR addr)
#define ADDIU_IMMEDIATE(X)
static CORE_ADDR iq2000_frame_align(struct gdbarch *ignore, CORE_ADDR sp)
static const struct frame_unwind iq2000_frame_unwind
#define INSN_IS_STORE_WORD(X)
static int iq2000_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
static void iq2000_store_return_value(struct type *type, struct regcache *regcache, const void *valbuf)
static const gdb_byte * iq2000_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
static const struct frame_base iq2000_frame_base
static CORE_ADDR iq2000_frame_base_address(frame_info_ptr this_frame, void **this_cache)
static int iq2000_use_struct_convention(struct type *type)
static int iq2000_pass_8bytetype_by_address(struct type *type)
static CORE_ADDR iq2000_scan_prologue(struct gdbarch *gdbarch, CORE_ADDR scan_start, CORE_ADDR scan_end, frame_info_ptr fi, struct iq2000_frame_cache *cache)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
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)
constexpr gdb_byte little_breakpoint[]
constexpr gdb_byte big_breakpoint[]
struct type * builtin_int32
struct type * type() const
CORE_ADDR saved_regs[E_NUM_REGS]
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct symtab_and_line find_pc_line(CORE_ADDR, int)