1999-04-16 01:35:26 +00:00
|
|
|
/* Parameters for execution on a Matsushita mn10300 processor.
|
2000-08-11 07:54:49 +00:00
|
|
|
Copyright 1996, 1997, 2000 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
|
|
|
|
2000-08-11 07:54:49 +00:00
|
|
|
#define GDB_MULTI_ARCH 1
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/* The mn10300 is little endian. */
|
|
|
|
#define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN
|
|
|
|
|
|
|
|
/* All registers are 32bits (phew!). */
|
2000-08-12 03:28:42 +00:00
|
|
|
#if !GDB_MULTI_ARCH
|
1999-04-16 01:35:26 +00:00
|
|
|
#define REGISTER_SIZE 4
|
|
|
|
#define MAX_REGISTER_RAW_SIZE 4
|
|
|
|
#define NUM_REGS 32
|
2000-08-12 03:28:42 +00:00
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-08-12 03:28:42 +00:00
|
|
|
#if !GDB_MULTI_ARCH
|
1999-04-16 01:35:26 +00:00
|
|
|
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
|
2000-08-12 03:28:42 +00:00
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-08-12 03:28:42 +00:00
|
|
|
#if !GDB_MULTI_ARCH
|
1999-04-16 01:35:26 +00:00
|
|
|
#define REGISTER_BYTE(REG) ((REG) * 4)
|
|
|
|
#define REGISTER_VIRTUAL_SIZE(REG) 4
|
|
|
|
#define REGISTER_RAW_SIZE(REG) 4
|
2000-08-12 03:28:42 +00:00
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#define MAX_REGISTER_VIRTUAL_SIZE 4
|
|
|
|
|
|
|
|
#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE)
|
|
|
|
|
|
|
|
#define D2_REGNUM 2
|
|
|
|
#define D3_REGNUM 3
|
|
|
|
#define A2_REGNUM 6
|
|
|
|
#define A3_REGNUM 7
|
|
|
|
#define SP_REGNUM 8
|
|
|
|
#define PC_REGNUM 9
|
|
|
|
#define MDR_REGNUM 10
|
|
|
|
#define PSW_REGNUM 11
|
|
|
|
#define LIR_REGNUM 12
|
|
|
|
#define LAR_REGNUM 13
|
2000-02-02 00:21:19 +00:00
|
|
|
#define E0_REGNUM 14
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* Pseudo register that contains true address of executing stack frame */
|
|
|
|
#define FP_REGNUM 31
|
|
|
|
|
|
|
|
/* BREAKPOINT_FROM_PC uses the program counter value to determine the
|
|
|
|
breakpoint that should be used */
|
|
|
|
extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc;
|
|
|
|
#define BREAKPOINT_FROM_PC(pcptr, lenptr) mn10300_breakpoint_from_pc (pcptr, lenptr)
|
|
|
|
|
|
|
|
#define FUNCTION_START_OFFSET 0
|
|
|
|
|
|
|
|
#define DECR_PC_AFTER_BREAK 0
|
|
|
|
|
|
|
|
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10300_saved_pc_after_call (struct frame_info *frame);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define SAVED_PC_AFTER_CALL(frame) \
|
1999-06-14 18:08:47 +00:00
|
|
|
mn10300_saved_pc_after_call (frame)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
struct frame_info;
|
|
|
|
struct type;
|
|
|
|
struct value;
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10300_init_extra_frame_info (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi)
|
|
|
|
#define INIT_FRAME_PC /* Not necessary */
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
#define FRAME_INIT_SAVED_REGS(fi) /* handled by init_extra_frame_info */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10300_frame_chain (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define FRAME_CHAIN(fi) mn10300_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 mn10300_find_callers_reg (struct frame_info *, int);
|
|
|
|
extern CORE_ADDR mn10300_frame_saved_pc (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define FRAME_SAVED_PC(FI) (mn10300_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. */
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10300_extract_return_value (struct type *type, char *regbuf,
|
|
|
|
char *valbuf);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
|
1999-06-14 18:08:47 +00:00
|
|
|
mn10300_extract_return_value (TYPE, REGBUF, VALBUF)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
CORE_ADDR mn10300_extract_struct_value_address (char *regbuf);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
1999-06-14 18:08:47 +00:00
|
|
|
mn10300_extract_struct_value_address (REGBUF)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
void mn10300_store_return_value (struct type *type, char *valbuf);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define STORE_RETURN_VALUE(TYPE, VALBUF) \
|
1999-06-14 18:08:47 +00:00
|
|
|
mn10300_store_return_value (TYPE, VALBUF)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-09-09 00:02:17 +00:00
|
|
|
|
|
|
|
extern CORE_ADDR mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \
|
1999-06-14 18:08:47 +00:00
|
|
|
(mn10300_store_struct_return (STRUCT_ADDR, SP))
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10300_skip_prologue (CORE_ADDR);
|
1999-05-05 14:45:51 +00:00
|
|
|
#define SKIP_PROLOGUE(pc) (mn10300_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 mn10300_pop_frame (struct frame_info *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define POP_FRAME mn10300_pop_frame (get_current_frame ())
|
|
|
|
|
1999-04-26 18:34:20 +00:00
|
|
|
#define 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 ()
|
|
|
|
|
1999-07-05 17:58:44 +00:00
|
|
|
#define TARGET_READ_FP() read_sp ()
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern CORE_ADDR mn10300_push_return_address (CORE_ADDR, CORE_ADDR);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define PUSH_RETURN_ADDRESS(PC, SP) mn10300_push_return_address (PC, SP)
|
|
|
|
|
|
|
|
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
|
1999-07-05 17:58:44 +00:00
|
|
|
#define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
extern CORE_ADDR
|
2000-05-28 01:12:42 +00:00
|
|
|
mn10300_push_arguments (int, struct value **, CORE_ADDR,
|
2000-08-11 07:54:49 +00:00
|
|
|
int, 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
|
|
|
(mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-04-26 18:34:20 +00:00
|
|
|
#define 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 mn10300_use_struct_convention;
|
|
|
|
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) mn10300_use_struct_convention (GCC_P, TYPE)
|
|
|
|
|
|
|
|
/* override the default get_saved_register function with
|
|
|
|
one that takes account of generic CALL_DUMMY frames */
|
1999-04-26 18:34:20 +00:00
|
|
|
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
|
|
|
|
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* Cons up virtual frame pointer for trace */
|
2000-05-28 01:12:42 +00:00
|
|
|
extern void mn10300_virtual_frame_pointer (CORE_ADDR, long *, long *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \
|
|
|
|
mn10300_virtual_frame_pointer ((PC), (REGP), (OFFP))
|