ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

rsym.h
Go to the documentation of this file.
00001 /* rsym.h */
00002 
00003 #pragma once
00004 #include "../pecoff.h"
00005 
00006 typedef struct {
00007   USHORT f_magic;         /* magic number             */
00008   USHORT f_nscns;         /* number of sections       */
00009   ULONG  f_timdat;        /* time & date stamp        */
00010   ULONG  f_symptr;        /* file pointer to symtab   */
00011   ULONG  f_nsyms;         /* number of symtab entries */
00012   USHORT f_opthdr;        /* sizeof(optional hdr)     */
00013   USHORT f_flags;         /* flags                    */
00014 } FILHDR;
00015 
00016 typedef struct {
00017   char           s_name[8];  /* section name                     */
00018   ULONG  s_paddr;    /* physical address, aliased s_nlib */
00019   ULONG  s_vaddr;    /* virtual address                  */
00020   ULONG  s_size;     /* section size                     */
00021   ULONG  s_scnptr;   /* file ptr to raw data for section */
00022   ULONG  s_relptr;   /* file ptr to relocation           */
00023   ULONG  s_lnnoptr;  /* file ptr to line numbers         */
00024   USHORT s_nreloc;   /* number of relocation entries     */
00025   USHORT s_nlnno;    /* number of line number entries    */
00026   ULONG  s_flags;    /* flags                            */
00027 } SCNHDR;
00028 #pragma pack(4)
00029 
00030 typedef struct _SYMBOLFILE_HEADER {
00031   ULONG SymbolsOffset;
00032   ULONG SymbolsLength;
00033   ULONG StringsOffset;
00034   ULONG StringsLength;
00035 } SYMBOLFILE_HEADER, *PSYMBOLFILE_HEADER;
00036 
00037 typedef struct _STAB_ENTRY {
00038   ULONG n_strx;         /* index into string table of name */
00039   UCHAR n_type;         /* type of symbol */
00040   UCHAR n_other;        /* misc info (usually empty) */
00041   USHORT n_desc;        /* description field */
00042   ULONG n_value;        /* value of symbol */
00043 } STAB_ENTRY, *PSTAB_ENTRY;
00044 
00045 /* http://www.math.utah.edu/docs/info/stabs_12.html */
00046 #define N_GYSM   0x20
00047 #define N_FNAME  0x22
00048 #define N_FUN    0x24
00049 #define N_STSYM  0x26
00050 #define N_LCSYM  0x28
00051 #define N_MAIN   0x2A
00052 #define N_PC     0x30
00053 #define N_NSYMS  0x32
00054 #define N_NOMAP  0x34
00055 #define N_RSYM   0x40
00056 #define N_M2C    0x42
00057 #define N_SLINE  0x44
00058 #define N_DSLINE 0x46
00059 #define N_BSLINE 0x48
00060 #define N_BROWS  0x48
00061 #define N_DEFD   0x4A
00062 #define N_EHDECL 0x50
00063 #define N_MOD2   0x50
00064 #define N_CATCH  0x54
00065 #define N_SSYM   0x60
00066 #define N_SO     0x64
00067 #define N_LSYM   0x80
00068 #define N_BINCL  0x82
00069 #define N_SOL    0x84
00070 #define N_PSYM   0xA0
00071 #define N_EINCL  0xA2
00072 #define N_ENTRY  0xA4
00073 #define N_LBRAC  0xC0
00074 #define N_EXCL   0xC2
00075 #define N_SCOPE  0xC4
00076 #define N_RBRAC  0xE0
00077 #define N_BCOMM  0xE2
00078 #define N_ECOMM  0xE4
00079 #define N_ECOML  0xE8
00080 #define N_LENG   0xFE
00081 
00082 /* COFF symbol table */
00083 
00084 #define E_SYMNMLEN  8   /* # characters in a symbol name    */
00085 #define E_FILNMLEN  14  /* # characters in a file name      */
00086 #define E_DIMNUM    4   /* # array dimensions in auxiliary entry */
00087 
00088 #define N_BTMASK    (0xf)
00089 #define N_TMASK     (0x30)
00090 #define N_BTSHFT    (4)
00091 #define N_TSHIFT    (2)
00092 
00093 /* derived types, in e_type */
00094 #define DT_NON      (0) /* no derived type */
00095 #define DT_PTR      (1) /* pointer */
00096 #define DT_FCN      (2) /* function */
00097 #define DT_ARY      (3) /* array */
00098 
00099 #define BTYPE(x)    ((x) & N_BTMASK)
00100 
00101 #define ISPTR(x)    (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
00102 #define ISFCN(x)    (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
00103 #define ISARY(x)    (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
00104 #define ISTAG(x)    ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
00105 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
00106 
00107 #define C_EFCN      0xff    /* physical end of function */
00108 #define C_NULL      0
00109 #define C_AUTO      1   /* automatic variable       */
00110 #define C_EXT       2   /* external symbol      */
00111 #define C_STAT      3   /* static           */
00112 #define C_REG       4   /* register variable        */
00113 #define C_EXTDEF    5   /* external definition      */
00114 #define C_LABEL     6   /* label            */
00115 #define C_ULABEL    7   /* undefined label      */
00116 #define C_MOS       8   /* member of structure      */
00117 #define C_ARG       9   /* function argument        */
00118 #define C_STRTAG    10  /* structure tag        */
00119 #define C_MOU       11  /* member of union      */
00120 #define C_UNTAG     12  /* union tag            */
00121 #define C_TPDEF     13  /* type definition      */
00122 #define C_USTATIC   14  /* undefined static     */
00123 #define C_ENTAG     15  /* enumeration tag      */
00124 #define C_MOE       16  /* member of enumeration    */
00125 #define C_REGPARM   17  /* register parameter       */
00126 #define C_FIELD     18  /* bit field            */
00127 #define C_AUTOARG   19  /* auto argument        */
00128 #define C_LASTENT   20  /* dummy entry (end of block)   */
00129 #define C_BLOCK     100 /* ".bb" or ".eb"       */
00130 #define C_FCN       101 /* ".bf" or ".ef"       */
00131 #define C_EOS       102 /* end of structure     */
00132 #define C_FILE      103 /* file name            */
00133 #define C_LINE      104 /* line # reformatted as symbol table entry */
00134 #define C_ALIAS     105 /* duplicate tag        */
00135 #define C_HIDDEN    106 /* ext symbol in dmert public lib */
00136 
00137 #pragma pack(1)
00138 typedef struct _COFF_SYMENT
00139 {
00140   union
00141     {
00142       char e_name[E_SYMNMLEN];
00143       struct
00144         {
00145           ULONG e_zeroes;
00146           ULONG e_offset;
00147         }
00148       e;
00149     }
00150   e;
00151   ULONG e_value;
00152   short e_scnum;
00153   USHORT e_type;
00154   UCHAR e_sclass;
00155   UCHAR e_numaux;
00156 } COFF_SYMENT, *PCOFF_SYMENT;
00157 #pragma pack(4)
00158 
00159 typedef struct _ROSSYM_ENTRY {
00160   ULONG_PTR Address;
00161   ULONG FunctionOffset;
00162   ULONG FileOffset;
00163   ULONG SourceLine;
00164 } ROSSYM_ENTRY, *PROSSYM_ENTRY;
00165 
00166 #define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1))
00167 
00168 extern char*
00169 convert_path(const char* origpath);
00170 
00171 extern void*
00172 load_file ( const char* file_name, size_t* file_size );

Generated on Fri May 25 2012 04:36:11 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.