/* Target-dependent code for Mitsubishi D30V, for GDB.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GDB.
#include "dis-asm.h"
#include "symfile.h"
#include "objfiles.h"
+#include "regcache.h"
#include "language.h" /* For local_hex_string() */
int
-d30v_frame_chain_valid (chain, fi)
- CORE_ADDR chain;
- struct frame_info *fi; /* not used here */
+d30v_frame_chain_valid (CORE_ADDR chain, struct frame_info *fi)
{
#if 0
return ((chain) != 0 && (fi) != 0 && (fi)->return_pc != 0);
registers. */
void
-d30v_pop_frame ()
+d30v_pop_frame (void)
{
struct frame_info *frame = get_current_frame ();
CORE_ADDR fp;
}
static int
-check_prologue (op)
- unsigned long op;
+check_prologue (unsigned long op)
{
/* add sp,sp,imm -- observed */
if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
}
CORE_ADDR
-d30v_skip_prologue (pc)
- CORE_ADDR pc;
+d30v_skip_prologue (CORE_ADDR pc)
{
unsigned long op[2];
unsigned long opl, opr; /* left / right sub operations */
*/
CORE_ADDR
-d30v_frame_chain (frame)
- struct frame_info *frame;
+d30v_frame_chain (struct frame_info *frame)
{
struct frame_saved_regs fsr;
static int frame_size;
static int
-prologue_find_regs (op, fsr, addr)
- unsigned long op;
- struct frame_saved_regs *fsr;
- CORE_ADDR addr;
+prologue_find_regs (unsigned long op, struct frame_saved_regs *fsr,
+ CORE_ADDR addr)
{
int n;
int offset;
ways in the stack frame. sp is even more special: the address we
return for it IS the sp for the next frame. */
void
-d30v_frame_find_saved_regs (fi, fsr)
- struct frame_info *fi;
- struct frame_saved_regs *fsr;
+d30v_frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
{
CORE_ADDR fp, pc;
unsigned long opl, opr;
}
void
-d30v_frame_find_saved_regs_offsets (fi, fsr)
- struct frame_info *fi;
- struct frame_saved_regs *fsr;
+d30v_frame_find_saved_regs_offsets (struct frame_info *fi,
+ struct frame_saved_regs *fsr)
{
CORE_ADDR fp, pc;
unsigned long opl, opr;
}
void
-d30v_init_extra_frame_info (fromleaf, fi)
- int fromleaf;
- struct frame_info *fi;
+d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
struct frame_saved_regs dummy;
}
void
-d30v_init_frame_pc (fromleaf, prev)
- int fromleaf;
- struct frame_info *prev;
+d30v_init_frame_pc (int fromleaf, struct frame_info *prev)
{
/* default value, put here so we can breakpoint on it and
see if the default value is really the right thing to use */
static void d30v_print_register (int regnum, int tabular);
static void
-d30v_print_register (regnum, tabular)
- int regnum;
- int tabular;
+d30v_print_register (int regnum, int tabular)
{
if (regnum < A0_REGNUM)
{
}
static void
-d30v_print_flags ()
+d30v_print_flags (void)
{
long psw = read_register (PSW_REGNUM);
printf_filtered ("flags #1");
}
static void
-print_flags_command (args, from_tty)
- char *args;
- int from_tty;
+print_flags_command (char *args, int from_tty)
{
d30v_print_flags ();
}
void
-d30v_do_registers_info (regnum, fpregs)
- int regnum;
- int fpregs;
+d30v_do_registers_info (int regnum, int fpregs)
{
long long num1, num2;
long psw;
}
CORE_ADDR
-d30v_fix_call_dummy (dummyname, start_sp, fun, nargs, args, type, gcc_p)
- char *dummyname;
- CORE_ADDR start_sp;
- CORE_ADDR fun;
- int nargs;
- value_ptr *args;
- struct type *type;
- int gcc_p;
+d30v_fix_call_dummy (char *dummyname, CORE_ADDR start_sp, CORE_ADDR fun,
+ int nargs, struct value **args,
+ struct type *type, int gcc_p)
{
int regnum;
CORE_ADDR sp;
}
static void
-d30v_pop_dummy_frame (fi)
- struct frame_info *fi;
+d30v_pop_dummy_frame (struct frame_info *fi)
{
CORE_ADDR sp = fi->dummy;
int regnum;
CORE_ADDR
-d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
- int nargs;
- value_ptr *args;
- CORE_ADDR sp;
- int struct_return;
- CORE_ADDR struct_addr;
+d30v_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int i, len, index = 0, regnum = 2;
char buffer[4], *contents;
/* Pass 1. Put all large args on stack */
for (i = 0; i < nargs; i++)
{
- value_ptr arg = args[i];
+ struct value *arg = args[i];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (arg_type);
contents = VALUE_CONTENTS (arg);
for (i = 0; i < nargs; i++)
{
- value_ptr arg = args[i];
+ struct value *arg = args[i];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (arg_type);
contents = VALUE_CONTENTS (arg);
/* restored. */
CORE_ADDR
-d30v_call_dummy_address ()
+d30v_call_dummy_address (void)
{
CORE_ADDR entry;
struct minimal_symbol *sym;
extract and copy its value into `valbuf'. */
void
-d30v_extract_return_value (valtype, regbuf, valbuf)
- struct type *valtype;
- char regbuf[REGISTER_BYTES];
- char *valbuf;
+d30v_extract_return_value (struct type *valtype, char regbuf[REGISTER_BYTES],
+ char *valbuf)
{
memcpy (valbuf, regbuf + REGISTER_BYTE (2), TYPE_LENGTH (valtype));
}
trace_data;
static void
-trace_command (args, from_tty)
- char *args;
- int from_tty;
+trace_command (char *args, int from_tty)
{
/* Clear the host-side trace buffer, allocating space if needed. */
trace_data.size = 0;
}
static void
-untrace_command (args, from_tty)
- char *args;
- int from_tty;
+untrace_command (char *args, int from_tty)
{
tracing = 0;
}
static void
-trace_info (args, from_tty)
- char *args;
- int from_tty;
+trace_info (char *args, int from_tty)
{
int i;
on STREAM. Returns length of the instruction, in bytes. */
static int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- struct ui_file *stream;
+print_insn (CORE_ADDR memaddr, struct ui_file *stream)
{
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
- internal_error ("print_insn: no disassembler");
+ internal_error (__FILE__, __LINE__,
+ "print_insn: no disassembler");
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
tm_print_insn_info.endian = BFD_ENDIAN_BIG;
else
tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
- return (*tm_print_insn) (memaddr, &tm_print_insn_info);
+ return TARGET_PRINT_INSN (memaddr, &tm_print_insn_info);
}
void
-d30v_eva_prepare_to_trace ()
+d30v_eva_prepare_to_trace (void)
{
if (!tracing)
return;
more useful for display. */
void
-d30v_eva_get_trace_data ()
+d30v_eva_get_trace_data (void)
{
int count, i, j, oldsize;
int trace_addr, trace_seg, trace_cnt, next_cnt;
oldsize = trace_data.size;
trace_data.size += count;
- free (tmpspace);
+ xfree (tmpspace);
if (trace_display)
display_trace (oldsize, trace_data.size);
}
static void
-tdisassemble_command (arg, from_tty)
- char *arg;
- int from_tty;
+tdisassemble_command (char *arg, int from_tty)
{
int i, count;
CORE_ADDR low, high;
}
static void
-display_trace (low, high)
- int low, high;
+display_trace (int low, int high)
{
int i, count, trace_show_source, first, suppress;
CORE_ADDR next_address;
}
}
-extern void (*target_resume_hook) PARAMS ((void));
-extern void (*target_wait_loop_hook) PARAMS ((void));
+extern void (*target_resume_hook) (void);
+extern void (*target_wait_loop_hook) (void);
void
-_initialize_d30v_tdep ()
+_initialize_d30v_tdep (void)
{
tm_print_insn = print_insn_d30v;