- Copyright (C) 2000, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
-iq2000_pointer_to_address (struct type * type, const gdb_byte * buf)
+iq2000_pointer_to_address (struct gdbarch *gdbarch,
+ struct type * type, const gdb_byte * buf)
-iq2000_address_to_pointer (struct type *type, gdb_byte *buf, CORE_ADDR addr)
+iq2000_address_to_pointer (struct gdbarch *gdbarch,
+ struct type *type, gdb_byte *buf, CORE_ADDR addr)
enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
addr = insn_ptr_from_addr (addr);
enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
addr = insn_ptr_from_addr (addr);
- store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
+ store_unsigned_integer (buf, TYPE_LENGTH (type), byte_order, addr);
only later do we compute its actual address. Since the
offset can be zero, we must first initialize all the
saved regs to minus one (so we can later distinguish
only later do we compute its actual address. Since the
offset can be zero, we must first initialize all the
saved regs to minus one (so we can later distinguish
if ((insn & 0xffff8000) == 0x20218000)
{
/* addi %1, %1, -N == addi %sp, %sp, -N */
if ((insn & 0xffff8000) == 0x20218000)
{
/* addi %1, %1, -N == addi %sp, %sp, -N */
- return iq2000_scan_prologue (func_addr, func_end, NULL, &cache);
+ return iq2000_scan_prologue (gdbarch, func_addr, func_end, NULL, &cache);
static struct iq2000_frame_cache *
iq2000_frame_cache (struct frame_info *this_frame, void **this_cache)
{
static struct iq2000_frame_cache *
iq2000_frame_cache (struct frame_info *this_frame, void **this_cache)
{
cache = FRAME_OBSTACK_ZALLOC (struct iq2000_frame_cache);
iq2000_init_frame_cache (cache);
*this_cache = cache;
cache->base = get_frame_register_unsigned (this_frame, E_FP_REGNUM);
cache = FRAME_OBSTACK_ZALLOC (struct iq2000_frame_cache);
iq2000_init_frame_cache (cache);
*this_cache = cache;
cache->base = get_frame_register_unsigned (this_frame, E_FP_REGNUM);
current_pc = get_frame_pc (this_frame);
find_pc_partial_function (current_pc, NULL, &cache->pc, NULL);
if (cache->pc != 0)
current_pc = get_frame_pc (this_frame);
find_pc_partial_function (current_pc, NULL, &cache->pc, NULL);
if (cache->pc != 0)
- iq2000_scan_prologue (cache->pc, current_pc, this_frame, cache);
+ iq2000_scan_prologue (gdbarch, cache->pc, current_pc, this_frame, cache);
if (regnum == E_SP_REGNUM && cache->saved_sp)
return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
if (regnum == E_SP_REGNUM && cache->saved_sp)
return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
iq2000_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct frame_id *this_id)
{
iq2000_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct frame_id *this_id)
{
static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
if ((*pcptr & 3) != 0)
static const unsigned char little_breakpoint[] = { 0x0d, 0x00, 0x00, 0x00 };
if ((*pcptr & 3) != 0)
/* If the function's return value is 8 bytes or less, it is
returned in a register, and if larger than 8 bytes, it is
returned in a stack location which is pointed to by the same
/* If the function's return value is 8 bytes or less, it is
returned in a register, and if larger than 8 bytes, it is
returned in a stack location which is pointed to by the same
/* By using store_unsigned_integer we avoid having to
do anything special for small big-endian values. */
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
/* By using store_unsigned_integer we avoid having to
do anything special for small big-endian values. */
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
- store_unsigned_integer (valbuf, size, tmp);
+ store_unsigned_integer (valbuf, size, byte_order, tmp);
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
const bfd_byte *val;
bfd_byte buf[4];
struct type *type;
int i, argreg, typelen, slacklen;
int stackspace = 0;
const bfd_byte *val;
bfd_byte buf[4];
struct type *type;
int i, argreg, typelen, slacklen;
int stackspace = 0;
for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
{
type = value_type (args[i]);
for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
{
type = value_type (args[i]);
- argreg = E_LAST_ARGREG + 1; /* no more argregs. */
- /* 8-byte arg goes on stack, must be 8-byte aligned. */
+ argreg = E_LAST_ARGREG + 1; /* no more argregs. */
+ /* 8-byte arg goes on stack, must be 8-byte aligned. */
{
/* Structs are passed as pointer to a copy of the struct.
So we need room on the stack for a copy of the struct
{
/* Structs are passed as pointer to a copy of the struct.
So we need room on the stack for a copy of the struct
- /* Char, short, int, float, pointer, and structs <= four bytes. */
+ /* Char, short, int, float, pointer, and structs <= four bytes. */
slacklen = (4 - (typelen % 4)) % 4;
memset (buf, 0, sizeof (buf));
memcpy (buf + slacklen, val, typelen);
if (argreg <= E_LAST_ARGREG)
{
slacklen = (4 - (typelen % 4)) % 4;
memset (buf, 0, sizeof (buf));
memcpy (buf + slacklen, val, typelen);
if (argreg <= E_LAST_ARGREG)
{
else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type))
{
/* (long long), (double), or struct consisting of
else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type))
{
/* (long long), (double), or struct consisting of
if (((argreg - E_1ST_ARGREG) % 2) != 0)
argreg++;
regcache_raw_write (regcache, argreg++, val);
if (((argreg - E_1ST_ARGREG) % 2) != 0)
argreg++;
regcache_raw_write (regcache, argreg++, val);
- /* 8-byte arg goes on stack, must be 8-byte aligned. */
- argreg = E_LAST_ARGREG + 1; /* no more argregs. */
+ /* 8-byte arg goes on stack, must be 8-byte aligned. */
+ argreg = E_LAST_ARGREG + 1; /* no more argregs. */
stackspace = ((stackspace + 7) & ~7);
write_memory (sp + stackspace, val, typelen);
stackspace += 8;
stackspace = ((stackspace + 7) & ~7);
write_memory (sp + stackspace, val, typelen);
stackspace += 8;
- store_unsigned_integer (buf, 4, struct_ptr);
+ store_unsigned_integer (buf, 4, byte_order, struct_ptr);
regcache_cooked_write_unsigned (regcache, E_LR_REGNUM, bp_addr);
/* Update stack pointer. */
regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp);
regcache_cooked_write_unsigned (regcache, E_LR_REGNUM, bp_addr);
/* Update stack pointer. */
regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp);