📄 tm-pyr.h
字号:
/* Definitions to make GDB run on a Pyramid under OSx 4.0 (4.2bsd). Copyright (C) 1988, 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/* Traditional Unix virtual address spaces have thre regions: text, data and stack. The text, initialised data, and uninitialised data are represented in separate segments of the a.out file. When a process dumps core, the data and stack regions are written to a core file. This gives a debugger enough information to reconstruct (and debug) the virtual address space at the time of the coredump. Pyramids have an distinct fourth region of the virtual address space, in which the contents of the windowed registers are stacked in fixed-size frames. Pyramid refer to this region as the control stack. Each call (or trap) automatically allocates a new register frame; each return deallocates the current frame and restores the windowed registers to their values before the call. When dumping core, the control stack is written to a core files as a third segment. The core-handling functions need to know to deal with it. */ /* Tell core.c there is an extra segment. */#define REG_STACK_SEGMENT/* Floating point is IEEE compatible on most Pyramid hardware (Older processors do not have IEEE NaNs). */#define IEEE_FLOAT/* 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/* 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. *//* FIXME -- do we want to skip insns to allocate the local frame? If so, what do they look like? This is becoming harder, since tege@sics.SE wants to change gcc to not output a prologue when no frame is needed. */#define SKIP_PROLOGUE(pc) do {} while (0)/* 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) FRAME_SAVED_PC(frame)/* Address of end of stack space. *//* This seems to be right for the 90x comp.vuw.ac.nz. The correct value at any site may be a function of the configured maximum control stack depth. If so, I don't know where the control-stack depth is configured, so I can't #include it here. */ #define STACK_END_ADDR (0xc00cc000)/* Register window stack (Control stack) stack definitions - Address of beginning of control stack. - size of control stack frame (Note that since crts0 is usually the first function called, main()'s control stack is one frame (0x80 bytes) beyond this value. */#define CONTROL_STACK_ADDR (0xc00cd000)/* Bytes in a register window -- 16 parameter regs, 16 local regs for each call, is 32 regs * 4 bytes */#define CONTROL_STACK_FRAME_SIZE (32*4)/* FIXME. On a pyr, Data Stack grows downward; control stack goes upwards. Which direction should we use for INNER_THAN, PC_INNER_THAN ?? */#define INNER_THAN <#define PC_INNER_THAN >/* Stack has strict alignment. */#define STACK_ALIGN(ADDR) (((ADDR)+3)&-4)/* Sequence of bytes for breakpoint instruction. */#define BREAKPOINT {0xf0, 00, 00, 00}/* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always. */#define DECR_PC_AFTER_BREAK 0/* Nonzero if instruction at PC is a return instruction. On a pyr, this is either "ret" or "retd". It would be friendly to check that any "retd" always had an argument of 0, since anything else is invalid. */#define ABOUT_TO_RETURN(pc) \(((read_memory_integer (pc, 2) & 0x3ff0) == 0x3090) || \ ((read_memory_integer (pc, 2) & 0x0ff0) == 0x00a0))/* Return 1 if P points to an invalid floating point value. LEN is the length in bytes -- not relevant on the Vax. *//* FIXME -- this is ok for a vax, bad for big-endian ieee format. I would use the definition for a Sun; but it is no better! */#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)/* Say how long (ordinary) registers are. */#define REGISTER_TYPE long/* Number of machine registers *//* pyramids have 64, plus one for the PSW; plus perhaps one more for the kernel stack pointer (ksp) and control-stack pointer (CSP) */#define NUM_REGS 67/* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */#define REGISTER_NAMES \{"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \ "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \ "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \ "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \ "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \ "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \ "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \ "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \ "psw", "ksp", "csp"}/* 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. *//* pseudo-registers: */#define PS_REGNUM 64 /* Contains processor status */#define PSW_REGNUM 64 /* Contains current psw, whatever it is.*/#define CSP_REGNUM 65 /* address of this control stack frame*/#define KSP_REGNUM 66 /* Contains process's Kernel Stack Pointer */#define CFP_REGNUM 13 /* Current data-stack frame ptr */#define TR0_REGNUM 48 /* After function call, contains function result *//* Registers interesting to the machine-independent part of gdb*/#define FP_REGNUM CSP_REGNUM /* Contains address of executing (control) stack frame */#define SP_REGNUM 14 /* Contains address of top of stack -??*/#define PC_REGNUM 15 /* Contains program counter *//* Define DO_REGISTERS_INFO() to do machine-specific formatting of register dumps. */#define DO_REGISTERS_INFO(_regnum, fp) pyr_do_registers_info(_regnum, fp)/* need this so we can find the global registers: they never get saved. */extern unsigned int global_reg_offset;extern unsigned int last_frame_offset;/* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */#define REGISTER_BYTES (NUM_REGS*4)/* the Pyramid has register windows. */#define HAVE_REGISTER_WINDOWS/* Is this register part of the register window system? A yes answer implies that 1) The name of this register will not be the same in other frames, and 2) This register is automatically "saved" (out registers shifting into ins counts) upon subroutine calls and thus there is no need to search more than one stack frame for it. */#define REGISTER_IN_WINDOW_P(regnum) \ ((regnum) >= 16 && (regnum) < 64)/* Index within `registers' of the first byte of the space for register N. */#define REGISTER_BYTE(N) ((N) * 4)/* Number of bytes of storage in the actual machine representation for register N. On the Pyramid, all regs are 4 bytes. */#define REGISTER_RAW_SIZE(N) 4/* Number of bytes of storage in the program's representation for register N. On the Pyramid, all regs are 4 bytes. */#define REGISTER_VIRTUAL_SIZE(N) 4/* Largest value REGISTER_RAW_SIZE can have. */#define MAX_REGISTER_RAW_SIZE 4/* Largest value REGISTER_VIRTUAL_SIZE can have. */#define MAX_REGISTER_VIRTUAL_SIZE 4/* 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), 4);/* 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), 4);/* Return the GDB type object for the "standard" data type of data in register N. */#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int/* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and STORE_RETURN_VALUE to be correct. *//* Store the address of the place in which to copy the structure the subroutine will return. This is called from call_function. *//****FIXME****/#define STORE_STRUCT_RETURN(ADDR, SP) \ { write_register (TR0_REGNUM, (ADDR)); }/* Extract from an array REGBUF containing the (raw) register state
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -