45 if (ftype->
code () == TYPE_CODE_PTR)
48 return (ftype->
code () == TYPE_CODE_FUNC
66 int nargs,
struct value **args, CORE_ADDR sp,
68 CORE_ADDR struct_addr)
93 for (write_pass = 0; write_pass < 2; write_pass++)
107 int structoffset = argoffset + argspace;
122 for (argno = 0; argno < nargs; argno++)
124 struct value *arg = args[argno];
127 const bfd_byte *val = arg->
contents ().data ();
129 if (
type->
code () == TYPE_CODE_FLT && len <= 8
163 argoffset = align_up (argoffset, len);
169 else if (
type->
code () == TYPE_CODE_FLT
189 argoffset = align_up (argoffset, 8);
198 || (
type->
code () == TYPE_CODE_DECFLOAT
211 argoffset = align_up (argoffset, 8);
235 || (
type->
code () == TYPE_CODE_DECFLOAT
244 argoffset = align_up (argoffset, 8);
265 else if (
type->
code () == TYPE_CODE_DECFLOAT && len <= 8
282 memcpy (regval + 4, val, 4);
295 argoffset = align_up (argoffset, len);
304 else if (
type->
code () == TYPE_CODE_DECFLOAT && len == 16
324 argoffset = align_up (argoffset, 8);
348 for (i = 0; i < nelt; i++)
350 const gdb_byte *elval = val + i * eltype->
length ();
370 argoffset = align_up (argoffset, len);
376 else if (eltype->
length () == 8)
382 argoffset = align_up (argoffset, 8);
417 argoffset = align_up (argoffset, tdep->
wordsize);
434 for (i = 0; i < len / 16; i++)
436 const gdb_byte *elval = val + i * 16;
447 argoffset = align_up (argoffset, 16);
455 && ((
type->
code () == TYPE_CODE_ARRAY
474 argoffset = align_up (argoffset, 16);
500 argoffset = align_up (argoffset, 8);
513 ||
type->
code () == TYPE_CODE_STRUCT
514 ||
type->
code () == TYPE_CODE_UNION)
518 if (
type->
code () == TYPE_CODE_ARRAY
521 structoffset = align_up (structoffset, 16);
523 structoffset = align_up (structoffset, 8);
533 else if (
type->
code () == TYPE_CODE_INT)
539 memcpy (word, val, len);
550 argoffset = align_up (argoffset, tdep->
wordsize);
562 argspace = argoffset;
564 sp -= (argoffset + structoffset);
566 sp = align_down (sp, 16);
605 const gdb_byte *writebuf)
609 gdb_assert (valtype->
code () == TYPE_CODE_DECFLOAT);
612 if (valtype->
length () <= 8)
614 if (writebuf != NULL)
620 if (valtype->
length () == 4)
622 memcpy (regval + 4, writebuf, 4);
635 if (valtype->
length () == 4)
636 memcpy (readbuf, readbuf + 4, 4);
640 else if (valtype->
length () == 16)
642 if (writebuf != NULL || readbuf != NULL)
646 for (i = 0; i < 2; i++)
648 if (writebuf != NULL)
659 internal_error (_(
"Unknown decimal float size."));
682 gdb_byte *readbuf,
const gdb_byte *writebuf,
783 else if ((
type->
code () == TYPE_CODE_INT
813 if (
type->
code () == TYPE_CODE_ARRAY
821 for (i = 0; i < nelt; i++)
823 int offset = i * eltype->
length ();
825 if (eltype->
code () == TYPE_CODE_FLT)
831 if (writebuf != NULL)
841 readbuf + offset, eltype);
849 if (writebuf != NULL)
858 eltype->
length (), byte_order,
867 if (
type->
code () == TYPE_CODE_ARRAY
875 for (i = 0; i < n_regs; i++)
880 if (writebuf != NULL)
961 memcpy (readbuf, regvals + offset, len);
965 memset (regvals, 0,
sizeof regvals);
966 memcpy (regvals + offset, writebuf, len);
997 memset (regvals, 0,
sizeof regvals);
1013 gdb_byte *readbuf,
const gdb_byte *writebuf)
1016 function ? function->
type () : NULL,
1017 valtype,
regcache, readbuf, writebuf, 0);
1022 struct value *function,
1023 struct type *valtype,
1025 gdb_byte *readbuf,
const gdb_byte *writebuf)
1028 function ? function->
type () : NULL,
1029 valtype,
regcache, readbuf, writebuf, 1);
1058 if (dot_fn_section == NULL || dot_fn_section->
objfile == NULL)
1082 struct type **field_type)
1089 case TYPE_CODE_DECFLOAT:
1092 if ((*field_type)->code () ==
type->
code ()
1093 && (*field_type)->length () ==
type->
length ())
1097 case TYPE_CODE_COMPLEX:
1100 ||
type->
code () == TYPE_CODE_DECFLOAT)
1104 if ((*field_type)->code () ==
type->
code ()
1105 && (*field_type)->length () ==
type->
length ())
1110 case TYPE_CODE_ARRAY:
1115 if ((*field_type)->code () ==
type->
code ()
1116 && (*field_type)->length () ==
type->
length ())
1121 LONGEST count, low_bound, high_bound;
1130 count *= high_bound - low_bound;
1135 else if (
type->
length () != count * (*field_type)->length ())
1142 case TYPE_CODE_STRUCT:
1143 case TYPE_CODE_UNION:
1157 if (sub_count == -1)
1160 if (
type->
code () == TYPE_CODE_STRUCT)
1163 count = std::max (count, sub_count);
1169 else if (
type->
length () != count * (*field_type)->length ())
1190 struct type **elt_type,
int *n_elts,
1195 if (
type->
code () == TYPE_CODE_STRUCT
1196 ||
type->
code () == TYPE_CODE_UNION
1199 struct type *field_type = NULL;
1202 if (field_count > 0)
1206 if (field_type->
code () == TYPE_CODE_FLT
1212 else if (field_type->
code () == TYPE_CODE_FLT
1213 || field_type->
code () == TYPE_CODE_DECFLOAT)
1214 n_regs = (field_type->
length () + 7) >> 3;
1221 if (field_count * n_regs <= 8)
1224 *elt_type = field_type;
1226 *n_elts = (int) field_count;
1269 const bfd_byte *val,
int len,
int align,
1278 CORE_ADDR aligned_gparam = align_up (argpos->
gparam, align);
1281 argpos->
gparam = aligned_gparam;
1288 if (len < tdep->wordsize
1337 struct type *
type,
const bfd_byte *val,
1362 &&
type->
code () == TYPE_CODE_DECFLOAT)
1391 if (argpos->
freg <= 12)
1398 &&
type->
code () == TYPE_CODE_DECFLOAT)
1438 struct type *
type,
const bfd_byte *val,
1452 else if (
type->
code () == TYPE_CODE_FLT
1453 ||
type->
code () == TYPE_CODE_DECFLOAT)
1473 CORE_ADDR addr = align_up (argpos->
refparam, 16);
1481 else if ((
type->
code () == TYPE_CODE_INT
1499 ||
type->
code () == TYPE_CODE_REF))
1507 CORE_ADDR desc = word;
1527 if (
type->
code () == TYPE_CODE_STRUCT
1530 while (
type->
code () == TYPE_CODE_STRUCT
1534 if (
type->
code () == TYPE_CODE_FLT) {
1553 struct type *eltype;
1558 for (i = 0; i < nelt; i++)
1560 const gdb_byte *elval = val + i * eltype->
length ();
1562 if (eltype->
code () == TYPE_CODE_FLT
1563 && eltype->
length () == 16
1571 else if (eltype->
code () == TYPE_CODE_FLT
1572 || eltype->
code () == TYPE_CODE_DECFLOAT)
1576 else if (eltype->
code () == TYPE_CODE_ARRAY
1579 && eltype->
length () == 16)
1600 struct value *function,
1602 int nargs,
struct value **args, CORE_ADDR sp,
1604 CORE_ADDR struct_addr)
1610 ULONGEST back_chain;
1615 LONGEST refparam_size = 0;
1618 LONGEST gparam_size = 0;
1647 for (write_pass = 0; write_pass < 2; write_pass++)
1672 argpos.
refparam = align_down (sp - refparam_size, 16);
1678 sp = align_down (argpos.
gparam - 48, 16);
1680 sp = align_down (argpos.
gparam - 32, 16);
1691 for (argno = 0; argno < nargs; argno++)
1693 struct value *arg = args[argno];
1695 const bfd_byte *val = arg->
contents ().data ();
1697 if (
type->
code () == TYPE_CODE_COMPLEX)
1704 val + eltype->
length (), &argpos);
1712 struct type *eltype;
1721 for (i = 0; i < nelt; i++)
1723 const gdb_byte *elval = val + i * eltype->
length ();
1741 if (argpos.
greg < 8)
1744 gparam_size = argpos.
gparam;
1766 if (ftype->
code () == TYPE_CODE_PTR
1799 const gdb_byte *writebuf,
int index)
1804 if ((valtype->
code () == TYPE_CODE_INT
1805 || valtype->
code () == TYPE_CODE_ENUM
1806 || valtype->
code () == TYPE_CODE_CHAR
1807 || valtype->
code () == TYPE_CODE_BOOL
1808 || valtype->
code () == TYPE_CODE_RANGE
1810 && valtype->
length () <= 8)
1814 if (writebuf != NULL)
1823 unscaled.
read (gdb::make_array_view (writebuf,
1827 return_val = unscaled.
as_integer<LONGEST> ();
1835 if (readbuf != NULL)
1850 if (valtype->
length () <= 8
1851 && valtype->
code () == TYPE_CODE_FLT)
1857 if (writebuf != NULL)
1862 if (readbuf != NULL)
1872 if (valtype->
length () <= 8
1873 && valtype->
code () == TYPE_CODE_DECFLOAT)
1879 offset = 8 - valtype->
length ();
1881 if (writebuf != NULL)
1884 if (readbuf != NULL)
1891 if (valtype->
length () == 16
1892 && valtype->
code () == TYPE_CODE_FLT
1898 if (writebuf != NULL)
1903 if (readbuf != NULL)
1913 if (valtype->
length () == 16
1914 && valtype->
code () == TYPE_CODE_DECFLOAT)
1920 if (writebuf != NULL)
1925 if (readbuf != NULL)
1936 if (valtype->
length () == 16
1937 && ((valtype->
code () == TYPE_CODE_ARRAY
1940 || (valtype->
code () == TYPE_CODE_FLT
1946 if (writebuf != NULL)
1948 if (readbuf != NULL)
1954 if (valtype->
length () <= 8
1955 && valtype->
code () == TYPE_CODE_ARRAY && valtype->
is_vector ())
1961 offset = 8 - valtype->
length ();
1963 if (writebuf != NULL)
1966 if (readbuf != NULL)
1988 gdb_byte *readbuf,
const gdb_byte *writebuf)
1993 struct type *eltype;
2002 if (valtype->
code () == TYPE_CODE_COMPLEX)
2006 for (
int i = 0; i < 2; i++)
2009 readbuf, writebuf, i);
2013 readbuf += eltype->
length ();
2015 writebuf += eltype->
length ();
2023 if (valtype->
code () == TYPE_CODE_ARRAY && valtype->
is_vector ()
2026 if (valtype->
length () < 16)
2032 for (
int i = 0; i < nelt; i++)
2035 readbuf, writebuf, i);
2039 readbuf += eltype->
length ();
2041 writebuf += eltype->
length ();
2051 if (writebuf != NULL)
2053 if (readbuf != NULL)
2059 if (valtype->
code () == TYPE_CODE_ARRAY
2061 && valtype->
length () <= 8
2068 if (writebuf != NULL)
2071 if (readbuf != NULL)
2082 && (eltype->
code () == TYPE_CODE_FLT
2083 || eltype->
code () == TYPE_CODE_DECFLOAT
2084 || (eltype->
code () == TYPE_CODE_ARRAY
2087 && eltype->
length () == 16)))
2089 for (
int i = 0; i < nelt; i++)
2092 readbuf, writebuf, i);
2096 readbuf += eltype->
length ();
2098 writebuf += eltype->
length ();
2105 && valtype->
code () == TYPE_CODE_STRUCT)
2111 && valtype->
length () <= 16
2112 && (valtype->
code () == TYPE_CODE_STRUCT
2113 || valtype->
code () == TYPE_CODE_UNION
2114 || (valtype->
code () == TYPE_CODE_ARRAY
2120 for (
int i = 0; i < n_regs; i++)
2125 int len = valtype->
length () - offset;
2130 if (writebuf != NULL)
2132 memset (regval, 0,
sizeof regval);
2135 memcpy (regval + tdep->
wordsize - len, writebuf, len);
2137 memcpy (regval, writebuf + offset, len);
2140 if (readbuf != NULL)
2145 memcpy (readbuf, regval + tdep->
wordsize - len, len);
2147 memcpy (readbuf + offset, regval, len);
2155 readbuf, writebuf, 0))
2179 CORE_ADDR return_val = 0;
2194 catch (
const gdb_exception_error &e)
2196 warning (
"Cannot determine the function return value.\n"
2197 "Try compiling with -fvar-tracking.");
@ CALL_SITE_PARAMETER_DWARF_REG
enum register_status cooked_read_part(int regnum, int offset, int len, gdb_byte *buf)
enum register_status cooked_read(int regnum, gdb_byte *buf)
void cooked_write(int regnum, const gdb_byte *buf)
void cooked_write_part(int regnum, int offset, int len, 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 write_memory_signed_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, LONGEST value)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_long_double_format(struct gdbarch *gdbarch)
function_call_return_method
enum bfd_endian type_byte_order(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
const struct floatformat * floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]
const struct floatformat * floatformats_ieee_quad[BFD_ENDIAN_UNKNOWN]
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
bool is_fixed_point_type(struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_IS_REFERENCE(t)
#define TYPE_CALLING_CONVENTION(thistype)
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type, struct type **function_type)
struct language_pass_by_ref_info language_pass_by_reference(struct type *type)
struct value * value_of_dwarf_reg_entry(struct type *type, frame_info_ptr frame, enum call_site_parameter_kind kind, union call_site_parameter_u kind_u)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
struct obj_section * find_pc_section(CORE_ADDR pc)
CORE_ADDR ppc_sysv_abi_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 enum return_value_convention get_decimal_float_return_value(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
CORE_ADDR ppc64_sysv_abi_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 int ppc_sysv_use_opencl_abi(struct type *ftype)
enum return_value_convention ppc64_sysv_abi_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static enum return_value_convention do_ppc_sysv_return_value(struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf, int broken_gcc)
static void ppc64_sysv_abi_push_integer(struct gdbarch *gdbarch, ULONGEST val, struct ppc64_sysv_argpos *argpos)
static void ppc64_sysv_abi_push_param(struct gdbarch *gdbarch, struct type *type, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
CORE_ADDR ppc_sysv_get_return_buf_addr(struct type *val_type, frame_info_ptr cur_frame)
static int convert_code_addr_to_desc_addr(CORE_ADDR code_addr, CORE_ADDR *desc_addr)
enum return_value_convention ppc_sysv_abi_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static void ppc64_sysv_abi_push_val(struct gdbarch *gdbarch, const bfd_byte *val, int len, int align, struct ppc64_sysv_argpos *argpos)
static void ppc64_sysv_abi_push_vreg(struct gdbarch *gdbarch, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
static LONGEST ppc64_aggregate_candidate(struct type *type, struct type **field_type)
enum return_value_convention ppc_sysv_abi_broken_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int ppc64_elfv2_abi_homogeneous_aggregate(struct type *type, struct type **elt_type, int *n_elts, struct gdbarch *gdbarch)
static int ppc64_sysv_abi_return_value_base(struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf, int index)
static void ppc64_sysv_abi_push_freg(struct gdbarch *gdbarch, struct type *type, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
#define PPC_MAX_REGISTER_SIZE
int ppc_floating_point_unit_p(struct gdbarch *gdbarch)
int register_size(struct gdbarch *gdbarch, int regnum)
void regcache_cooked_write_signed(struct regcache *regcache, int regnum, LONGEST val)
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)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
CORE_ADDR value_address() const
struct minimal_symbol * minsym
struct type * type() const
void read(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p)
const char * linkage_name() const
struct regcache * regcache
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
gdb::array_view< const gdb_byte > contents()
struct type * type() const
void target_float_convert(const gdb_byte *from, const struct type *from_type, gdb_byte *to, const struct type *to_type)
CORE_ADDR value_as_address(struct value *val)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)