| 1 |
/* SPDX-License-Identifier: BSD-2-Clause */ |
| 2 |
/* Copyright 1996-2018 The NASM Authors - All Rights Reserved */ |
| 3 |
|
| 4 |
#ifndef STABS_H_ |
| 5 |
#define STABS_H_ |
| 6 |
|
| 7 |
#include "nctype.h" |
| 8 |
|
| 9 |
#include "compiler.h" |
| 10 |
#include "nasmlib.h" |
| 11 |
#include "nasm.h" |
| 12 |
|
| 13 |
/* offsets */ |
| 14 |
enum stab_offsets { |
| 15 |
STAB_strdxoff = 0, |
| 16 |
STAB_typeoff = 4, |
| 17 |
STAB_otheroff = 5, |
| 18 |
STAB_descoff = 6, |
| 19 |
STAB_valoff = 8, |
| 20 |
STAB_stabsize = 12 |
| 21 |
}; |
| 22 |
|
| 23 |
/* stab/non-stab types */ |
| 24 |
enum stab_types { |
| 25 |
N_UNDF = 0x00, /* Undefined symbol */ |
| 26 |
N_EXT = 0x01, /* External symbol */ |
| 27 |
N_ABS = 0x02, /* Absolute symbol */ |
| 28 |
N_ABS_EXT = 0x03, /* Absolute external symbol */ |
| 29 |
N_TEXT = 0x04, /* Symbol in text segment */ |
| 30 |
N_TEXT_EXT = 0x05, /* Symbol in external text segment */ |
| 31 |
N_DATA = 0x06, |
| 32 |
N_DATA_EXT = 0x07, |
| 33 |
N_BSS = 0x08, |
| 34 |
N_BSS_EXT = 0x09, |
| 35 |
N_INDR = 0x0a, |
| 36 |
N_FN_SEQ = 0x0c, /* N_FN from Sequent compilers */ |
| 37 |
N_WEAKU = 0x0d, /* Weak undefined symbol */ |
| 38 |
N_WEAKA = 0x0e, /* Weak absolute symbl */ |
| 39 |
N_WEAKT = 0x0f, /* Weak text symbol */ |
| 40 |
N_WEAKD = 0x10, /* Weak data symbol */ |
| 41 |
N_WEAKB = 0x11, /* Weak bss symbol */ |
| 42 |
N_COMM = 0x12, /* Common symbol */ |
| 43 |
N_SETA = 0x14, /* Absolute set element symbol */ |
| 44 |
N_SETA_EXT = 0x15, |
| 45 |
N_SETT = 0x16, /* Text set element symbol */ |
| 46 |
N_SETT_EXT = 0x17, |
| 47 |
N_SETD = 0x18, /* Data set element symbol */ |
| 48 |
N_SETD_EXT = 0x19, |
| 49 |
N_SETB = 0x1a, /* BSS set element symbol */ |
| 50 |
N_SETB_EXT = 0x1b, |
| 51 |
N_SETV = 0x1c, /* Pointer to set vector in data area */ |
| 52 |
N_SETV_EXT = 0x1d, |
| 53 |
N_WARNING = 0x1e, /* Warning symbol */ |
| 54 |
N_FN = 0x1f, /* Filename of .o file */ |
| 55 |
N_GSYM = 0x20, /* Global variable */ |
| 56 |
N_FNAME = 0x22, /* Function name for BSD Fortran */ |
| 57 |
N_FUN = 0x24, /* Function name or text segment variable for C */ |
| 58 |
N_STSYM = 0x26, /* Data-segment variable with internal linkage */ |
| 59 |
N_LCSYM = 0x28, /* BSS-segment variable with internal linkage */ |
| 60 |
N_MAIN = 0x2a, /* Name of main routine */ |
| 61 |
N_ROSYM = 0x2c, /* Read-only data symbols */ |
| 62 |
N_BNSYM = 0x2e, /* The beginning of a relocatable function block */ |
| 63 |
N_PC = 0x30, /* Global symbol in Pascal */ |
| 64 |
N_NSYMS = 0x32, /* Number of symbols */ |
| 65 |
N_NOMAP = 0x34, /* No DST map for sym */ |
| 66 |
N_OBJ = 0x38, /* Like N_SO, but for the object file */ |
| 67 |
N_OPT = 0x3c, /* Options for the debugger */ |
| 68 |
N_RSYM = 0x40, /* Register variable */ |
| 69 |
N_M2C = 0x42, /* Modula-2 compilation unit */ |
| 70 |
N_SLINE = 0x44, /* Line number in text segment */ |
| 71 |
N_DSLINE = 0x46, /* Line number in data segment */ |
| 72 |
N_BSLINE = 0x48, /* Line number in bss segment */ |
| 73 |
N_BROWS = 0x48, /* Sun's source-code browser stabs */ |
| 74 |
N_DEFD = 0x4a, /* GNU Modula-2 definition module dependency */ |
| 75 |
N_FLINE = 0x4c, /* Function start/body/end line numbers */ |
| 76 |
N_ENSYM = 0x4e, /* This tells the end of a relocatable function */ |
| 77 |
N_EHDECL = 0x50, /* GNU C++ exception variable */ |
| 78 |
N_MOD2 = 0x50, /* Modula2 info "for imc" */ |
| 79 |
N_CATCH = 0x54, /* GNU C++ `catch' clause */ |
| 80 |
N_SSYM = 0x60, /* Structure or union element */ |
| 81 |
N_ENDM = 0x62, /* Last stab emitted for module */ |
| 82 |
N_SO = 0x64, /* ID for main source file */ |
| 83 |
N_OSO = 0x66, /* Apple: This is the stab that associated the .o file */ |
| 84 |
N_ALIAS = 0x6c, /* SunPro F77: Name of alias */ |
| 85 |
N_LSYM = 0x80, /* Automatic variable in the stack */ |
| 86 |
N_BINCL = 0x82, /* Beginning of an include file */ |
| 87 |
N_SOL = 0x84, /* ID for sub-source file */ |
| 88 |
N_PSYM = 0xa0, /* Parameter variable */ |
| 89 |
N_EINCL = 0xa2, /* End of an include file */ |
| 90 |
N_ENTRY = 0xa4, /* Alternate entry point */ |
| 91 |
N_LBRAC = 0xc0, /* Beginning of lexical block */ |
| 92 |
N_EXCL = 0xc2, /* Place holder for deleted include file */ |
| 93 |
N_SCOPE = 0xc4, /* Modula-2 scope information */ |
| 94 |
N_PATCH = 0xd0, /* Solaris2: Patch Run Time Checker */ |
| 95 |
N_RBRAC = 0xe0, /* End of a lexical block */ |
| 96 |
N_BCOMM = 0xe2, /* Begin named common block */ |
| 97 |
N_ECOMM = 0xe4, /* End named common block */ |
| 98 |
N_ECOML = 0xe8, /* Member of a common block */ |
| 99 |
N_WITH = 0xea, /* Solaris2: Pascal "with" statement */ |
| 100 |
N_NBTEXT = 0xf0, |
| 101 |
N_NBDATA = 0xf2, |
| 102 |
N_NBBSS = 0xf4, |
| 103 |
N_NBSTS = 0xf6, |
| 104 |
N_NBLCS = 0xf8, |
| 105 |
N_LENG = 0xfe /* Second symbol entry whih a length-value for the preceding entry */ |
| 106 |
}; |
| 107 |
|
| 108 |
enum stab_source_file { |
| 109 |
N_SO_AS = 0x01, |
| 110 |
N_SO_C = 0x02, |
| 111 |
N_SO_ANSI_C = 0x03, |
| 112 |
N_SO_CC = 0x04, |
| 113 |
N_SO_FORTRAN = 0x05, |
| 114 |
N_SO_PASCAL = 0x06, |
| 115 |
N_SO_FORTRAN90 = 0x07, |
| 116 |
N_SO_OBJC = 0x32, |
| 117 |
N_SO_OBJCPLUS = 0x33 |
| 118 |
}; |
| 119 |
|
| 120 |
#endif /* STABS_H_ */ |