51 static char *register_names[] =
53 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
54 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
55 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
56 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
57 "epsr",
"fpsr",
"fpcr",
"sxip",
"snip",
"sfip"
60 if (regnum >= 0 && regnum < ARRAY_SIZE (register_names))
61 return register_names[
regnum];
104 static gdb_byte break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
106 *len =
sizeof (break_insn);
163 return (len == 1 || len == 2 || len == 4 || len == 8);
190 return (len == 4 || len == 8);
259 int num_register_words = 0;
260 int num_stack_words = 0;
263 for (i = 0; i < nargs; i++)
283 num_words += ((len + 3) / 4);
284 if (num_register_words + num_words <= 8)
286 num_register_words += num_words;
297 num_stack_words += ((len + 3) / 4);
301 sp =
align_down (sp - 32 - num_stack_words * 4, 16);
302 num_stack_words = num_register_words = 0;
304 for (i = 0; i < nargs; i++)
309 int stack_word = num_stack_words;
313 int register_word = num_register_words;
320 if (register_word + len / 8 < 8)
328 num_register_words = (register_word + len / 4);
337 num_stack_words = (stack_word + (len + 3) / 4);
401 memcpy (readbuf, buf, len);
407 memcpy (readbuf, buf + 4 - len, len);
417 memcpy (buf, writebuf, 8);
423 memcpy (buf + 4 - len, writebuf, len);
450 #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
451 #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
452 #define SUBU_OFFSET(x) ((unsigned)(x & 0xFFFF))
453 #define ST_OFFSET(x) ((unsigned)((x) & 0xFFFF))
454 #define ST_SRC(x) EXTRACT_FIELD ((x), 21, 5)
455 #define ADDU_OFFSET(x) ((unsigned)(x & 0xFFFF))
536 size_t sizeof_saved_regs =
540 cache->
saved_regs = alloca (sizeof_saved_regs);
552 while ((insn & pi->
mask) != pi->
insn)
563 return min (pc, end);
571 return min (pc, end);
588 return min (pc, end);
598 return min (pc, end);
614 return min (pc, end);
641 if (sal.
end < func_end && pc <= sal.
end)
713 if (cache->
base == 0)
719 static struct value *
721 void **this_cache,
int regnum)
772 m88k_frame_base_address
785 int regnum,
const void *gregs,
size_t len)
792 if (regnum == i || regnum == -1)
799 static const struct regset m88k_gregset =
813 cb (
".reg",
M88K_NUM_REGS * 4, &m88k_gregset, NULL, cb_data);
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
static CORE_ADDR m88k_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 void m88k_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
static struct type * m88k_register_type(struct gdbarch *gdbarch, int regnum)
static int m88k_8_byte_align_p(struct type *type)
static void m88k_write_pc(struct regcache *regcache, CORE_ADDR pc)
enum m88k_prologue_insn_action action
struct type * builtin_func_ptr
CORE_ADDR get_frame_pc(struct frame_info *frame)
struct value * trad_frame_get_prev_register(struct frame_info *this_frame, struct trad_frame_saved_reg this_saved_regs[], int regnum)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
struct trad_frame_saved_reg * saved_regs
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
LONGEST value_as_long(struct value *val)
void trad_frame_set_value(struct trad_frame_saved_reg this_saved_regs[], int regnum, LONGEST val)
void set_gdbarch_write_pc(struct gdbarch *gdbarch, gdbarch_write_pc_ftype write_pc)
void set_gdbarch_addr_bits_remove(struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype addr_bits_remove)
static struct m88k_frame_cache * m88k_frame_cache(struct frame_info *this_frame, void **this_cache)
static CORE_ADDR m88k_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
ULONGEST align_down(ULONGEST v, int n)
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void value_free(struct value *val)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
m88k_prologue_insn_action
#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)
static struct frame_id m88k_dummy_id(struct gdbarch *arch, struct frame_info *this_frame)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
static CORE_ADDR m88k_frame_base_address(struct frame_info *this_frame, void **this_cache)
void gdbarch_register(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep)
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)
struct type * check_typedef(struct type *type)
const gdb_byte * value_contents(struct value *value)
static struct value * m88k_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static enum return_value_convention m88k_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
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)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
struct m88k_prologue_insn m88k_prologue_insn_table[]
static CORE_ADDR m88k_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
static const gdb_byte * m88k_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pc, int *len)
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 int m88k_floating_p(const struct type *type)
struct value * value_cast(struct type *type, struct value *arg2)
static int m88k_in_register_p(struct type *type)
static CORE_ADDR m88k_store_arguments(struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp)
void( iterate_over_regset_sections_cb)(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
static unsigned long m88k_fetch_instruction(CORE_ADDR pc, enum bfd_endian byte_order)
static int m88k_integral_or_pointer_p(const struct type *type)
struct trad_frame_saved_reg * trad_frame_alloc_saved_regs(struct frame_info *this_frame)
void _initialize_m88k_tdep(void)
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
static void m88k_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
static CORE_ADDR m88k_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
#define TYPE_CODE(thistype)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
struct type * builtin_data_ptr
const int m88k_max_prologue_size
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
#define TYPE_NFIELDS(thistype)
enum register_status regcache_cooked_read(struct regcache *regcache, int regnum, gdb_byte *buf)
static void m88k_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
void release_value(struct value *val)
static int m88k_structure_or_union_p(const struct type *type)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
struct type * value_type(const struct value *value)
static CORE_ADDR m88k_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR limit, struct m88k_frame_cache *cache)
static struct gdbarch * m88k_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
static const struct frame_unwind m88k_frame_unwind
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
#define TYPE_LENGTH(thistype)
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 set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype iterate_over_regset_sections)
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)
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)
static const char * m88k_register_name(struct gdbarch *gdbarch, int regnum)
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 regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
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