/* Target-dependent code for the Motorola 88000 series.
- Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "value.h"
#include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
#include "m88k-tdep.h"
/* Fetch the instruction at PC. */
static unsigned long
-m88k_fetch_instruction (CORE_ADDR pc)
+m88k_fetch_instruction (CORE_ADDR pc, enum bfd_endian byte_order)
{
- return read_memory_unsigned_integer (pc, 4);
+ return read_memory_unsigned_integer (pc, 4, byte_order);
}
/* Register information. */
}
/* Return the GDB type object for the "standard" data type of data in
- register REGNUM. */
+ register REGNUM. */
static struct type *
m88k_register_type (struct gdbarch *gdbarch, int regnum)
from WRITEBUF into REGCACHE. */
static enum return_value_convention
-m88k_return_value (struct gdbarch *gdbarch, struct type *func_type,
+m88k_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
prologue. */
static CORE_ADDR
-m88k_analyze_prologue (CORE_ADDR pc, CORE_ADDR limit,
+m88k_analyze_prologue (struct gdbarch *gdbarch,
+ CORE_ADDR pc, CORE_ADDR limit,
struct m88k_frame_cache *cache)
{
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR end = limit;
/* Provide a dummy cache if necessary. */
while (pc < limit)
{
struct m88k_prologue_insn *pi = m88k_prologue_insn_table;
- unsigned long insn = m88k_fetch_instruction (pc);
+ unsigned long insn = m88k_fetch_instruction (pc, byte_order);
while ((insn & pi->mask) != pi->insn)
pi++;
return sal.end;
}
- return m88k_analyze_prologue (pc, pc + m88k_max_prologue_size, NULL);
+ return m88k_analyze_prologue (gdbarch, pc, pc + m88k_max_prologue_size,
+ NULL);
}
static struct m88k_frame_cache *
m88k_frame_cache (struct frame_info *this_frame, void **this_cache)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct m88k_frame_cache *cache;
CORE_ADDR frame_sp;
cache->pc = get_frame_func (this_frame);
if (cache->pc != 0)
- m88k_analyze_prologue (cache->pc, get_frame_pc (this_frame), cache);
+ m88k_analyze_prologue (gdbarch, cache->pc, get_frame_pc (this_frame),
+ cache);
/* Calculate the stack pointer used in the prologue. */
if (cache->fp_offset != -1)
static const struct frame_unwind m88k_frame_unwind =
{
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
m88k_frame_this_id,
m88k_frame_prev_register,
NULL,
set_gdbarch_push_dummy_call (gdbarch, m88k_push_dummy_call);
set_gdbarch_dummy_id (gdbarch, m88k_dummy_id);
- /* Return value info */
+ /* Return value info. */
set_gdbarch_return_value (gdbarch, m88k_return_value);
set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove);