75 return addr & 0x7fffffff
L;
81 return (ptr & 0x7fffffffL) | 0x80000000
L;
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",
146 #define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000)
147 #define ADDIU_REG_SRC(X) (((X) & 0x03e00000) >> 21)
148 #define ADDIU_REG_TGT(X) (((X) & 0x001f0000) >> 16)
149 #define ADDIU_IMMEDIATE(X) ((signed short) ((X) & 0x0000ffff))
152 #define INSN_IS_MOVE(X) (((X) & 0xffe007ff) == 0x00000025)
153 #define MOVE_REG_SRC(X) (((X) & 0x001f0000) >> 16)
154 #define MOVE_REG_TGT(X) (((X) & 0x0000f800) >> 11)
157 #define INSN_IS_STORE_WORD(X) (((X) & 0xfc000000) == 0xac000000)
158 #define SW_REG_INDEX(X) (((X) & 0x03e00000) >> 21)
159 #define SW_REG_SRC(X) (((X) & 0x001f0000) >> 16)
160 #define SW_OFFSET(X) ((signed short) ((X) & 0x0000ffff))
177 if (sal.
pc == 0 || sal.
line == 0 || sal.
end == 0)
186 while (sal.
pc && sal.
pc <
end);
209 int found_store_lr = 0;
210 int found_decr_sp = 0;
217 loop_end = scan_start + 100;
218 sal.
end = sal.
pc = 0;
235 for (srcreg = 0; srcreg <
E_NUM_REGS; srcreg ++)
240 for (pc = scan_start; pc < loop_end; pc += 4)
245 if ((insn & 0xffe00000) == 0xac200000)
249 tgtreg = ((insn >> 16) & 0x1f);
250 if (tgtreg >= 0 && tgtreg < E_NUM_REGS)
251 cache->
saved_regs[tgtreg] = -((
signed short) (insn & 0xffff));
258 if ((insn & 0xffff8000) == 0x20218000)
263 cache->
framesize = -((
signed short) (insn & 0xffff));
309 if (fi && sal.
end && (pc < sal.
end))
353 if (sal.end && sal.end < func_end)
399 static struct value *
412 if (regnum < E_NUM_REGS && cache->
saved_regs[regnum] != -1)
427 if (cache->
base == 0)
474 iq2000_frame_base_address
477 static const unsigned char *
481 static const unsigned char big_breakpoint[] = { 0x00, 0x00, 0x00, 0x0d };
482 static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
484 if ((*pcptr & 3) != 0)
485 error (
_(
"breakpoint_from_pc: invalid breakpoint address 0x%lx"),
490 == BFD_ENDIAN_BIG) ? big_breakpoint : little_breakpoint;
509 int size = len % 4 ?: 4;
512 memcpy (buf + 4 - size, valbuf, size);
515 valbuf = ((
char *) valbuf) +
size;
560 int size = len % 4 ?: 4;
567 valbuf = ((
char *) valbuf) +
size;
608 return ((sp + 7) & ~7);
654 int i, argreg, typelen, slacklen;
660 for (i = 0, argreg =
E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
691 stackspace = ((stackspace + 7) & ~7);
705 stackspace += ((typelen + 7) & ~7);
726 for (i = 0; i < nargs; i++)
734 slacklen = (4 - (typelen % 4)) % 4;
735 memset (buf, 0,
sizeof (buf));
736 memcpy (buf + slacklen, val, typelen);
766 stackspace = ((stackspace + 7) & ~7);
776 struct_ptr -= ((typelen + 7) & ~7);
803 static struct gdbarch *
806 struct gdbarch *gdbarch;
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)
static CORE_ADDR iq2000_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
void set_gdbarch_float_format(struct gdbarch *gdbarch, const struct floatformat **float_format)
static int iq2000_pass_8bytetype_by_address(struct type *type)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
static int iq2000_use_struct_convention(struct type *type)
static struct symtab_and_line find_last_line_symbol(CORE_ADDR start, CORE_ADDR end, int notcurrent)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
CORE_ADDR get_frame_pc(struct frame_info *frame)
static struct type * iq2000_register_type(struct gdbarch *gdbarch, int regnum)
static struct frame_id iq2000_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
#define INSN_IS_STORE_WORD(X)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
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)
static const char * iq2000_register_name(struct gdbarch *gdbarch, int regnum)
static struct value * iq2000_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static CORE_ADDR iq2000_frame_align(struct gdbarch *ignore, CORE_ADDR sp)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
static CORE_ADDR iq2000_frame_base_address(struct frame_info *this_frame, void **this_cache)
static CORE_ADDR iq2000_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
static CORE_ADDR iq2000_scan_prologue(struct gdbarch *gdbarch, CORE_ADDR scan_start, CORE_ADDR scan_end, struct frame_info *fi, struct iq2000_frame_cache *cache)
CORE_ADDR saved_regs[E_NUM_REGS]
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
struct type * builtin_int32
static const unsigned char * iq2000_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
#define TYPE_CODE_SPACE(t)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
static CORE_ADDR iq2000_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
const gdb_byte * value_contents(struct value *value)
void initialize_file_ftype(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
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)
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
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)
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 CORE_ADDR insn_ptr_from_addr(CORE_ADDR addr)
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)
void set_gdbarch_pointer_to_address(struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype pointer_to_address)
static CORE_ADDR iq2000_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
static CORE_ADDR insn_addr_from_ptr(CORE_ADDR ptr)
static struct iq2000_frame_cache * iq2000_frame_cache(struct frame_info *this_frame, void **this_cache)
#define TYPE_FIELDS(thistype)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_frame_args_skip(struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
static void iq2000_init_frame_cache(struct iq2000_frame_cache *cache)
static void iq2000_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
static void iq2000_extract_return_value(struct type *type, struct regcache *regcache, void *valbuf)
const char const char int
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
#define TYPE_TARGET_TYPE(thistype)
static struct gdbarch * iq2000_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
static void iq2000_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
#define TYPE_CODE(thistype)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
static const struct frame_unwind iq2000_frame_unwind
#define TYPE_NFIELDS(thistype)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
static void iq2000_store_return_value(struct type *type, struct regcache *regcache, const void *valbuf)
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)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
#define ADDIU_IMMEDIATE(X)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
initialize_file_ftype _initialize_iq2000_tdep
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)
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)
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, int struct_return, CORE_ADDR struct_addr)
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)
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)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
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