1999-04-16 01:35:26 +00:00
|
|
|
/* Parameters for execution on a Matsushita mn10200 processor.
|
2002-05-01 21:26:52 +00:00
|
|
|
|
|
|
|
Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
|
|
|
|
Foundation, Inc.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
Contributed by Geoffrey Noer <noer@cygnus.com>
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This file is part of GDB.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-03-03 01:38:49 +00:00
|
|
|
/* FIXME: cagney/2001-03-01: The below macros refer to functions
|
|
|
|
declared in "regcache.h". The ``correct fix'' is to convert those
|
|
|
|
macros into functions. */
|
|
|
|
#include "regcache.h"
|
2002-05-01 21:26:52 +00:00
|
|
|
#include "symtab.h" /* For namespace_enum. */
|
|
|
|
#include "symfile.h" /* For entry_point_address(). */
|
2001-03-03 01:38:49 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/* ints are only 16bits on the mn10200. */
|
|
|
|
#undef TARGET_INT_BIT
|
|
|
|
#define TARGET_INT_BIT 16
|
|
|
|
|
|
|
|
/* The mn10200 doesn't support long long types. */
|
|
|
|
#undef TARGET_LONG_LONG_BIT
|
|
|
|
#define TARGET_LONG_LONG_BIT 32
|
|
|
|
|
|
|
|
/* The mn10200 doesn't support double or long double either. */
|
|
|
|
#undef TARGET_DOUBLE_BIT
|
|
|
|
#undef TARGET_LONG_DOUBLE_BIT
|
|
|
|
#define TARGET_DOUBLE_BIT 32
|
|
|
|
#define TARGET_LONG_DOUBLE_BIT 32
|
|
|
|
|
|
|
|
/* Not strictly correct, but the machine independent code is not
|
|
|
|
ready to handle any of the basic sizes not being a power of two. */
|
|
|
|
#undef TARGET_PTR_BIT
|
|
|
|
#define TARGET_PTR_BIT 32
|
|
|
|
|
|
|
|
/* The mn10200 really has 24 bit registers but the simulator reads/writes
|
|
|
|
them as 32bit values, so we claim they're 32bits each. This may have
|
|
|
|
to be tweaked if the Matsushita emulator/board really deals with them
|
|
|
|
as 24bits each. */
|
|
|
|
#define REGISTER_SIZE 4
|
|
|
|
|
|
|
|
#define MAX_REGISTER_RAW_SIZE REGISTER_SIZE
|
|
|
|
#define NUM_REGS 11
|
|
|
|
|
|
|
|
#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE)
|
|
|
|
|
|
|
|
#define REGISTER_NAMES \
|
|
|
|
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "sp", \
|
|
|
|
"pc", "mdr", "psw"}
|
|
|
|
|
|
|
|
#define FP_REGNUM 6
|
|
|
|
#define SP_REGNUM 7
|
|
|
|
#define PC_REGNUM 8
|
|
|
|
#define MDR_REGNUM 9
|
|
|
|
#define PSW_REGNUM 10
|
|
|
|
|
|
|
|
/* Treat the registers as 32bit values. */
|
|
|
|
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_long
|
|
|
|
|
|
|
|
#define REGISTER_BYTE(REG) ((REG) * REGISTER_SIZE)
|
|
|
|
#define REGISTER_VIRTUAL_SIZE(REG) REGISTER_SIZE
|
|
|
|
#define REGISTER_RAW_SIZE(REG) REGISTER_SIZE
|
|
|
|
|
|
|
|
#define MAX_REGISTER_VIRTUAL_SIZE REGISTER_SIZE
|
|
|
|
|
|
|
|
/* The breakpoint instruction must be the same size as te smallest
|
|
|
|
instruction in the instruction set.
|
|
|
|
|
|
|
|
The Matsushita mn10x00 processors have single byte instructions
|
|
|
|
so we need a single byte breakpoint. Matsushita hasn't defined
|
|
|
|
one, so we defined it ourselves.
|
|
|
|
|
|
|
|
0xff is the only available single byte insn left on the mn10200. */
|
|
|
|
#define BREAKPOINT {0xff}
|
|
|
|
|
|
|
|
#define FUNCTION_START_OFFSET 0
|
|
|
|
|
|
|
|
#define DECR_PC_AFTER_BREAK 0
|
|
|
|
|
|
|
|
/* Stacks grow the normal way. */
|
|
|
|
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
|
|
|
|
|
|
|
#define SAVED_PC_AFTER_CALL(frame) \
|
|
|
|
(read_memory_integer (read_register (SP_REGNUM), REGISTER_SIZE) & 0xffffff)
|
|
|
|
|
|
|
|
struct frame_info;
|
|
|
|
struct frame_saved_regs;
|
|
|
|
struct type;
|
|
|
|
struct value;
|
|
|
|
|
|
|
|
#define EXTRA_FRAME_INFO struct frame_saved_regs fsr; int status; int stack_size;
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10200_init_extra_frame_info (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10200_init_extra_frame_info (fi)
|
2002-12-09 02:04:17 +00:00
|
|
|
#define INIT_FRAME_PC(x,y) (init_frame_pc_noop (x, y))
|
|
|
|
#define INIT_FRAME_PC_FIRST(x,y) (init_frame_pc_noop (x, y))
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10200_frame_find_saved_regs (struct frame_info *,
|
|
|
|
struct frame_saved_regs *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10200_frame_chain (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define FRAME_CHAIN(fi) mn10200_frame_chain (fi)
|
1999-12-14 01:06:04 +00:00
|
|
|
#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10200_find_callers_reg (struct frame_info *, int);
|
|
|
|
extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define FRAME_SAVED_PC(FI) (mn10200_frame_saved_pc (FI))
|
|
|
|
|
|
|
|
/* Extract from an array REGBUF containing the (raw) register state
|
|
|
|
a function return value of type TYPE, and copy that, in virtual format,
|
|
|
|
into VALBUF. */
|
|
|
|
|
2002-06-14 22:55:51 +00:00
|
|
|
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
|
1999-04-16 01:35:26 +00:00
|
|
|
{ \
|
|
|
|
if (TYPE_LENGTH (TYPE) > 8) \
|
2001-02-25 04:45:12 +00:00
|
|
|
internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
|
1999-04-16 01:35:26 +00:00
|
|
|
else if (TYPE_LENGTH (TYPE) > 2 && TYPE_CODE (TYPE) != TYPE_CODE_PTR) \
|
|
|
|
{ \
|
|
|
|
memcpy (VALBUF, REGBUF + REGISTER_BYTE (0), 2); \
|
|
|
|
memcpy (VALBUF + 2, REGBUF + REGISTER_BYTE (1), 2); \
|
|
|
|
} \
|
|
|
|
else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR)\
|
|
|
|
{ \
|
|
|
|
memcpy (VALBUF, REGBUF + REGISTER_BYTE (4), TYPE_LENGTH (TYPE)); \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
memcpy (VALBUF, REGBUF + REGISTER_BYTE (0), TYPE_LENGTH (TYPE)); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2002-06-14 22:55:51 +00:00
|
|
|
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
1999-04-16 01:35:26 +00:00
|
|
|
extract_address (REGBUF + REGISTER_BYTE (4), \
|
|
|
|
REGISTER_RAW_SIZE (4))
|
|
|
|
|
2002-08-24 00:21:37 +00:00
|
|
|
#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
|
1999-04-16 01:35:26 +00:00
|
|
|
{ \
|
|
|
|
if (TYPE_LENGTH (TYPE) > 8) \
|
2001-02-25 04:45:12 +00:00
|
|
|
internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
|
1999-04-16 01:35:26 +00:00
|
|
|
else if (TYPE_LENGTH (TYPE) > 2 && TYPE_CODE (TYPE) != TYPE_CODE_PTR) \
|
|
|
|
{ \
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 00:25:05 +00:00
|
|
|
deprecated_write_register_bytes (REGISTER_BYTE (0), VALBUF, 2); \
|
|
|
|
deprecated_write_register_bytes (REGISTER_BYTE (1), VALBUF + 2, 2); \
|
1999-04-16 01:35:26 +00:00
|
|
|
} \
|
|
|
|
else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR)\
|
|
|
|
{ \
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 00:25:05 +00:00
|
|
|
deprecated_write_register_bytes (REGISTER_BYTE (4), VALBUF, TYPE_LENGTH (TYPE)); \
|
1999-04-16 01:35:26 +00:00
|
|
|
} \
|
|
|
|
else \
|
|
|
|
{ \
|
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
read_register_bytes.
(deprecated_write_register_bytes): Rename write_register_bytes.
* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.
2002-11-13 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Use
deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 00:25:05 +00:00
|
|
|
deprecated_write_register_bytes (REGISTER_BYTE (0), VALBUF, TYPE_LENGTH (TYPE)); \
|
1999-04-16 01:35:26 +00:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
1999-09-09 00:02:17 +00:00
|
|
|
|
|
|
|
extern CORE_ADDR mn10200_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \
|
|
|
|
(SP) = mn10200_store_struct_return (STRUCT_ADDR, SP)
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10200_skip_prologue (CORE_ADDR);
|
1999-05-05 14:45:51 +00:00
|
|
|
#define SKIP_PROLOGUE(pc) (mn10200_skip_prologue (pc))
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#define FRAME_ARGS_SKIP 0
|
|
|
|
|
|
|
|
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
|
|
|
|
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
1999-05-25 18:09:09 +00:00
|
|
|
#define FRAME_NUM_ARGS(fi) (-1)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10200_pop_frame (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define POP_FRAME mn10200_pop_frame (get_current_frame ())
|
|
|
|
|
2002-11-28 21:38:44 +00:00
|
|
|
#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1
|
1999-04-16 01:35:26 +00:00
|
|
|
#define CALL_DUMMY {0}
|
|
|
|
#define CALL_DUMMY_START_OFFSET (0)
|
|
|
|
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
|
|
|
|
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
|
|
|
|
#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
|
|
|
|
#define CALL_DUMMY_ADDRESS() entry_point_address ()
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10200_push_return_address (CORE_ADDR, CORE_ADDR);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define PUSH_RETURN_ADDRESS(PC, SP) mn10200_push_return_address (PC, SP)
|
|
|
|
|
|
|
|
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
|
|
|
|
|
2002-07-11 13:50:50 +00:00
|
|
|
extern CORE_ADDR mn10200_push_arguments (int, struct value **, CORE_ADDR,
|
|
|
|
unsigned char, CORE_ADDR);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
|
1999-05-25 18:09:09 +00:00
|
|
|
(mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2002-12-01 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename
PC_IN_CALL_DUMMY. Change to predicate. Always allow call.
* gdbarch.h, gdbarch.c: Re-generate.
* config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update.
* config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update.
* config/pa/tm-hppa.h, frame.h: Update.
* x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update.
* s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update.
* m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update.
* cris-tdep.c, alpha-tdep.c: Update.
* frame.c (set_unwind_by_pc, create_new_frame): Use either
DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame.
(get_prev_frame): Ditto.
Index: doc/ChangeLog
2002-12-01 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Delete
PC_IN_CALL_DUMMY.
2002-12-01 19:07:16 +00:00
|
|
|
#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#define REG_STRUCT_HAS_ADDR(gcc_p,TYPE) \
|
|
|
|
(TYPE_LENGTH (TYPE) > 8)
|
|
|
|
|
|
|
|
extern use_struct_convention_fn mn10200_use_struct_convention;
|
|
|
|
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) mn10200_use_struct_convention (GCC_P, TYPE)
|
|
|
|
|
|
|
|
/* Define this for Wingdb */
|
|
|
|
#define TARGET_MN10200
|