- Copyright (C) 2000, 2004, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
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
{
LONGEST insn = read_memory_unsigned_integer (pc, 4, byte_order);
/* Skip any instructions writing to (sp) or decrementing the
{
LONGEST insn = read_memory_unsigned_integer (pc, 4, byte_order);
/* Skip any instructions writing to (sp) or decrementing the
if ((insn & 0xffff8000) == 0x20218000)
{
/* addi %1, %1, -N == addi %sp, %sp, -N */
if ((insn & 0xffff8000) == 0x20218000)
{
/* addi %1, %1, -N == addi %sp, %sp, -N */
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);
current_pc = get_frame_pc (this_frame);
find_pc_partial_function (current_pc, NULL, &cache->pc, NULL);
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)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
store_unsigned_integer (valbuf, size, byte_order, tmp);
len -= size;
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
store_unsigned_integer (valbuf, size, byte_order, tmp);
len -= size;
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)
{
struct type *type;
int i, argreg, typelen, slacklen;
int stackspace = 0;
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;
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);
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_iq2000_tdep;
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_iq2000_tdep;