23 #include "floatformat.h"
65 gdb_assert (len == 1 || len == 2 || len == 4 || len == 8);
92 gdb_assert (len == 4 || len == 8 || len == 16);
112 gdb_assert (len == 8 || len == 16 || len == 32);
232 "g0",
"g1",
"g2",
"g3",
"g4",
"g5",
"g6",
"g7",
233 "o0",
"o1",
"o2",
"o3",
"o4",
"o5",
"sp",
"o7",
234 "l0",
"l1",
"l2",
"l3",
"l4",
"l5",
"l6",
"l7",
235 "i0",
"i1",
"i2",
"i3",
"i4",
"i5",
"fp",
"i7",
237 "f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
"f7",
238 "f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
"f15",
239 "f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
"f23",
240 "f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
"f31",
241 "f32",
"f34",
"f36",
"f38",
"f40",
"f42",
"f44",
"f46",
242 "f48",
"f50",
"f52",
"f54",
"f56",
"f58",
"f60",
"f62",
254 #define SPARC64_NUM_REGS ARRAY_SIZE (sparc64_register_names)
261 "cwp",
"pstate",
"asi",
"ccr",
263 "d0",
"d2",
"d4",
"d6",
"d8",
"d10",
"d12",
"d14",
264 "d16",
"d18",
"d20",
"d22",
"d24",
"d26",
"d28",
"d30",
265 "d32",
"d34",
"d36",
"d38",
"d40",
"d42",
"d44",
"d46",
266 "d48",
"d50",
"d52",
"d54",
"d56",
"d58",
"d60",
"d62",
268 "q0",
"q4",
"q8",
"q12",
"q16",
"q20",
"q24",
"q28",
269 "q32",
"q36",
"q40",
"q44",
"q48",
"q52",
"q56",
"q60",
273 #define SPARC64_NUM_PSEUDO_REGS ARRAY_SIZE (sparc64_pseudo_register_names)
400 state = (state >> 0) & ((1 << 5) - 1);
403 state = (state >> 8) & ((1 << 12) - 1);
406 state = (state >> 24) & ((1 << 8) - 1);
409 state = (state >> 32) & ((1 << 8) - 1);
463 state |= ((bits & ((1 << 5) - 1)) << 0);
466 state |= ((bits & ((1 << 12) - 1)) << 8);
469 state |= ((bits & ((1 << 8) - 1)) << 24);
472 state |= ((bits & ((1 << 8) - 1)) << 32);
496 if (sal.
end < func_end
497 && start_pc <= sal.
end)
521 if (cache->
base == 0)
527 static struct value *
604 sparc64_frame_base_address
639 const gdb_byte *valbuf,
int element,
int bitpos)
668 gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128);
696 if (TYPE_NFIELDS (type) == 1)
729 gdb_assert (bitpos % 64 == 0 && bitpos >= 0 && bitpos < 256);
737 gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 256);
767 int num_elements = 0;
780 for (i = 0; i < nargs; i++)
793 num_elements += ((len + 7) / 8);
854 sp -= num_elements * 8;
879 for (i = 0; i < nargs; i++)
892 memset (buf, 0,
sizeof (buf));
893 valbuf = memcpy (buf, valbuf, len);
901 if (len > 8 && element < 5)
950 memcpy (buf + 4, valbuf, 4);
988 element += ((len + 7) / 8);
1002 return address & ~0xf;
1016 struct_return, struct_addr);
1047 for (i = 0; i < ((len + 7) / 8); i++)
1051 memcpy (valbuf, buf, len);
1056 for (i = 0; i < len / 4; i++)
1058 memcpy (valbuf, buf, len);
1065 for (i = 0; i < ((len + 7) / 8); i++)
1067 memcpy (valbuf, buf, len);
1077 memcpy (valbuf, buf + 8 - len, len);
1100 memset (buf, 0,
sizeof (buf));
1101 memcpy (buf, valbuf, len);
1102 for (i = 0; i < ((len + 7) / 8); i++)
1110 memcpy (buf, valbuf, len);
1111 for (i = 0; i < len / 4; i++)
1119 memset (buf, 0,
sizeof (buf));
1120 memcpy (buf, valbuf, len);
1121 for (i = 0; i < ((len + 7) / 8); i++)
1131 memcpy (buf + 8 - len, valbuf, len);
1228 #define TSTATE_CWP 0x000000000000001fULL
1229 #define TSTATE_ICC 0x0000000f00000000ULL
1230 #define TSTATE_XCC 0x000000f000000000ULL
1232 #define PSR_S 0x00000080
1233 #define PSR_ICC 0x00f00000
1234 #define PSR_VERS 0x0f000000
1235 #define PSR_IMPL 0xf0000000
1236 #define PSR_V8PLUS 0xff000000
1237 #define PSR_XCC 0x000f0000
1242 int regnum,
const void *gregs)
1255 int offset = gregmap->r_tstate_offset;
1284 regs + gregmap->r_tstate_offset);
1299 memcpy (buf + 8 - gregmap->
r_y_size,
1305 && gregmap->r_fprs_offset != -1)
1307 regs + gregmap->r_fprs_offset);
1322 if (regnum == i || regnum == -1)
1348 if (regnum == i || regnum == -1)
1371 int offset = gregmap->r_tstate_offset;
1378 tstate |= (psr &
PSR_ICC) << 12;
1380 tstate |= (psr &
PSR_XCC) << 20;
1382 memcpy (regs + offset, buf, 8);
1403 regs + gregmap->r_tstate_offset);
1423 && gregmap->r_fprs_offset != -1)
1425 regs + gregmap->r_fprs_offset);
1439 if (regnum == i || regnum == -1)
1458 if (regnum == i || regnum == -1)
1469 int regnum,
const void *fpregs)
1475 for (i = 0; i < 32; i++)
1490 for (i = 0; i < 16; i++)
1495 + (32 * 4) + (i * 8)));
1507 int regnum,
void *fpregs)
1513 for (i = 0; i < 32; i++)
1528 for (i = 0; i < 16; i++)
1533 + (32 * 4) + (i * 8)));
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
void sparc64_collect_fpregset(const struct sparc_fpregmap *fpregmap, const struct regcache *regcache, int regnum, void *fpregs)
void sparc64_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
static void sparc64_dwarf2_frame_init_reg(struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, struct frame_info *this_frame)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
static void sparc64_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *valbuf)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
int sparc_stack_frame_destroyed_p(struct gdbarch *gdbarch, CORE_ADDR pc)
struct type * builtin_func_ptr
struct type * builtin_long_double
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
struct type * arch_flags_type(struct gdbarch *gdbarch, char *name, int length)
static CORE_ADDR sparc64_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
struct sparc_frame_cache * sparc_frame_cache(struct frame_info *this_frame, void **this_cache)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void internal_error(const char *file, int line, const char *fmt,...)
void append_flags_type_flag(struct type *type, int bitpos, char *name)
union dwarf2_frame_state_reg::@51 loc
void set_gdbarch_stabs_argument_has_addr(struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
static enum register_status sparc64_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, gdb_byte *buf)
#define SPARC64_NUM_PSEUDO_REGS
ULONGEST get_frame_memory_unsigned(struct frame_info *this_frame, CORE_ADDR addr, int len)
static CORE_ADDR sparc64_store_arguments(struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
void sparc64_collect_gregset(const struct sparc_gregmap *gregmap, const struct regcache *regcache, int regnum, void *gregs)
static const char * sparc64_register_name(struct gdbarch *gdbarch, int regnum)
static const struct frame_unwind sparc64_frame_unwind
static void sparc64_store_floating_fields(struct regcache *regcache, struct type *type, const gdb_byte *valbuf, int element, int bitpos)
void sparc64_supply_gregset(const struct sparc_gregmap *gregmap, struct regcache *regcache, int regnum, const void *gregs)
#define bits(obj, st, fn)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
void sparc_supply_rwindow(struct regcache *regcache, CORE_ADDR sp, int regnum)
#define TYPE_FIELD_TYPE(thistype, n)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
static struct type * sparc64_pstate_type(struct gdbarch *gdbarch)
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)
ULONGEST sparc_fetch_wcookie(struct gdbarch *gdbarch)
static const char * sparc64_pseudo_register_names[]
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
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)
void dwarf2_frame_set_init_reg(struct gdbarch *gdbarch, void(*init_reg)(struct gdbarch *, int, struct dwarf2_frame_state_reg *, struct frame_info *))
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
unsigned short int saved_regs_mask
void set_gdbarch_stack_frame_destroyed_p(struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype stack_frame_destroyed_p)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
struct type * sparc64_fprs_type
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
void sparc64_supply_fpregset(const struct sparc_fpregmap *fpregmap, struct regcache *regcache, int regnum, const void *fpregs)
static struct type * sparc64_fprs_type(struct gdbarch *gdbarch)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
static void sparc64_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
struct value * value_cast(struct type *type, struct value *arg2)
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
static CORE_ADDR sparc64_frame_align(struct gdbarch *gdbarch, CORE_ADDR address)
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
#define TYPE_FIELD_BITPOS(thistype, n)
struct type * sparc64_fsr_type
static void sparc64_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
static struct type * sparc64_register_type(struct gdbarch *gdbarch, int regnum)
CORE_ADDR sparc_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct sparc_frame_cache *cache)
void set_gdbarch_push_dummy_code(struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype push_dummy_code)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
void set_gdbarch_pseudo_register_read(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype pseudo_register_read)
struct type * builtin_double
static CORE_ADDR sparc64_frame_base_address(struct frame_info *this_frame, void **this_cache)
static int sparc64_complex_floating_p(const struct type *type)
static int sparc64_16_byte_align_p(struct type *type)
#define TYPE_CODE(thistype)
unsigned char copied_regs_mask
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
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)
struct type * builtin_data_ptr
struct type * sparc64_pstate_type
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
#define TYPE_NFIELDS(thistype)
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
static struct sparc_frame_cache * sparc64_frame_cache(struct frame_info *this_frame, void **this_cache)
static CORE_ADDR sparc64_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 register_status regcache_cooked_read(struct regcache *regcache, int regnum, gdb_byte *buf)
static void sparc64_extract_floating_fields(struct regcache *regcache, struct type *type, gdb_byte *valbuf, int bitpos)
static int sparc64_floating_p(const struct type *type)
static struct value * sparc64_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
static void sparc64_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buf)
static const char * sparc64_register_names[]
static enum return_value_convention sparc64_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
static struct type * sparc64_fsr_type(struct gdbarch *gdbarch)
void set_gdbarch_call_dummy_location(struct gdbarch *gdbarch, int call_dummy_location)
unsigned long long ULONGEST
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
struct type * value_type(const struct value *value)
struct type * builtin_int64
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 regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
int default_stabs_argument_has_addr(struct gdbarch *gdbarch, struct type *type)
#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)
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)
enum dwarf2_frame_reg_rule how
static int sparc64_structure_or_union_p(const struct type *type)
static int sparc64_integral_or_pointer_p(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
void regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
struct type * builtin_float
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
const ULONGEST const LONGEST len