/* Target-dependent code for Mitsubishi D10V, 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 "objfiles.h"
#include "language.h"
#include "arch-utils.h"
+#include "regcache.h"
#include "floatformat.h"
#include "sim-d10v.h"
int nr_dmap_regs;
unsigned long (*dmap_register) (int nr);
unsigned long (*imap_register) (int nr);
- int (*register_sim_regno) (int nr);
};
/* These are the addresses the D10V-EVA board maps data and
static void do_d10v_pop_frame (struct frame_info *fi);
int
-d10v_frame_chain_valid (chain, frame)
- CORE_ADDR chain;
- struct frame_info *frame; /* not used here */
+d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame)
{
return ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START);
}
return register_names[reg_nr];
}
-/* Access the DMAP/IMAP registers in a target independant way. */
+/* Access the DMAP/IMAP registers in a target independent way. */
static unsigned long
d10v_ts2_dmap_register (int reg_nr)
return nr;
}
-int
-d10v_register_sim_regno (int nr)
-{
- return gdbarch_tdep (current_gdbarch)->register_sim_regno (nr);
-}
-
/* Index within `registers' of the first byte of the space for
register REG_NR. */
return ((frame)->extra_info->return_pc);
}
-CORE_ADDR
-d10v_frame_args_address (struct frame_info *fi)
-{
- return (fi)->frame;
-}
-
-CORE_ADDR
-d10v_frame_locals_address (struct frame_info *fi)
-{
- return (fi)->frame;
-}
-
/* Immediately after a function call, return the saved pc. We can't
use frame->return_pc beause that is determined by reading R13 off
the stack and that may not be written yet. */
{
struct stack_item *dead = si;
si = si->prev;
- free (dead->data);
- free (dead);
+ xfree (dead->data);
+ xfree (dead);
return si;
}
extract and copy its value into `valbuf'. */
void
-d10v_extract_return_value (type, regbuf, valbuf)
- struct type *type;
- char regbuf[REGISTER_BYTES];
- char *valbuf;
+d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES],
+ char *valbuf)
{
int len;
/* printf("RET: TYPE=%d len=%d r%d=0x%x\n",type->code, TYPE_LENGTH (type), RET1_REGNUM - R0_REGNUM, (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM))); */
{
/* 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;
oldsize = trace_data.size;
trace_data.size += count;
- free (tmpspace);
+ xfree (tmpspace);
if (trace_display)
display_trace (oldsize, trace_data.size);
int d10v_num_regs;
struct gdbarch_tdep *tdep;
gdbarch_register_name_ftype *d10v_register_name;
+ gdbarch_register_sim_regno_ftype *d10v_register_sim_regno;
/* Find a candidate among the list of pre-declared architectures. */
arches = gdbarch_list_lookup_by_info (arches, &info);
case bfd_mach_d10v_ts2:
d10v_num_regs = 37;
d10v_register_name = d10v_ts2_register_name;
+ d10v_register_sim_regno = d10v_ts2_register_sim_regno;
tdep->a0_regnum = TS2_A0_REGNUM;
tdep->nr_dmap_regs = TS2_NR_DMAP_REGS;
- tdep->register_sim_regno = d10v_ts2_register_sim_regno;
tdep->dmap_register = d10v_ts2_dmap_register;
tdep->imap_register = d10v_ts2_imap_register;
break;
case bfd_mach_d10v_ts3:
d10v_num_regs = 42;
d10v_register_name = d10v_ts3_register_name;
+ d10v_register_sim_regno = d10v_ts3_register_sim_regno;
tdep->a0_regnum = TS3_A0_REGNUM;
tdep->nr_dmap_regs = TS3_NR_DMAP_REGS;
- tdep->register_sim_regno = d10v_ts3_register_sim_regno;
tdep->dmap_register = d10v_ts3_dmap_register;
tdep->imap_register = d10v_ts3_imap_register;
break;
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_little);
break;
default:
- internal_error ("d10v_gdbarch_init: bad byte order for float format");
+ internal_error (__FILE__, __LINE__,
+ "d10v_gdbarch_init: bad byte order for float format");
}
set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
set_gdbarch_frame_chain (gdbarch, d10v_frame_chain);
set_gdbarch_frame_chain_valid (gdbarch, d10v_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, d10v_frame_saved_pc);
- set_gdbarch_frame_args_address (gdbarch, d10v_frame_args_address);
- set_gdbarch_frame_locals_address (gdbarch, d10v_frame_locals_address);
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_stack_align (gdbarch, d10v_stack_align);
+ set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno);
+ set_gdbarch_extra_stack_alignment_needed (gdbarch, 0);
+
return gdbarch;
}