📄 tm-alpha.h
字号:
/* Definitions to make GDB run on an Alpha box under OSF1. This is also used by the Alpha/Netware and Alpha/Linux targets. Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of GDB. 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. 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. 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. */#ifndef TM_ALPHA_H#define TM_ALPHA_H#include "bfd.h"#include "coff/sym.h" /* Needed for PDR below. */#include "coff/symconst.h"struct frame_info;struct type;struct value;struct symbol;#if !defined (TARGET_BYTE_ORDER)#define TARGET_BYTE_ORDER LITTLE_ENDIAN#endif/* Redefine some target bit sizes from the default. */#define TARGET_LONG_BIT 64#define TARGET_LONG_LONG_BIT 64#define TARGET_PTR_BIT 64/* Floating point is IEEE compliant */#define IEEE_FLOAT/* Number of traps that happen between exec'ing the shell * to run an inferior, and when we finally get to * the inferior code. This is 2 on most implementations. */#define START_INFERIOR_TRAPS_EXPECTED 3/* Offset from address of function to start of its code. Zero on most machines. */#define FUNCTION_START_OFFSET 0/* Advance PC across any function entry prologue instructions to reach some "real" code. */#define SKIP_PROLOGUE(pc) (alpha_skip_prologue(pc, 0))extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));/* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines the new frame is not set up until the new function executes some instructions. */#define SAVED_PC_AFTER_CALL(frame) alpha_saved_pc_after_call(frame)extern CORE_ADDR alpha_saved_pc_after_call PARAMS ((struct frame_info *));/* Are we currently handling a signal ? */#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("__sigtramp", (name)))/* Stack grows downward. */#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))#define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt *//* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always. */#ifndef DECR_PC_AFTER_BREAK#define DECR_PC_AFTER_BREAK 4#endif/* Say how long (ordinary) registers are. This is a piece of bogosity used in push_word and a few other places; REGISTER_RAW_SIZE is the real way to know how big a register is. */#define REGISTER_SIZE 8/* Number of machine registers */#define NUM_REGS 66/* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */#define REGISTER_NAMES \ { "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", \ "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp", \ "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9", \ "t10", "t11", "ra", "t12", "at", "gp", "sp", "zero", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr",\ "pc", "vfp", \ }/* Register numbers of various important registers. Note that most of these values are "real" register numbers, and correspond to the general registers of the machine, and FP_REGNUM is a "phony" register number which is too large to be an actual register number as far as the user is concerned but serves to get the desired value when passed to read_register. */#define V0_REGNUM 0 /* Function integer return value */#define T7_REGNUM 8 /* Return address register for OSF/1 __add* */#define GCC_FP_REGNUM 15 /* Used by gcc as frame register */#define A0_REGNUM 16 /* Loc of first arg during a subr call */#define T9_REGNUM 23 /* Return address register for OSF/1 __div* */#define T12_REGNUM 27 /* Contains start addr of current proc */#define SP_REGNUM 30 /* Contains address of top of stack */#define RA_REGNUM 26 /* Contains return address value */#define ZERO_REGNUM 31 /* Read-only register, always 0 */#define FP0_REGNUM 32 /* Floating point register 0 */#define FPA0_REGNUM 48 /* First float arg during a subr call */#define FPCR_REGNUM 63 /* Floating point control register */#define PC_REGNUM 64 /* Contains program counter */#define FP_REGNUM 65 /* Virtual frame pointer */#define CANNOT_FETCH_REGISTER(regno) \ ((regno) == FP_REGNUM || (regno) == ZERO_REGNUM)#define CANNOT_STORE_REGISTER(regno) \ ((regno) == FP_REGNUM || (regno) == ZERO_REGNUM)/* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */#define REGISTER_BYTES (NUM_REGS * 8)/* Index within `registers' of the first byte of the space for register N. */#define REGISTER_BYTE(N) ((N) * 8)/* Number of bytes of storage in the actual machine representation for register N. On Alphas, all regs are 8 bytes. */#define REGISTER_RAW_SIZE(N) 8/* Number of bytes of storage in the program's representation for register N. On Alphas, all regs are 8 bytes. */#define REGISTER_VIRTUAL_SIZE(N) 8/* Largest value REGISTER_RAW_SIZE can have. */#define MAX_REGISTER_RAW_SIZE 8/* Largest value REGISTER_VIRTUAL_SIZE can have. */#define MAX_REGISTER_VIRTUAL_SIZE 8/* Nonzero if register N requires conversion from raw format to virtual format. The alpha needs a conversion between register and memory format if the register is a floating point register and memory format is float, as the register format must be double or memory format is an integer with 4 bytes or less, as the representation of integers in floating point registers is different. */#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) < FP0_REGNUM + 31)/* Convert data from raw format for register REGNUM in buffer FROM to virtual format with type TYPE in buffer TO. */#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM, TYPE, FROM, TO) \ alpha_register_convert_to_virtual (REGNUM, TYPE, FROM, TO)extern voidalpha_register_convert_to_virtual PARAMS ((int, struct type *, char *, char *));/* Convert data from virtual format with type TYPE in buffer FROM to raw format for register REGNUM in buffer TO. */#define REGISTER_CONVERT_TO_RAW(TYPE, REGNUM, FROM, TO) \ alpha_register_convert_to_raw (TYPE, REGNUM, FROM, TO)extern voidalpha_register_convert_to_raw PARAMS ((struct type *, int, char *, char *));/* Return the GDB type object for the "standard" data type of data in register N. */#define REGISTER_VIRTUAL_TYPE(N) \ (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+31) \ ? builtin_type_double : builtin_type_long) \/* Store the address of the place in which to copy the structure the subroutine will return. Handled by alpha_push_arguments. */#define STORE_STRUCT_RETURN(addr, sp)/**//* 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. */#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ alpha_extract_return_value(TYPE, REGBUF, VALBUF)extern voidalpha_extract_return_value PARAMS ((struct type *, char *, char *));/* Write into appropriate registers a function return value of type TYPE, given in virtual format. */#define STORE_RETURN_VALUE(TYPE,VALBUF) \ alpha_store_return_value(TYPE, VALBUF)extern voidalpha_store_return_value PARAMS ((struct type *, char *));/* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, as a CORE_ADDR (or an expression that can be used as one). *//* The address is passed in a0 upon entry to the function, but when the function exits, the compiler has copied the value to v0. This convention is specified by the System V ABI, so I think we can rely on it. */#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ REGISTER_RAW_SIZE (V0_REGNUM)))/* Structures are returned by ref in extra arg0 */#define USE_STRUCT_CONVENTION(gcc_p, type) 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -