tm-a29k.h
来自「gdb是linux下的一个远程调试环境.能让你很方便地调试linux下的代码.」· C头文件 代码 · 共 723 行 · 第 1/3 页
H
723 行
/* OBSOLETE (frameless_look_for_prologue (FI)) *//* OBSOLETE *//* OBSOLETE /* Saved pc (i.e. return address). */ *//* OBSOLETE #define FRAME_SAVED_PC(fraim) \ *//* OBSOLETE (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4)) *//* OBSOLETE *//* OBSOLETE /* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their *//* OBSOLETE offsets being relative to the memory stack pointer (high C) or *//* OBSOLETE saved_msp (gcc). */ *//* OBSOLETE *//* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi) *//* OBSOLETE extern CORE_ADDR frame_locals_address (); *//* OBSOLETE *//* OBSOLETE /* Return number of args passed to a frame. *//* OBSOLETE Can return -1, meaning no way to tell. */ *//* OBSOLETE /* We tried going to the effort of finding the tags word and getting *//* OBSOLETE the argcount field from it, to support debugging assembler code. *//* OBSOLETE Problem was, the "argcount" field never did hold the argument *//* OBSOLETE count. */ *//* OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) *//* OBSOLETE *//* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi) *//* OBSOLETE *//* OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ *//* OBSOLETE *//* OBSOLETE #define FRAME_ARGS_SKIP 0 *//* OBSOLETE *//* OBSOLETE /* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient *//* OBSOLETE because registers get renumbered on the a29k without getting saved. */ *//* OBSOLETE *//* OBSOLETE struct frame_info; *//* OBSOLETE void a29k_get_saved_register (char *raw_buffer, int *optimized, *//* OBSOLETE CORE_ADDR * addrp, struct frame_info *frame, *//* OBSOLETE int regnum, enum lval_type *lvalp); *//* OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ *//* OBSOLETE a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) *//* OBSOLETE *//* OBSOLETE /* Call function stuff. */ *//* OBSOLETE /* *INDENT-OFF* */ *//* OBSOLETE /* The dummy frame looks like this (see also the general frame picture *//* OBSOLETE above): *//* OBSOLETE *//* OBSOLETE register stack *//* OBSOLETE *//* OBSOLETE | | frame for function *//* OBSOLETE | locals_sproc | executing at time *//* OBSOLETE |________________| of call_function. *//* OBSOLETE | | We must not disturb *//* OBSOLETE | args_out_sproc | it. *//* OBSOLETE memory stack |________________| *//* OBSOLETE |____lr1_sproc___|<-+ *//* OBSOLETE | | |__retaddr_sproc_| | <-- gr1 (at start) *//* OBSOLETE |____________|<-msp 0 <-----------mfp_dummy_____| | *//* OBSOLETE | | (at start) | save regs | | *//* OBSOLETE | arg_slop | | pc0,pc1 | | *//* OBSOLETE | | | pc2,lr0 sproc | | *//* OBSOLETE | (16 words) | | gr96-gr124 | | *//* OBSOLETE |____________|<-msp 1--after | sr160-sr162 | | *//* OBSOLETE | | PUSH_DUMMY_FRAME| sr128-sr135 | | *//* OBSOLETE | struct ret | |________________| | *//* OBSOLETE | 17+ | | | | *//* OBSOLETE |____________|<- lrp | args_out_dummy | | *//* OBSOLETE | struct ret | | (16 words) | | *//* OBSOLETE | 16 | |________________| | *//* OBSOLETE | (16 words) | |____lr1_dummy___|--+ *//* OBSOLETE |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after *//* OBSOLETE | | struct ret | | PUSH_DUMMY_FRAME *//* OBSOLETE | margs17+ | area allocated | locals_inf | *//* OBSOLETE | | |________________| called *//* OBSOLETE |____________|<- msp 4--when | | function's *//* OBSOLETE | | inf called | args_out_inf | frame (set up *//* OBSOLETE | margs16 | |________________| by called *//* OBSOLETE | (16 words) | |_____lr1_inf____| function). *//* OBSOLETE |____________|<- msp 3--after | . | *//* OBSOLETE | | args pushed | . | *//* OBSOLETE | | | . | *//* OBSOLETE | | *//* OBSOLETE *//* OBSOLETE arg_slop: This area is so that when the call dummy adds 16 words to *//* OBSOLETE the msp, it won't end up larger than mfp_dummy (it is needed in the *//* OBSOLETE case where margs and struct_ret do not add up to at least 16 words). *//* OBSOLETE struct ret: This area is allocated by GDB if the return value is more *//* OBSOLETE than 16 words. struct ret_16 is not used on the a29k. *//* OBSOLETE margs: Pushed by GDB. The call dummy copies the first 16 words to *//* OBSOLETE args_out_dummy. *//* OBSOLETE retaddr_sproc: Contains the PC at the time we call the function. *//* OBSOLETE set by PUSH_DUMMY_FRAME and read by POP_FRAME. *//* OBSOLETE retaddr_dummy: This points to a breakpoint instruction in the dummy. */ *//* OBSOLETE /* *INDENT-ON* */ *//* OBSOLETE *//* OBSOLETE *//* OBSOLETE *//* OBSOLETE /* Rsize for dummy frame, in bytes. */ *//* OBSOLETE *//* OBSOLETE /* Bytes for outgoing args, lr1, and retaddr. */ *//* OBSOLETE #define DUMMY_ARG (2 * 4 + 16 * 4) *//* OBSOLETE *//* OBSOLETE /* Number of special registers (sr128-) to save. */ *//* OBSOLETE #define DUMMY_SAVE_SR128 8 *//* OBSOLETE /* Number of special registers (sr160-) to save. */ *//* OBSOLETE #define DUMMY_SAVE_SR160 3 *//* OBSOLETE /* Number of general (gr96- or gr64-) registers to save. */ *//* OBSOLETE #define DUMMY_SAVE_GREGS 29 *//* OBSOLETE *//* OBSOLETE #define DUMMY_FRAME_RSIZE \ *//* OBSOLETE (4 /* mfp_dummy */ \ *//* OBSOLETE + 4 * 4 /* pc0, pc1, pc2, lr0 */ \ *//* OBSOLETE + DUMMY_SAVE_GREGS * 4 \ *//* OBSOLETE + DUMMY_SAVE_SR160 * 4 \ *//* OBSOLETE + DUMMY_SAVE_SR128 * 4 \ *//* OBSOLETE + DUMMY_ARG \ *//* OBSOLETE + 4 /* pad to doubleword */ ) *//* OBSOLETE *//* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. */ *//* OBSOLETE *//* OBSOLETE #define PUSH_DUMMY_FRAME push_dummy_frame() *//* OBSOLETE extern void push_dummy_frame (); *//* OBSOLETE *//* OBSOLETE /* Discard from the stack the innermost frame, *//* OBSOLETE restoring all saved registers. */ *//* OBSOLETE *//* OBSOLETE #define POP_FRAME pop_frame() *//* OBSOLETE extern void pop_frame (); *//* OBSOLETE *//* OBSOLETE /* This sequence of words is the instructions *//* OBSOLETE mtsrim cr, 15 *//* OBSOLETE loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers *//* OBSOLETE add msp, msp, 16 * 4 ; point to the remaining arguments *//* OBSOLETE CONST_INSN: *//* OBSOLETE const lr0,inf ; (replaced by half of target addr) *//* OBSOLETE consth lr0,inf ; (replaced by other half of target addr) *//* OBSOLETE calli lr0, lr0 *//* OBSOLETE aseq 0x40,gr1,gr1 ; nop *//* OBSOLETE BREAKPT_INSN: *//* OBSOLETE asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn) *//* OBSOLETE */ *//* OBSOLETE *//* OBSOLETE #error "This file is broken. GDB does not define HOST_BYTE_ORDER." *//* OBSOLETE #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER *//* OBSOLETE #define BS(const) const *//* OBSOLETE #else *//* OBSOLETE #define BS(const) (((const) & 0xff) << 24) | \ *//* OBSOLETE (((const) & 0xff00) << 8) | \ *//* OBSOLETE (((const) & 0xff0000) >> 8) | \ *//* OBSOLETE (((const) & 0xff000000) >> 24) *//* OBSOLETE #endif *//* OBSOLETE *//* OBSOLETE /* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */ *//* OBSOLETE #define CONST_INSN (3 * 4) *//* OBSOLETE #define BREAKPT_INSN (7 * 4) *//* OBSOLETE #define CALL_DUMMY { \ *//* OBSOLETE BS(0x0400870f),\ *//* OBSOLETE BS(0x36008200|(MSP_HW_REGNUM)), \ *//* OBSOLETE BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \ *//* OBSOLETE BS(0x03ff80ff), \ *//* OBSOLETE BS(0x02ff80ff), \ *//* OBSOLETE BS(0xc8008080), \ *//* OBSOLETE BS(0x70400101), \ *//* OBSOLETE BS(0x72500101)} *//* OBSOLETE #define CALL_DUMMY_LENGTH (8 * 4) *//* OBSOLETE *//* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ *//* OBSOLETE *//* OBSOLETE /* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a *//* OBSOLETE word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with *//* OBSOLETE bits 0-7 and 8-15 of DATA (which is in host byte order). */ *//* OBSOLETE *//* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG *//* OBSOLETE #define STUFF_I16(WORDP, DATA) \ *//* OBSOLETE { \ *//* OBSOLETE *((char *)(WORDP) + 3) = ((DATA) & 0xff);\ *//* OBSOLETE *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\ *//* OBSOLETE } *//* OBSOLETE #else /* Target is little endian. */ *//* OBSOLETE #define STUFF_I16(WORDP, DATA) \ *//* OBSOLETE { *//* OBSOLETE *(char *) (WORDP) = ((DATA) & 0xff); *//* OBSOLETE *((char *) (WORDP) + 2) = (((DATA) >> 8) & 0xff); *//* OBSOLETE } *//* OBSOLETE #endif /* Target is little endian. */ *//* OBSOLETE *//* OBSOLETE /* Insert the specified number of args and function address *//* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. */ *//* OBSOLETE *//* OBSOLETE /* Currently this stuffs in the address of the function that we are calling. *//* OBSOLETE Since different a29k systems use different breakpoint instructions, it *//* OBSOLETE also stuffs BREAKPOINT in the right place (to avoid having to *//* OBSOLETE duplicate CALL_DUMMY in each tm-*.h file). */ *//* OBSOLETE *//* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ *//* OBSOLETE {\ *//* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun); \ *//* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ *//* OBSOLETE /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \ *//* OBSOLETE } *//* OBSOLETE *//* OBSOLETE /* a29k architecture has separate data & instruction memories -- wired to *//* OBSOLETE different pins on the chip -- and can't execute the data memory. *//* OBSOLETE Also, there should be space after text_end; *//* OBSOLETE we won't get a SIGSEGV or scribble on data space. */ *//* OBSOLETE *//* OBSOLETE #define CALL_DUMMY_LOCATION AFTER_TEXT_END *//* OBSOLETE *//* OBSOLETE /* Because of this, we need (as a kludge) to know the addresses of the *//* OBSOLETE text section. */ *//* OBSOLETE *//* OBSOLETE #define NEED_TEXT_START_END 1 *//* OBSOLETE *//* OBSOLETE /* How to translate register numbers in the .stab's into gdb's internal register *//* OBSOLETE numbers. We don't translate them, but we warn if an invalid register *//* OBSOLETE number is seen. Note that FIXME, we use the value "sym" as an implicit *//* OBSOLETE argument in printing the error message. It happens to be available where *//* OBSOLETE this macro is used. (This macro definition appeared in a late revision *//* OBSOLETE of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */ *//* OBSOLETE *//* OBSOLETE #define STAB_REG_TO_REGNUM(num) \ *//* OBSOLETE (((num) > LR0_REGNUM + 127) \ *//* OBSOLETE ? fprintf(stderr, \ *//* OBSOLETE "Invalid register number %d in symbol table entry for %s\n", \ *//* OBSOLETE (num), SYMBOL_SOURCE_NAME (sym)), (num) \ *//* OBSOLETE : (num)) *//* OBSOLETE *//* OBSOLETE extern enum a29k_processor_types *//* OBSOLETE { *//* OBSOLETE a29k_unknown, *//* OBSOLETE *//* OBSOLETE /* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000, *//* OBSOLETE 29030, etc. */ *//* OBSOLETE a29k_no_freeze_mode, *//* OBSOLETE *//* OBSOLETE /* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050. */ *//* OBSOLETE a29k_freeze_mode *//* OBSOLETE } *//* OBSOLETE processor_type; *//* OBSOLETE *//* OBSOLETE /* We need three arguments for a general frame specification for the *//* OBSOLETE "frame" or "info frame" command. */ *//* OBSOLETE *//* OBSOLETE #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) *//* OBSOLETE extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?