/* Target-dependent code for the NEC V850 for GDB, the GNU debugger.
- Copyright 1996, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcore.h"
#include "symfile.h"
#include "arch-utils.h"
+#include "regcache.h"
static char *v850_generic_reg_names[] = REGISTER_NAMES;
/* Should call_function allocate stack space for a struct return? */
int
-v850_use_struct_convention (gcc_p, type)
- int gcc_p;
- struct type *type;
+v850_use_struct_convention (int gcc_p, struct type *type)
{
return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 4);
}
static void
handle_prepare (int insn, int insn2, CORE_ADDR * current_pc_ptr,
struct prologue_info *pi, struct pifsr **pifsr_ptr)
-
{
CORE_ADDR current_pc = *current_pc_ptr;
struct pifsr *pifsr = *pifsr_ptr;
static void
handle_pushm (int insn, int insn2, struct prologue_info *pi,
struct pifsr **pifsr_ptr)
-
{
struct pifsr *pifsr = *pifsr_ptr;
long list12 = ((insn & 0x0f) << 16) + (insn2 & 0xfff0);
be determined till after we have scanned the prologue. */
static CORE_ADDR
-v850_scan_prologue (pc, pi)
- CORE_ADDR pc;
- struct prologue_info *pi;
+v850_scan_prologue (CORE_ADDR pc, struct prologue_info *pi)
{
CORE_ADDR func_addr, prologue_end, current_pc;
struct pifsr *pifsr, *pifsr_tmp;
pointer just prior to calling the target function (see run_stack_dummy). */
void
-v850_init_extra_frame_info (fi)
- struct frame_info *fi;
+v850_init_extra_frame_info (struct frame_info *fi)
{
struct prologue_info pi;
struct pifsr pifsrs[NUM_REGS + 1], *pifsr;
function call was made. */
CORE_ADDR
-v850_frame_chain (fi)
- struct frame_info *fi;
+v850_frame_chain (struct frame_info *fi)
{
struct prologue_info pi;
CORE_ADDR callers_pc, fp;
frame. */
CORE_ADDR
-v850_find_callers_reg (fi, regnum)
- struct frame_info *fi;
- int regnum;
+v850_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
Return the address of the first code past the prologue of the function. */
CORE_ADDR
-v850_skip_prologue (pc)
- CORE_ADDR pc;
+v850_skip_prologue (CORE_ADDR pc)
{
CORE_ADDR func_addr, func_end;
command, or the call dummy breakpoint gets hit. */
void
-v850_pop_frame (frame)
- struct frame_info *frame;
+v850_pop_frame (struct frame_info *frame)
{
int regnum;
*/
CORE_ADDR
-v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
- int nargs;
- value_ptr *args;
- CORE_ADDR sp;
- unsigned char struct_return;
- CORE_ADDR struct_addr;
+v850_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp,
+ unsigned char struct_return, CORE_ADDR struct_addr)
{
int argreg;
int argnum;
Needed for targets where we don't actually execute a JSR/BSR instruction */
CORE_ADDR
-v850_push_return_address (pc, sp)
- CORE_ADDR pc;
- CORE_ADDR sp;
+v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
write_register (RP_REGNUM, CALL_DUMMY_ADDRESS ());
return sp;
will be found. */
CORE_ADDR
-v850_frame_saved_pc (fi)
- struct frame_info *fi;
+v850_frame_saved_pc (struct frame_info *fi)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
*/
int
-v850_fix_call_dummy (dummy, sp, fun, nargs, args, type, gcc_p)
- char *dummy;
- CORE_ADDR sp;
- CORE_ADDR fun;
- int nargs;
- value_ptr *args;
- struct type *type;
- int gcc_p;
+v850_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs,
+ value_ptr *args, struct type *type, int gcc_p)
{
long offset24;
/* Change the register names based on the current machine type. */
static int
-v850_target_architecture_hook (ap)
- const bfd_arch_info_type *ap;
+v850_target_architecture_hook (const bfd_arch_info_type *ap)
{
int i, j;
}
}
- internal_error ("Architecture `%s' unreconized", ap->printable_name);
+ internal_error (__FILE__, __LINE__,
+ "Architecture `%s' unrecognized", ap->printable_name);
}
void
-_initialize_v850_tdep ()
+_initialize_v850_tdep (void)
{
tm_print_insn = print_insn_v850;
target_architecture_hook = v850_target_architecture_hook;