33 #include "floatformat.h"
91 #define E_MAX_RETTYPE_SIZE(regnum) ((E_LST_ARG_REGNUM - (regnum) + 1) \
106 static char *register_names[] = {
107 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
108 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
114 _(
"xstormy16_register_name: illegal register number %d"),
117 return register_names[
regnum];
184 memcpy (buf, valbuf, 1);
226 struct value *
function,
237 int typelen, slacklen;
277 for (j = nargs - 1; j >= i; j--)
284 slacklen = typelen & 1;
285 val =
xmalloc (typelen + slacklen);
287 memcpy (val, bytes, typelen);
288 memset (val + typelen, 0, slacklen);
292 stack_dest += typelen + slacklen;
331 if (start_addr >= end_addr)
334 for (next_addr = start_addr;
342 if (inst >= 0x0082 && inst <= 0x008d)
344 regnum = inst & 0x000f;
350 else if (inst == 0x301f || inst == 0x303f)
352 cache->
framesize += ((inst & 0x0030) >> 4) + 1;
356 else if ((inst & 0xff0f) == 0x510f)
358 cache->
framesize += (inst & 0x00f0) >> 4;
362 else if (inst == 0x314f && inst2 >= 0x0010)
368 else if (inst == 0x46fd)
375 else if ((inst & 0xff00) == 0x4600
376 && (inst & 0x00f0) >= 0x0020 && (inst & 0x00f0) <= 0x0070
377 && (inst & 0x000f) >= 0x000a && (inst & 0x000f) <= 0x000d)
384 else if ((inst & 0xfed8) == 0x72d8 && (inst & 0x0007) >= 2)
386 regnum = inst & 0x0007;
389 offset = (
LONGEST) (inst2 & 0x0fff);
418 const char *func_name;
427 memset (&cache, 0,
sizeof cache);
441 if (sal.
end && sal.
end < func_end)
474 if (pc < func_end - 7 * xstormy16_inst_size)
480 xstormy16_inst_size, byte_order);
484 while ((addr -= xstormy16_inst_size) >= func_addr)
489 if (inst >= 0x009a && inst <= 0x009d)
491 if (inst == 0x305f || inst == 0x307f)
496 if (inst2 == 0x314f && inst >= 0x8000)
509 static const unsigned char *
513 static unsigned char breakpoint[] = { 0x06, 0x0 };
514 *lenptr =
sizeof (breakpoint);
541 addr = inst2 << 8 | (inst & 0xff);
591 faddr2 = inst2 << 8 | (inst & 0xff);
606 if (tmp && tmp != pc)
687 if (cache->
base == 0)
708 static struct value *
710 void **this_cache,
int regnum)
734 if (cache->
base == 0)
761 xstormy16_frame_base_address
788 static struct gdbarch *
791 struct gdbarch *gdbarch;
static CORE_ADDR xstormy16_frame_align(struct gdbarch *gdbarch, CORE_ADDR addr)
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)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
static void xstormy16_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
static void xstormy16_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
void set_gdbarch_dwarf2_addr_size(struct gdbarch *gdbarch, int dwarf2_addr_size)
CORE_ADDR get_frame_pc(struct frame_info *frame)
static struct gdbarch * xstormy16_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
static const unsigned char * xstormy16_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
struct bfd_section * the_bfd_section
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
initialize_file_ftype _initialize_xstormy16_tdep
static CORE_ADDR xstormy16_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR start_addr, CORE_ADDR end_addr, struct xstormy16_frame_cache *cache, struct frame_info *this_frame)
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 struct value * xstormy16_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static const struct frame_unwind xstormy16_frame_unwind
void internal_error(const char *file, int line, const char *fmt,...)
#define obj_section_endaddr(s)
static CORE_ADDR xstormy16_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
struct type * builtin_uint16
static CORE_ADDR xstormy16_resolve_jmp_table_entry(struct gdbarch *gdbarch, CORE_ADDR faddr)
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static int xstormy16_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
#define FRAME_OBSTACK_ZALLOC(TYPE)
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
#define obj_section_addr(s)
void set_gdbarch_addr_bit(struct gdbarch *gdbarch, int addr_bit)
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
static int xstormy16_type_is_scalar(struct type *t)
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
const gdb_byte * value_contents(struct value *value)
static CORE_ADDR xstormy16_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
void initialize_file_ftype(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
static CORE_ADDR xstormy16_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)
void set_gdbarch_stack_frame_destroyed_p(struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype stack_frame_destroyed_p)
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)
static CORE_ADDR xstormy16_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
void set_gdbarch_address_to_pointer(struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype address_to_pointer)
struct type * value_enclosing_type(struct value *value)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static CORE_ADDR xstormy16_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
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)
struct type * builtin_uint32
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static CORE_ADDR xstormy16_frame_base_address(struct frame_info *this_frame, void **this_cache)
void set_gdbarch_pointer_to_address(struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype pointer_to_address)
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
struct obj_section * find_pc_section(CORE_ADDR pc)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
CORE_ADDR saved_regs[E_NUM_REGS]
static const char * xstormy16_register_name(struct gdbarch *gdbarch, int regnum)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
static CORE_ADDR xstormy16_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
static int xstormy16_use_struct_convention(struct type *type)
void set_gdbarch_char_signed(struct gdbarch *gdbarch, int char_signed)
#define TYPE_TARGET_TYPE(thistype)
static void xstormy16_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
#define TYPE_CODE(thistype)
static void xstormy16_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
static CORE_ADDR xstormy16_find_jmp_table_entry(struct gdbarch *gdbarch, CORE_ADDR faddr)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
static struct xstormy16_frame_cache * xstormy16_alloc_frame_cache(void)
struct obj_section * sections_end
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
#define SYMBOL_LANGUAGE(symbol)
static enum return_value_convention xstormy16_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
static struct frame_id xstormy16_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
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)
static struct type * xstormy16_register_type(struct gdbarch *gdbarch, int regnum)
int core_addr_greaterthan(CORE_ADDR lhs, CORE_ADDR rhs)
#define TYPE_LENGTH(thistype)
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
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)
static struct xstormy16_frame_cache * xstormy16_frame_cache(struct frame_info *this_frame, void **this_cache)
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)
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 do_cleanups(struct cleanup *old_chain)
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
#define E_MAX_RETTYPE_SIZE(regnum)
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
const ULONGEST const LONGEST len