stabs.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /* ----------------------------------------------------------------------- *
  2. *
  3. * Copyright 1996-2018 The NASM Authors - All Rights Reserved
  4. * See the file AUTHORS included with the NASM distribution for
  5. * the specific copyright holders.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following
  9. * conditions are met:
  10. *
  11. * * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * * Redistributions in binary form must reproduce the above
  14. * copyright notice, this list of conditions and the following
  15. * disclaimer in the documentation and/or other materials provided
  16. * with the distribution.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  19. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  20. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  23. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  26. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  30. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. * ----------------------------------------------------------------------- */
  33. #ifndef STABS_H_
  34. #define STABS_H_
  35. #include "nctype.h"
  36. #include "compiler.h"
  37. #include "nasmlib.h"
  38. #include "nasm.h"
  39. /* offsets */
  40. enum stab_offsets {
  41. STAB_strdxoff = 0,
  42. STAB_typeoff = 4,
  43. STAB_otheroff = 5,
  44. STAB_descoff = 6,
  45. STAB_valoff = 8,
  46. STAB_stabsize = 12
  47. };
  48. /* stab/non-stab types */
  49. enum stab_types {
  50. N_UNDF = 0x00, /* Undefined symbol */
  51. N_EXT = 0x01, /* External symbol */
  52. N_ABS = 0x02, /* Absolute symbol */
  53. N_ABS_EXT = 0x03, /* Absolute external symbol */
  54. N_TEXT = 0x04, /* Symbol in text segment */
  55. N_TEXT_EXT = 0x05, /* Symbol in external text segment */
  56. N_DATA = 0x06,
  57. N_DATA_EXT = 0x07,
  58. N_BSS = 0x08,
  59. N_BSS_EXT = 0x09,
  60. N_INDR = 0x0a,
  61. N_FN_SEQ = 0x0c, /* N_FN from Sequent compilers */
  62. N_WEAKU = 0x0d, /* Weak undefined symbol */
  63. N_WEAKA = 0x0e, /* Weak absolute symbl */
  64. N_WEAKT = 0x0f, /* Weak text symbol */
  65. N_WEAKD = 0x10, /* Weak data symbol */
  66. N_WEAKB = 0x11, /* Weak bss symbol */
  67. N_COMM = 0x12, /* Common symbol */
  68. N_SETA = 0x14, /* Absolute set element symbol */
  69. N_SETA_EXT = 0x15,
  70. N_SETT = 0x16, /* Text set element symbol */
  71. N_SETT_EXT = 0x17,
  72. N_SETD = 0x18, /* Data set element symbol */
  73. N_SETD_EXT = 0x19,
  74. N_SETB = 0x1a, /* BSS set element symbol */
  75. N_SETB_EXT = 0x1b,
  76. N_SETV = 0x1c, /* Pointer to set vector in data area */
  77. N_SETV_EXT = 0x1d,
  78. N_WARNING = 0x1e, /* Warning symbol */
  79. N_FN = 0x1f, /* Filename of .o file */
  80. N_GSYM = 0x20, /* Global variable */
  81. N_FNAME = 0x22, /* Function name for BSD Fortran */
  82. N_FUN = 0x24, /* Function name or text segment variable for C */
  83. N_STSYM = 0x26, /* Data-segment variable with internal linkage */
  84. N_LCSYM = 0x28, /* BSS-segment variable with internal linkage */
  85. N_MAIN = 0x2a, /* Name of main routine */
  86. N_ROSYM = 0x2c, /* Read-only data symbols */
  87. N_BNSYM = 0x2e, /* The beginning of a relocatable function block */
  88. N_PC = 0x30, /* Global symbol in Pascal */
  89. N_NSYMS = 0x32, /* Number of symbols */
  90. N_NOMAP = 0x34, /* No DST map for sym */
  91. N_OBJ = 0x38, /* Like N_SO, but for the object file */
  92. N_OPT = 0x3c, /* Options for the debugger */
  93. N_RSYM = 0x40, /* Register variable */
  94. N_M2C = 0x42, /* Modula-2 compilation unit */
  95. N_SLINE = 0x44, /* Line number in text segment */
  96. N_DSLINE = 0x46, /* Line number in data segment */
  97. N_BSLINE = 0x48, /* Line number in bss segment */
  98. N_BROWS = 0x48, /* Sun's source-code browser stabs */
  99. N_DEFD = 0x4a, /* GNU Modula-2 definition module dependency */
  100. N_FLINE = 0x4c, /* Function start/body/end line numbers */
  101. N_ENSYM = 0x4e, /* This tells the end of a relocatable function */
  102. N_EHDECL = 0x50, /* GNU C++ exception variable */
  103. N_MOD2 = 0x50, /* Modula2 info "for imc" */
  104. N_CATCH = 0x54, /* GNU C++ `catch' clause */
  105. N_SSYM = 0x60, /* Structure or union element */
  106. N_ENDM = 0x62, /* Last stab emitted for module */
  107. N_SO = 0x64, /* ID for main source file */
  108. N_OSO = 0x66, /* Apple: This is the stab that associated the .o file */
  109. N_ALIAS = 0x6c, /* SunPro F77: Name of alias */
  110. N_LSYM = 0x80, /* Automatic variable in the stack */
  111. N_BINCL = 0x82, /* Beginning of an include file */
  112. N_SOL = 0x84, /* ID for sub-source file */
  113. N_PSYM = 0xa0, /* Parameter variable */
  114. N_EINCL = 0xa2, /* End of an include file */
  115. N_ENTRY = 0xa4, /* Alternate entry point */
  116. N_LBRAC = 0xc0, /* Beginning of lexical block */
  117. N_EXCL = 0xc2, /* Place holder for deleted include file */
  118. N_SCOPE = 0xc4, /* Modula-2 scope information */
  119. N_PATCH = 0xd0, /* Solaris2: Patch Run Time Checker */
  120. N_RBRAC = 0xe0, /* End of a lexical block */
  121. N_BCOMM = 0xe2, /* Begin named common block */
  122. N_ECOMM = 0xe4, /* End named common block */
  123. N_ECOML = 0xe8, /* Member of a common block */
  124. N_WITH = 0xea, /* Solaris2: Pascal "with" statement */
  125. N_NBTEXT = 0xf0,
  126. N_NBDATA = 0xf2,
  127. N_NBBSS = 0xf4,
  128. N_NBSTS = 0xf6,
  129. N_NBLCS = 0xf8,
  130. N_LENG = 0xfe /* Second symbol entry whih a length-value for the preceding entry */
  131. };
  132. enum stab_source_file {
  133. N_SO_AS = 0x01,
  134. N_SO_C = 0x02,
  135. N_SO_ANSI_C = 0x03,
  136. N_SO_CC = 0x04,
  137. N_SO_FORTRAN = 0x05,
  138. N_SO_PASCAL = 0x06,
  139. N_SO_FORTRAN90 = 0x07,
  140. N_SO_OBJC = 0x32,
  141. N_SO_OBJCPLUS = 0x33
  142. };
  143. #endif /* STABS_H_ */