📄 coff_sym.h
字号:
/* * Taken from binutils-2.14.90.0.5 include/coff/sym.h *//* Declarations of internal format of MIPS ECOFF symbols. Originally contributed by MIPS Computer Systems and Third Eye Software. Changes contributed by Cygnus Support are in the public domain. This file is just aggregated with the files that make up the GNU release; it is not considered part of GAS, GDB, or other GNU programs. *//* * |-----------------------------------------------------------| * | Copyright (c) 1992, 1991, 1990 MIPS Computer Systems, Inc.| * | MIPS Computer Systems, Inc. grants reproduction and use | * | rights to all parties, PROVIDED that this comment is | * | maintained in the copy. | * |-----------------------------------------------------------| */#ifndef _SYM_H#define _SYM_H/* (C) Copyright 1984 by Third Eye Software, Inc. * * Third Eye Software, Inc. grants reproduction and use rights to * all parties, PROVIDED that this comment is maintained in the copy. * * Third Eye makes no claims about the applicability of this * symbol table to a particular use. *//* * This file contains the definition of the Third Eye Symbol Table. * * Symbols are assumed to be in 'encounter order' - i.e. the order that * the things they represent were encountered by the compiler/assembler/loader. * EXCEPT for globals! These are assumed to be bunched together, * probably right after the last 'normal' symbol. Globals ARE sorted * in ascending order. * * ----------------------------------------------------------------------- * A brief word about Third Eye naming/use conventions: * * All arrays and index's are 0 based. * All "ifooMax" values are the highest legal value PLUS ONE. This makes * them good for allocating arrays, etc. All checks are "ifoo < ifooMax". * * "isym" Index into the SYMbol table. * "ipd" Index into the Procedure Descriptor array. * "ifd" Index into the File Descriptor array. * "iss" Index into String Space. * "cb" Count of Bytes. * "rgPd" array whose domain is "0..ipdMax-1" and RanGe is PDR. * "rgFd" array whose domain is "0..ifdMax-1" and RanGe is FDR. *//* * Symbolic Header (HDR) structure. * As long as all the pointers are set correctly, * we don't care WHAT order the various sections come out in! * * A file produced solely for the use of CDB will probably NOT have * any instructions or data areas in it, as these are available * in the original. */typedef struct ecoff_symhdr { coff_short magic; /* to verify validity of the table */ coff_short vstamp; /* version stamp */ coff_int ilineMax; /* number of line number entries */ coff_int idnMax; /* max index into dense number table */ coff_int ipdMax; /* number of procedures */ coff_int isymMax; /* number of local symbols */ coff_int ioptMax; /* max index into optimization symbol entries */ coff_int iauxMax; /* number of auxillary symbol entries */ coff_int issMax; /* max index into local strings */ coff_int issExtMax; /* max index into external strings */ coff_int ifdMax; /* number of file descriptor entries */ coff_int crfd; /* number of relative file descriptor entries */ coff_int iextMax; /* max index into external symbols */ coff_addr cbLine; /* number of bytes for line number entries */ coff_addr cbLineOffset; /* offset to start of line number entries*/ coff_addr cbDnOffset; /* offset to start dense number table */ coff_addr cbPdOffset; /* offset to procedure descriptor table */ coff_addr cbSymOffset; /* offset to start of local symbols*/ coff_addr cbOptOffset; /* offset to optimization symbol entries */ coff_addr cbAuxOffset; /* offset to start of auxillary symbol entries*/ coff_addr cbSsOffset; /* offset to start of local strings */ coff_addr cbSsExtOffset; /* offset to start of external strings */ coff_addr cbFdOffset; /* offset to file descriptor table */ coff_addr cbRfdOffset; /* offset to relative file descriptor table */ coff_addr cbExtOffset; /* offset to start of external symbol entries*/ /* If you add machine dependent fields, add them here */} HDRR, *pHDRR;#define cbHDRR sizeof(HDRR)#define hdrNil ((pHDRR)0)/* * The FDR and PDR structures speed mapping of address <-> name. * They are sorted in ascending memory order and are kept in * memory by CDB at runtime. *//* * File Descriptor * * There is one of these for EVERY FILE, whether compiled with * full debugging symbols or not. The name of a file should be * the path name given to the compiler. This allows the user * to simply specify the names of the directories where the COMPILES * were done, and we will be able to find their files. * A field whose comment starts with "R - " indicates that it will be * setup at runtime. */typedef struct ecoff_fdr { coff_addr adr; /* memory address of beginning of file */ coff_addr cbLineOffset; /* byte offset from header for this file ln's */ coff_addr cbLine; /* size of lines for this file */ coff_addr cbSs; /* number of bytes in the ss */ coff_int rss; /* file name (of source, if known) */ coff_int issBase; /* file's string space */ coff_int isymBase; /* beginning of symbols */ coff_int csym; /* count file's of symbols */ coff_int ilineBase; /* file's line symbols */ coff_int cline; /* count of file's line symbols */ coff_int ioptBase; /* file's optimization entries */ coff_int copt; /* count of file's optimization entries */ coff_int ipdFirst; /* start of procedures for this file */ coff_int cpd; /* count of procedures for this file */ coff_int iauxBase; /* file's auxiliary entries */ coff_int caux; /* count of file's auxiliary entries */ coff_int rfdBase; /* index into the file indirect table */ coff_int crfd; /* count file indirect entries */ unsigned lang: 5; /* language for this file */ unsigned fMerge : 1; /* whether this file can be merged */ unsigned fReadin : 1; /* true if it was read in (not just created) */ unsigned fBigendian : 1;/* if set, was compiled on big endian machine */ /* aux's will be in compile host's sex */ unsigned glevel : 2; /* level this file was compiled with */ unsigned reserved : 22; /* reserved for future use */ coff_uint reserved2;} FDR, *pFDR;#define cbFDR sizeof(FDR)#define fdNil ((pFDR)0)#define ifdNil -1#define ifdTemp 0#define ilnNil -1/* * Procedure Descriptor * * There is one of these for EVERY TEXT LABEL. * If a procedure is in a file with full symbols, then isym * will point to the PROC symbols, else it will point to the * global symbol for the label. */typedef struct pdr { coff_addr adr; /* memory address of start of procedure */ coff_addr cbLineOffset; /* byte offset for this procedure from the fd base */ coff_int isym; /* start of local symbol entries */ coff_int iline; /* start of line number entries*/ coff_uint regmask; /* save register mask */ coff_int regoffset; /* save register offset */ coff_int iopt; /* start of optimization symbol entries*/ coff_uint fregmask; /* save floating point register mask */ coff_int fregoffset; /* save floating point register offset */ coff_int frameoffset; /* frame size */ coff_int lnLow; /* lowest line in the procedure */ coff_int lnHigh; /* highest line in the procedure */ /* These fields are new for 64 bit ECOFF. */ unsigned gp_prologue : 8; /* byte size of GP prologue */ unsigned gp_used : 1; /* true if the procedure uses GP */ unsigned reg_frame : 1; /* true if register frame procedure */ unsigned prof : 1; /* true if compiled with -pg */ unsigned reserved : 13; /* reserved: must be zero */ unsigned localoff : 8; /* offset of local variables from vfp */ coff_short framereg; /* frame pointer register */ coff_short pcreg; /* offset or reg of return pc */} PDR, *pPDR;#define cbPDR sizeof(PDR)#define pdNil ((pPDR) 0)#define ipdNil -1/* * The structure of the runtime procedure descriptor created by the loader * for use by the static exception system. *//* * If 0'd out because exception_info chokes Visual C++ and because there * don't seem to be any references to this structure elsewhere in gdb. */#if 0typedef struct runtime_pdr { coff_addr adr; /* memory address of start of procedure */ coff_uint regmask; /* save register mask */ coff_int regoffset; /* save register offset */ coff_uint fregmask; /* save floating point register mask */ coff_int fregoffset; /* save floating point register offset */ coff_int frameoffset; /* frame size */ coff_ushort framereg; /* frame pointer register */ coff_ushort pcreg; /* offset or reg of return pc */ coff_int irpss; /* index into the runtime string table */ coff_uint reserved; struct exception_info *exception_info;/* pointer to exception array */} RPDR, *pRPDR;#define cbRPDR sizeof(RPDR)#define rpdNil ((pRPDR) 0)#endif/* * Line Numbers * * Line Numbers are segregated from the normal symbols because they * are [1] smaller , [2] are of no interest to your * average loader, and [3] are never needed in the middle of normal * scanning and therefore slow things down. * * By definition, the first LINER for any given procedure will have * the first line of a procedure and represent the first address. */typedef coff_int LINER, *pLINER;#define lineNil ((pLINER)0)#define cbLINER sizeof(LINER)#define ilineNil -1/* * The Symbol Structure (GFW, to those who Know!) */typedef struct ecoff_sym { coff_long value; /* value of symbol */ coff_int iss; /* index into String Space of name */ unsigned st : 6; /* symbol type */ unsigned sc : 5; /* storage class - text, data, etc */ unsigned reserved : 1; /* reserved */ unsigned index : 20; /* index into sym/aux table */} SYMR, *pSYMR;#define symNil ((pSYMR)0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -