⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tm-convex.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 2 页
字号:
/* Definitions to make GDB run on Convex Unix (4bsd)   Copyright (C) 1989, 1991 Free Software Foundation, Inc.This file is part of GDB.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */#define TARGET_BYTE_ORDER BIG_ENDIAN/* Define this if the C compiler puts an underscore at the front   of external names before giving them to the linker.  */#define NAMES_HAVE_UNDERSCORE/* There is come problem with the debugging symbols generated by the   compiler such that the debugging symbol for the first line of a   function overlap with the function prologue.  */#define PROLOGUE_FIRSTLINE_OVERLAP/* When convex pcc says CHAR or SHORT, it provides the correct address.  */#define BELIEVE_PCC_PROMOTION 1/* Symbol types to ignore.  *//* 0xc4 is N_MONPT.  Use the numeric value for the benefit of people   with (rather) old OS's.  */#define IGNORE_SYMBOL(TYPE) \    (((TYPE) & ~N_EXT) == N_TBSS       \     || ((TYPE) & ~N_EXT) == N_TDATA   \     || ((TYPE) & ~N_EXT) == 0xc4)/* 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.   Convex prolog is:       [sub.w #-,sp]		in one of 3 possible sizes       [mov psw,-		fc/vc main program prolog        and #-,-		  (skip it because the "mov psw" saves the	mov -,psw]		   T bit, so continue gets a surprise trap)       [and #-,sp]		fc/vc O2 main program prolog       [ld.- -(ap),-]		pcc/gcc register arg loads*/#define SKIP_PROLOGUE(pc)  \{ int op, ix;								\  op = read_memory_integer (pc, 2);					\  if ((op & 0xffc7) == 0x5ac0) pc += 2;					\  else if (op == 0x1580) pc += 4;					\  else if (op == 0x15c0) pc += 6;					\  if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40			\      && (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240		\      && (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48)		\    pc += 10;								\  if (read_memory_integer (pc, 2) == 0x1240) pc += 6;			\  for (;;) {								\    op = read_memory_integer (pc, 2);					\    ix = (op >> 3) & 7;							\    if (ix != 6) break;							\    if ((op & 0xfcc0) == 0x3000) pc += 4;				\    else if ((op & 0xfcc0) == 0x3040) pc += 6;				\    else if ((op & 0xfcc0) == 0x2800) pc += 4;				\    else if ((op & 0xfcc0) == 0x2840) pc += 6;				\    else break;}}/* Immediately after a function call, return the saved pc.   (ignore frame and return *$sp so we can handle both calls and callq) */#define SAVED_PC_AFTER_CALL(frame) \    read_memory_integer (read_register (SP_REGNUM), 4)/* Address of end of stack space.   This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but   that expression depends on the kernel version; instead, fetch a   page-zero pointer and get it from that.  This will be invalid if   they ever change the way bkpt signals are delivered.  */#define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050)/* User-mode traps push an extended rtn block,   then fault with one of the following PCs */#define is_trace_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4)#define is_arith_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4)#define is_break_pc(pc)  ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4)/* We need to manipulate trap bits in the psw */#define PSW_TRAP_FLAGS	0x69670000#define PSW_T_BIT	0x08000000#define PSW_S_BIT	0x01000000/* Stack grows downward.  */#define INNER_THAN </* Sequence of bytes for breakpoint instruction. (bkpt)  */#define BREAKPOINT {0x7d,0x50}/* Amount PC must be decremented by after a breakpoint.   This is often the number of bytes in BREAKPOINT but not always.   (The break PC needs to be decremented by 2, but we do it when the   break frame is recognized and popped.  That way gdb can tell breaks   from trace traps with certainty.) */#define DECR_PC_AFTER_BREAK 0/* Nonzero if instruction at PC is a return instruction. (rtn or rtnq) */#define ABOUT_TO_RETURN(pc) \    ((read_memory_integer (pc, 2) & 0xffe0) == 0x7c80)/* Return 1 if P points to an invalid floating point value. */#define INVALID_FLOAT(p,len)   0/* Say how long (ordinary) registers are.  */#define REGISTER_TYPE long long/* Number of machine registers */#define NUM_REGS 26/* Initializer for an array of names of registers.   There should be NUM_REGS strings in this initializer.  */#define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\			"s7","s6","s5","s4","s3","s2","s1","s0",\			"S7","S6","S5","S4","S3","S2","S1","S0"}/* Register numbers of various important registers.   Note that some of these values are "real" register numbers,   and correspond to the general registers of the machine,   and some are "phony" register numbers which are too large   to be actual register numbers as far as the user is concerned   but do serve to get the desired values when passed to read_register.  */#define S0_REGNUM 25		/* the real S regs */#define S7_REGNUM 18#define s0_REGNUM 17		/* low-order halves of S regs */#define s7_REGNUM 10#define SP_REGNUM 9 		/* A regs */#define A1_REGNUM 8#define A5_REGNUM 4#define AP_REGNUM 3#define FP_REGNUM 2		/* Contains address of executing stack frame */#define PS_REGNUM 1		/* Contains processor status */#define PC_REGNUM 0		/* Contains program counter *//* convert dbx stab register number (from `r' declaration) to a gdb REGNUM */#define STAB_REG_TO_REGNUM(value) \      ((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8))/* Vector register numbers, not handled as ordinary regs.   They are treated as convenience variables whose values are read   from the inferior when needed.  */#define V0_REGNUM 0#define V7_REGNUM 7#define VM_REGNUM 8#define VS_REGNUM 9#define VL_REGNUM 10/* Total amount of space needed to store our copies of the machine's   register state, the array `registers'.  */#define REGISTER_BYTES (4*10 + 8*8)/* Index within `registers' of the first byte of the space for   register N.   NB: must match structure of struct syscall_context for correct operation */#define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \			  (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \			                    40 + 8 * ((N)-S7_REGNUM))/* Number of bytes of storage in the actual machine representation   for register N. */#define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8)/* Number of bytes of storage in the program's representation   for register N.   */#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)/* 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.  */#define REGISTER_CONVERTIBLE(N) 0/* Convert data from raw format for register REGNUM   to virtual format for register REGNUM.  */#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO)	\   bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));/* Convert data from virtual format for register REGNUM   to raw format for register REGNUM.  */#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO)	\  bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));/* Return the GDB type object for the "standard" data type   of data in register N.  */#define REGISTER_VIRTUAL_TYPE(N) \   ((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long)/* Store the address of the place in which to copy the structure the   subroutine will return.  This is called from call_function. */#define STORE_STRUCT_RETURN(ADDR, SP) \  { write_register (A1_REGNUM, (ADDR)); }/* 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) \  bcopy (&((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \			     8 - TYPE_LENGTH (TYPE)],\	 VALBUF, TYPE_LENGTH (TYPE))/* Write into appropriate registers a function return value   of type TYPE, given in virtual format.  */#define STORE_RETURN_VALUE(TYPE,VALBUF) \    write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8)/* 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).  */#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \    (*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)])/* Define trapped internal variable hooks to read and write   vector and communication registers.  */#define IS_TRAPPED_INTERNALVAR is_trapped_internalvar#define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar#define SET_TRAPPED_INTERNALVAR set_trapped_internalvarextern struct value *value_of_trapped_internalvar ();/* Hooks to read data from soff exec and core files,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -