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

📄 tm-pyr.h

📁 arm-linux-gcc编译器
💻 H
📖 第 1 页 / 共 2 页
字号:
/* OBSOLETE /* Definitions to make GDB run on a Pyramid under OSx 4.0 (4.2bsd). *//* OBSOLETE    Copyright 1988, 1989, 1991, 1993 Free Software Foundation, Inc. *//* OBSOLETE  *//* OBSOLETE This file is part of GDB. *//* OBSOLETE  *//* OBSOLETE This program is free software; you can redistribute it and/or modify *//* OBSOLETE it under the terms of the GNU General Public License as published by *//* OBSOLETE the Free Software Foundation; either version 2 of the License, or *//* OBSOLETE (at your option) any later version. *//* OBSOLETE  *//* OBSOLETE This program is distributed in the hope that it will be useful, *//* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of *//* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *//* OBSOLETE GNU General Public License for more details. *//* OBSOLETE  *//* OBSOLETE You should have received a copy of the GNU General Public License *//* OBSOLETE along with this program; if not, write to the Free Software *//* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *x/ *//* OBSOLETE  *//* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN *//* OBSOLETE  *//* OBSOLETE /* Traditional Unix virtual address spaces have thre regions: text, *//* OBSOLETE    data and stack.  The text, initialised data, and uninitialised data *//* OBSOLETE    are represented in separate segments of the a.out file. *//* OBSOLETE    When a process dumps core, the data and stack regions are written *//* OBSOLETE    to a core file.  This gives a debugger enough information to *//* OBSOLETE    reconstruct (and debug) the virtual address space at the time of *//* OBSOLETE    the coredump. *//* OBSOLETE    Pyramids have an distinct fourth region of the virtual address *//* OBSOLETE    space, in which the contents of the windowed registers are stacked *//* OBSOLETE    in fixed-size frames.  Pyramid refer to this region as the control *//* OBSOLETE    stack.  Each call (or trap) automatically allocates a new register *//* OBSOLETE    frame; each return deallocates the current frame and restores the *//* OBSOLETE    windowed registers to their values before the call. *//* OBSOLETE  *//* OBSOLETE    When dumping core, the control stack is written to a core files as *//* OBSOLETE    a third segment. The core-handling functions need to know to deal *//* OBSOLETE    with it. *x/  *//* OBSOLETE  *//* OBSOLETE /* Tell corefile.c there is an extra segment.  *x/ *//* OBSOLETE #define REG_STACK_SEGMENT *//* OBSOLETE  *//* OBSOLETE /* Floating point is IEEE compatible on most Pyramid hardware *//* OBSOLETE    (Older processors do not have IEEE NaNs).  *x/ *//* OBSOLETE #define IEEE_FLOAT *//* OBSOLETE  *//* OBSOLETE /* Offset from address of function to start of its code. *//* OBSOLETE    Zero on most machines.  *x/ *//* OBSOLETE  *//* OBSOLETE #define FUNCTION_START_OFFSET 0 *//* OBSOLETE  *//* OBSOLETE /* Advance PC across any function entry prologue instructions *//* OBSOLETE    to reach some "real" code.  *x/ *//* OBSOLETE  *//* OBSOLETE /* FIXME -- do we want to skip insns to allocate the local frame? *//* OBSOLETE    If so, what do they look like? *//* OBSOLETE    This is becoming harder, since tege@sics.SE wants to change *//* OBSOLETE    gcc to not output a prologue when no frame is needed.   *x/ *//* OBSOLETE #define SKIP_PROLOGUE(pc)  (pc) *//* OBSOLETE  *//* OBSOLETE  *//* OBSOLETE /* Immediately after a function call, return the saved pc. *//* OBSOLETE    Can't always go through the frames for this because on some machines *//* OBSOLETE    the new frame is not set up until the new function executes *//* OBSOLETE    some instructions.  *x/ *//* OBSOLETE  *//* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame) *//* OBSOLETE  *//* OBSOLETE /* Address of end of stack space.  *x/ *//* OBSOLETE /* This seems to be right for the 90x comp.vuw.ac.nz. *//* OBSOLETE    The correct value at any site may be a function of the configured *//* OBSOLETE    maximum control stack depth.  If so, I don't know where the *//* OBSOLETE    control-stack depth is configured, so I can't #include it here. *x/  *//* OBSOLETE #define STACK_END_ADDR (0xc00cc000) *//* OBSOLETE  *//* OBSOLETE /* Register window stack (Control stack) stack definitions *//* OBSOLETE     - Address of beginning of control stack. *//* OBSOLETE     - size of control stack frame *//* OBSOLETE    (Note that since crts0 is usually the first function called, *//* OBSOLETE     main()'s control stack is one frame (0x80 bytes) beyond this value.  *x/ *//* OBSOLETE  *//* OBSOLETE #define CONTROL_STACK_ADDR (0xc00cd000) *//* OBSOLETE  *//* OBSOLETE /* Bytes in a register window -- 16 parameter regs, 16 local regs *//* OBSOLETE    for each call, is 32 regs * 4 bytes *x/ *//* OBSOLETE  *//* OBSOLETE #define CONTROL_STACK_FRAME_SIZE (32*4) *//* OBSOLETE  *//* OBSOLETE /* FIXME.  On a pyr, Data Stack grows downward; control stack goes upwards.  *//* OBSOLETE    Which direction should we use for INNER_THAN, PC_INNER_THAN ?? *x/ *//* OBSOLETE  *//* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) *//* OBSOLETE  *//* OBSOLETE /* Stack must be aligned on 32-bit boundaries when synthesizing *//* OBSOLETE    function calls. *x/ *//* OBSOLETE  *//* OBSOLETE #define STACK_ALIGN(ADDR) (((ADDR) + 3) & -4) *//* OBSOLETE  *//* OBSOLETE /* Sequence of bytes for breakpoint instruction.  *x/ *//* OBSOLETE  *//* OBSOLETE #define BREAKPOINT {0xf0, 00, 00, 00} *//* OBSOLETE  *//* OBSOLETE /* Amount PC must be decremented by after a breakpoint. *//* OBSOLETE    This is often the number of bytes in BREAKPOINT *//* OBSOLETE    but not always.  *x/ *//* OBSOLETE  *//* OBSOLETE #define DECR_PC_AFTER_BREAK 0 *//* OBSOLETE  *//* OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity *//* OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the *//* OBSOLETE    real way to know how big a register is.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_SIZE 4 *//* OBSOLETE  *//* OBSOLETE /* Number of machine registers *x/ *//* OBSOLETE /* pyramids have 64, plus one for the PSW; plus perhaps one more for the *//* OBSOLETE    kernel stack pointer (ksp) and control-stack pointer (CSP) *x/ *//* OBSOLETE  *//* OBSOLETE #define NUM_REGS 67 *//* OBSOLETE  *//* OBSOLETE /* Initializer for an array of names of registers. *//* OBSOLETE    There should be NUM_REGS strings in this initializer.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_NAMES \ *//* OBSOLETE {"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \ *//* OBSOLETE  "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \ *//* OBSOLETE  "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \ *//* OBSOLETE  "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \ *//* OBSOLETE  "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \ *//* OBSOLETE  "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \ *//* OBSOLETE  "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \ *//* OBSOLETE  "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \ *//* OBSOLETE   "psw", "ksp", "csp"} *//* OBSOLETE  *//* OBSOLETE /* Register numbers of various important registers. *//* OBSOLETE    Note that some of these values are "real" register numbers, *//* OBSOLETE    and correspond to the general registers of the machine, *//* OBSOLETE    and some are "phony" register numbers which are too large *//* OBSOLETE    to be actual register numbers as far as the user is concerned *//* OBSOLETE    but do serve to get the desired values when passed to read_register.  *x/ *//* OBSOLETE  *//* OBSOLETE /* pseudo-registers: *x/ *//* OBSOLETE #define PS_REGNUM 64                /* Contains processor status *x/ *//* OBSOLETE #define PSW_REGNUM 64               /* Contains current psw, whatever it is.*x/ *//* OBSOLETE #define CSP_REGNUM 65               /* address of this control stack frame*x/ *//* OBSOLETE #define KSP_REGNUM 66               /* Contains process's Kernel Stack Pointer *x/ *//* OBSOLETE  *//* OBSOLETE #define CFP_REGNUM 13               /* Current data-stack frame ptr *x/ *//* OBSOLETE #define TR0_REGNUM 48               /* After function call, contains *//* OBSOLETE                                function result *x/ *//* OBSOLETE  *//* OBSOLETE /* Registers interesting to the machine-independent part of gdb*x/ *//* OBSOLETE  *//* OBSOLETE #define FP_REGNUM CSP_REGNUM        /* Contains address of executing (control) *//* OBSOLETE                                stack frame *x/ *//* OBSOLETE #define SP_REGNUM 14                /* Contains address of top of stack -??*x/ *//* OBSOLETE #define PC_REGNUM 15                /* Contains program counter *x/ *//* OBSOLETE  *//* OBSOLETE /* Define DO_REGISTERS_INFO() to do machine-specific formatting *//* OBSOLETE    of register dumps. *x/ *//* OBSOLETE  *//* OBSOLETE #define DO_REGISTERS_INFO(_regnum, fp) pyr_do_registers_info(_regnum, fp) *//* OBSOLETE  *//* OBSOLETE /* need this so we can find the global registers: they never get saved. *x/ *//* OBSOLETE extern unsigned int global_reg_offset; *//* OBSOLETE extern unsigned int last_frame_offset; *//* OBSOLETE  *//* OBSOLETE /* Total amount of space needed to store our copies of the machine's *//* OBSOLETE    register state, the array `registers'.  *x/ *//* OBSOLETE #define REGISTER_BYTES (NUM_REGS*4) *//* OBSOLETE  *//* OBSOLETE /* the Pyramid has register windows.  *x/ *//* OBSOLETE  *//* OBSOLETE #define HAVE_REGISTER_WINDOWS *//* OBSOLETE  *//* OBSOLETE /* Is this register part of the register window system?  A yes answer *//* OBSOLETE    implies that 1) The name of this register will not be the same in *//* OBSOLETE    other frames, and 2) This register is automatically "saved" (out *//* OBSOLETE    registers shifting into ins counts) upon subroutine calls and thus *//* OBSOLETE    there is no need to search more than one stack frame for it. *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_IN_WINDOW_P(regnum)        \ *//* OBSOLETE   ((regnum) >= 16 && (regnum) < 64) *//* OBSOLETE  *//* OBSOLETE /* Index within `registers' of the first byte of the space for *//* OBSOLETE    register N.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) *//* OBSOLETE  *//* OBSOLETE /* Number of bytes of storage in the actual machine representation *//* OBSOLETE    for register N.  On the Pyramid, all regs are 4 bytes.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_RAW_SIZE(N) 4 *//* OBSOLETE  *//* OBSOLETE /* Number of bytes of storage in the program's representation *//* OBSOLETE    for register N.  On the Pyramid, all regs are 4 bytes.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4 *//* OBSOLETE  *//* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  *x/ *//* OBSOLETE  *//* OBSOLETE #define MAX_REGISTER_RAW_SIZE 4 *//* OBSOLETE  *//* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  *x/ *//* OBSOLETE  *//* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 4 *//* OBSOLETE  *//* OBSOLETE /* Return the GDB type object for the "standard" data type *//* OBSOLETE    of data in register N.  *x/ *//* OBSOLETE  *//* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) builtin_type_int *//* OBSOLETE  *//* OBSOLETE /* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and *//* OBSOLETE    STORE_RETURN_VALUE to be correct. *x/ *//* OBSOLETE  *//* OBSOLETE /* Store the address of the place in which to copy the structure the *//* OBSOLETE    subroutine will return.  This is called from call_function. *x/ *//* OBSOLETE  *//* OBSOLETE /****FIXME****x/ *//* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ *//* OBSOLETE   { write_register (TR0_REGNUM, (ADDR)); } *//* OBSOLETE  *//* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state *//* OBSOLETE    a function return value of type TYPE, and copy that, in virtual format, *//* OBSOLETE    into VALBUF.  *x/ *//* OBSOLETE  *//* OBSOLETE /* Note that on a register-windowing machine (eg, Pyr, SPARC), this is *//* OBSOLETE    where the value is found after the function call -- ie, it should *//* OBSOLETE    correspond to GNU CC's FUNCTION_VALUE rather than FUNCTION_OUTGOING_VALUE.*x/ *//* OBSOLETE  *//* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ *//* OBSOLETE   memcpy (VALBUF, ((int *)(REGBUF))+TR0_REGNUM, TYPE_LENGTH (TYPE)) *//* OBSOLETE  *//* OBSOLETE /* Write into appropriate registers a function return value *//* OBSOLETE    of type TYPE, given in virtual format.  *x/ *//* OBSOLETE /* on pyrs, values are returned in *x/ *//* OBSOLETE  *//* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ *//* OBSOLETE   write_register_bytes (REGISTER_BYTE(TR0_REGNUM), VALBUF, TYPE_LENGTH (TYPE)) *//* OBSOLETE  *//* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state *//* OBSOLETE    the address in which a function should return its structure value, */

⌨️ 快捷键说明

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