📄 tm-nisa.h
字号:
/* Copyright (c) 1990-1994,1997,1998,1999 Analog Devices Inc., All Rights ReservedThis material is considered highly CONFIDENTIAL and SENSITIVEbackground Interlectual Property of Analog Devices Inc. Its recipientis required to adhear to the LICENSE agreement.This software is being provided to you, the LICENSEE, by AnalogDevices Inc (ADI) under the following license. The following softwareis proprietary background Intelectual Property of Analog Devices andcan not be used by its LICENSEE without written consent from ADI.By obtaining, using and/or copying this software, you agree that youhave read, understood, and will comply with these terms andconditions:1. You may not, copy, modify or distribute, this software with out a written agreement from Analog Devices.THIS SOFTWARE IS PROVIDED "AS IS", AND ADI MAKES NO REPRESENTATIONSOR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but notlimitation, ADI MAKES NO REPRESENTATIONS OR WARRANTIES OFMERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USEOF THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRDPARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.*//* Defines needed when configuring for "nisa". Copyright (C) 1993 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#include "value.h"#include "defs.h"#include "symtab.h"#include "frame.h"/* This define is needed so that "gcc -MM" doesn't get errors and fail on source files that use the value of INNER_THAN in preprocessor lines. *//* Stack grows downward. */#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))/* Define the bit, byte, and word ordering of the machine. */#define TARGET_BYTE_ORDER LITTLE_ENDIAN/* 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(ip) nisa_skip_prologue(ip)/* 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) nisa_saved_pc_after_call(frame)/* If your kernel resets the pc after the trap happens you may need to define this before including this file. */#define DECR_PC_AFTER_BREAK 0/* Say how long registers are. */#define REGISTER_TYPE unsigned intchar **gdbtgt_regnames ();int gdbtgt_nregs ();#define REGISTER_NAMES \ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "p0", "p1", "p2", "p3", "p4", "p5", "sp", "fp", \ "pc", "rets" }#define NUM_REGS 18#define NUM_FREGS 0#define REGISTER_BYTES (NUM_REGS *4)/* 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 z8k, all but the pc are 2 bytes, but we keep them all as 4 bytes and trim them on I/O */#define REGISTER_RAW_SIZE(N) 4/* 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 4/* Largest value REGISTER_VIRTUAL_SIZE can have. */#define MAX_REGISTER_VIRTUAL_SIZE 4/* Return the GDB type object for the "standard" data type of data in register N. */#define REGISTER_VIRTUAL_TYPE(N) builtin_type_long/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y)*//* Initializer for an array of names of registers. Entries beyond the first NUM_REGS are ignored. *//* 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 R0_REGNUM 0 /* The return value register */#define R2_REGNUM 2 /* The last argument in register */#define R7_REGNUM 7#define P5_REGNUM 13#define SP_REGNUM 14 /* Contains sp, whatever memory model */#define FP_REGNUM 15 /* Conatins fp, whatever memory model */#define PC_REGNUM 16 /* Contains program counter */#define RETS_REGNUM 17/* 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 (R0_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. This is assuming that floating point values are returned as doubles in d0/d1. */#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ memcpy(VALBUF, REGBUF + REGISTER_BYTE(R0_REGNUM), 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(R0_REGNUM), VALBUF, TYPE_LENGTH(TYPE))/* 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) (*(CORE_ADDR *)(REGBUF))/* Describe the pointer in each stack frame to the previous stack frame (its caller). *//* FRAME_CHAIN takes a frame's nominal address and produces the frame's chain-pointer. In the case of the Z8000, the frame's nominal address is the address of a ptr sized byte word containing the calling frame's address. */#define FRAME_CHAIN(thisframe) nisa_frame_chain(thisframe)/* Define other aspects of the stack frame. *//* A macro that tells us whether the function invocation represented by FI does not have a frame on the stack associated with it. If it does not, FRAMELESS is set to 1, else 0. */#define FRAMELESS_FUNCTION_INVOCATION(FI) frameless_look_for_prologue(FI)#define FRAME_SAVED_PC(FRAME) nisa_frame_saved_pc(FRAME)#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)/* Set VAL to the number of args passed to frame described by FI. Can set VAL to -1, meaning no way to tell. *//* We can't tell how many args there are now that the C compiler delays popping them. */#if !defined (FRAME_NUM_ARGS)/* #define FRAME_NUM_ARGS(val,fi) (val = -1) */#define FRAME_NUM_ARGS(fi) -1#endif/* Return number of bytes at start of arglist that are not really args. */#define FRAME_ARGS_SKIP 8#ifdef __STDC__struct frame_info;#endifextern void nisa_frame_init_saved_regs PARAMS ((struct frame_info *));#define FRAME_INIT_SAVED_REGS(fi) nisa_frame_init_saved_regs (fi)/* Things needed for making the inferior call functions. The CALL_DUMMY macro is the sequence of instructions, as disassembled by gdb itself: CALL 0x0 ; pcrel24 An_illegal_instruction ; for breakpoint*/#define CALL_DUMMY { 0xe300, 0xff00 }#define CALL_DUMMY_LENGTH 8 /* Size of CALL_DUMMY */#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */#define CALL_DUMMY_BREAKPOINT_OFFSET 4 /* Insert the specified number of args and function address into a call sequence of the above form stored at DUMMYNAME. We use the BFD routines to store a little-endian value of known size. */#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \{ \ int from, to, delta, loc; \ to = (int)(fun); \ delta = to - (int)pc; \ *((unsigned short *)(dummyname) + 1) = ((delta)>>1 & 0xffff); \ *((unsigned short *)(dummyname)) |= ((delta >> 17) & 0xff); \}/* Push an empty stack frame, to record the current PC, etc. */#define PUSH_DUMMY_FRAME { nisa_push_dummy_frame (); }extern void nisa_push_dummy_frame PARAMS ((void));extern void nisa_pop_frame PARAMS ((void));/* Discard from the stack the innermost frame, restoring all registers. */#define POP_FRAME { nisa_pop_frame (); }/* Offset from SP to first arg on stack at first instruction of a function */#define SP_ARG0 (1 * 4)#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)#define NO_STD_REGS#if 0#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)#endif#define REGISTER_SIZE 4#define N_ALIAS 9999912/* has conflicts with original definition in gdb-5.0/include/aout/stab.def */#if !defined (REMOTE_BREAKPOINT)#define REMOTE_BREAKPOINT {0xff, 0x00}#endif/* The following 3 functions are used to fix the bug in printing arguments in "si" command. By Qiao Junqi 20030723 */#if defined(TARGET_REVISE_ARG_IN_REG)#undef TARGET_REVISE_ARG_IN_REG#endif#define TARGET_REVISE_ARG_IN_REG(sym, frame, regnum) \nisa_revise_arg_in_reg(sym, frame, regnum)value_ptr nisa_revise_arg_in_reg(struct symbol *sym, struct frame_info *frame, int argnum);#if defined(TARGET_CHECK_ARG_IN_REG)#undef TARGET_CHECK_ARG_IN_REG#endif#define TARGET_CHECK_ARG_IN_REG(sym) nisa_check_arg_in_reg(sym)int nisa_check_arg_in_reg(struct symbol *sym);#if defined(TARGET_AT_FUNCTION_START)#undef TARGET_AT_FUNCTION_START#endif#define TARGET_AT_FUNCTION_START(stop_pc) nisa_at_function_start(stop_pc)int nisa_at_function_start(CORE_ADDR pc);#define TARGET_NISA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -