/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of GDB.
#include "regcache.h"
#include "gdb_string.h"
#include "gdb_assert.h"
-#include "gdbcore.h" /* for write_memory_unsigned_integer */
+#include "gdbcore.h" /* For write_memory_unsigned_integer. */
#include "value.h"
#include "gdbtypes.h"
#include "frame.h"
static void
mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
- struct regcache *regcache, const void *valbuf)
+ struct regcache *regcache, const gdb_byte *valbuf)
{
int len = TYPE_LENGTH (type);
int reg, regsz;
regcache_raw_write (regcache, reg, valbuf);
gdb_assert (regsz == register_size (gdbarch, reg + 1));
regcache_raw_write_part (regcache, reg+1, 0,
- len - regsz, (char *) valbuf + regsz);
+ len - regsz, valbuf + regsz);
}
else
internal_error (__FILE__, __LINE__,
mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
struct regcache *regcache, void *valbuf)
{
- char buf[MAX_REGISTER_SIZE];
+ gdb_byte buf[MAX_REGISTER_SIZE];
int len = TYPE_LENGTH (type);
int reg, regsz;
from WRITEBUF into REGCACHE. */
static enum return_value_convention
-mn10300_return_value (struct gdbarch *gdbarch, struct type *func_type,
+mn10300_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
mn10300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
int *bp_size)
{
- static char breakpoint[] = {0xff};
+ static gdb_byte breakpoint[] = {0xff};
*bp_size = 1;
return breakpoint;
}
struct mn10300_prologue *result)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR pc, next_pc;
+ CORE_ADDR pc;
int rn;
pv_t regs[MN10300_MAX_NUM_REGS];
struct pv_area *stack;
static CORE_ADDR
mn10300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
- char *name;
+ const char *name;
CORE_ADDR func_addr, func_end;
struct mn10300_prologue p;
void **this_prologue_cache,
struct frame_id *this_id)
{
- *this_id = frame_id_build (mn10300_frame_base (this_frame, this_prologue_cache),
+ *this_id = frame_id_build (mn10300_frame_base (this_frame,
+ this_prologue_cache),
get_frame_func (this_frame));
}
static const struct frame_unwind mn10300_frame_unwind = {
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
mn10300_frame_this_id,
mn10300_frame_prev_register,
NULL,
int len, arg_len;
int stack_offset = 0;
int argnum;
- char *val, valbuf[MAX_REGISTER_SIZE];
+ const gdb_byte *val;
+ gdb_byte valbuf[MAX_REGISTER_SIZE];
/* This should be a nop, but align the stack just in case something
went wrong. Stacks are four byte aligned on the mn10300. */
else
regs_used = 0;
- /* Push all arguments onto the stack. */
+ /* Push all arguments onto the stack. */
for (argnum = 0; argnum < nargs; argnum++)
{
/* FIXME what about structs? Unions? */
else
{
arg_len = TYPE_LENGTH (value_type (*args));
- val = (char *) value_contents (*args);
+ val = value_contents (*args);
}
while (regs_used < 2 && arg_len > 0)
Note that we don't update the return value though because that's
the value of the stack just after pushing the arguments, but prior
to performing the call. This value is needed in order to
- construct the frame ID of the dummy call. */
+ construct the frame ID of the dummy call. */
{
CORE_ADDR func_addr = find_function_addr (target_func, NULL);
CORE_ADDR unwound_sp
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Breakpoints. */
set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc);
- /* decr_pc_after_break? */
+ /* decr_pc_after_break? */
/* Disassembly. */
set_gdbarch_print_insn (gdbarch, print_insn_mn10300);
return gdbarch;
}
-/* Dump out the mn10300 specific architecture information. */
+/* Dump out the mn10300 specific architecture information. */
static void
mn10300_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)