DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T s

⟦caaebbd0a⟧ TextFile

    Length: 7692 (0x1e0c)
    Types: TextFile
    Notes: @(#)stab.h 13.1 (RC International) 91/02/01 */
    Names: »stab.h«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/include/stab.h« 
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦c6f24efe5⟧ »0007« 
        └─⟦this⟧ »comp3.0/bsd/usr/include/stab.h« 

TextFile

/*	@(#)stab.h	13.1 (RC International) 91/02/01	*/

/*
 * The datastructures used by the TX dbx-symboltable layout.
 */

/*
 * Symbol types.
 */
#define	N_UNDF	0x0		/* undefined */
#define	N_ABS	0x2		/* absolute */
#define	N_TEXT	0x4		/* text */
#define	N_DATA	0x6		/* data */
#define	N_BSS	0x8		/* bss */
#define N_SDATA 0xa		/* sdata */
#define N_SBSS	0xc		/* sbss */
#define N_RDATA 0xe		/* rdata */
#define	N_EXT	01		/* external bit, or'ed in */

#define	N_STAB	0x10		/* stab symbol */
/* bits 0x20, 0x40, 0x80 used internally by ld */

typedef	long	symptr;

/*
 * Basic symbol structure in object files.
 */
struct	xnlist
{
	symptr		n_next_sym; /* pointer to next symbol in scope chain */
	short		n_len;	  /* inclusive length of symbol */
	unsigned char	n_type;	  /* N_... above */
	unsigned char	n_subtype;/* csect index or stab subtype */
	long		n_value;  /* value of symbol */
	short		n_namelen;/* length of name without nulls */
	symptr		n_stab;   /* pointer to stab struc., now part of this */
	char		*n_name;  /* actually n_namelen bytes+pad to /4 bndy */
			/* Follows stab information, included in n_len */
};
#define	MAX_SYM_LEN	8192	/* max value of n_len */

/*
 * Stab subtypes - these go in n_subtype.
 */
enum	stsubtype
{
	ST_NONE, ST_ARR, ST_BEG, ST_END, ST_ENUM, ST_FILE, ST_FLD,
	ST_LANG, ST_LINE, ST_MAC, ST_MOD, ST_PROC, ST_TYPE, ST_VAR,
	ST_BLOCK, ST_MEMBER, ST_LAST
};

/*
 * Type classes
 */
enum	sttypeclass
{
	T_SIMPLE, T_STRUCT, T_UNION, T_ENUM, T_ARRAY,
	T_RANGE, T_FILE, T_SET, T_FUNC, T_INDIR, T_TYPE,
	T_BLOCK, T_VOLAT, T_VARIANT, T_VARARM, T_LAST
};

/*
 * Built in types
 */
enum	stbuiltin
{
	B_VOID, B_SIGNED_INT, B_UNSIGNED_INT, B_CHARACTER, B_FLOAT, B_LABEL,
	B_LAST
};

/*
 * Access description types
 */
#define	A_NSEGMENT_LOG	8
#define	A_NSEGMENT	256	/* max number of sub-csects */

enum	staccess
{
	A_CONSTANT, A_REGISTER, A_GLOBAL, A_STATIC, A_FPREL, A_SPREL,
	A_SBREL, A_SEGMENT, A_PARAMREG,
	A_TEXT, A_SDATA,
	A_DATA, A_SBSS,
	A_BSS, A_RDATA,
	A_LAST
};

/*
 * Access descriptor, part of several stab structures
 */
struct	st_access
{
	enum staccess	a_type:16;	/* A_... above */
	unsigned int	:15;		/* unused */
	unsigned int	a_indirect:1;
	unsigned long	a_offset;	/* offset value */
};
#define	A_INDIRECT	0x80000000	/* for compiler */

/* 
 * Structures for stab entries inside xnlist.
 */

/*
 * Array entry. Index type is n_value.
 */
struct	st_arr
{
	symptr	parent;
	symptr	rightsib;
	int	boundnum;
	struct	st_access	lwbaccess;
	struct	st_access	upbaccess;
};

/*
 * Begin block.
 */
struct	st_beg
{
	symptr	parent;
	symptr	leftchild;	/* begin block */
	symptr	rightsib;	/* begin block */
	symptr	firstvar;	/* child variable */
	symptr	first_line;	/* pointers into line table for this scope */
	symptr	last_line;
};

/*
 * Enumeration value. Value is n_value.
 */
struct	st_enum
{
	symptr	parent;
	symptr	rightsib;
};

/*
 * Structure/union field entry. Type is n_value.
 */
struct	st_fld
{
	symptr	parent;
	symptr	rightsib;
	long	offset;		/* in bits from base at this level */
};

/*
 * Macro or define entry.
 */
struct	st_mac
{
	int	textlen;
	char	text[1];	/* actually textlen + 1 for null */
};

/*
 * Procedure/function entry. Function type is n_value.
 */
struct	st_proc
{
	symptr	params;		/* first parameter */
	symptr	locals;		/* first local */
	symptr	children;	/* first begin block child */
	struct	st_access code;	/* access for code, A_GLOBAL or A_STATIC */
	PDR	ppd;		/* copy of the Mips Procedure Descriptor
				   Record. Used in connection with frames */
};

/*
 * Type entry. Type class is n_value.
 */
struct	st_type
{
	int	size;		/* type size in bits */
	long	hash;		/* hash value for type */
	/* NOTE: this union's size on disk IS subtype-dependent */
	union
	{
	    struct
	    {
		symptr	leftchild;
		int	count;	/* count of children */
	    }	    children;	/* T_STRUCT, T_UNION, T_ENUM */
	    struct
	    {
		symptr	leftchild;
		int	count;	/* count of children */
		symptr	basetype;
	    }	    array;	/* T_ARRAY, T_VARIANT */
	    enum stbuiltin	builtin;	/* for T_SIMPLE, a B_... */
	    symptr  basetype;	/* T_FILE, T_SET, T_FUNC, T_INDIR, T_TYPE */
	    struct
	    {
		symptr	basetype;
		int	lower;
		int	upper;
	    }	    range;	/* for T_RANGE */
	} v;
};

/*
 * Variable entry. Type is n_value.
 */
struct	st_var
{
	symptr	parent;
	symptr	rightsib;
	struct	st_access	access;
};

/*
 * Variant arm entry. Should be a st_type, but it would make st_type 50% larger.
 * Therefore we redefine the size and hash fields of st_type.
 * TODO: If we ever clean up the symboltable. Put this in st_type. 
 */
struct	st_vararm
{
	symptr	parent;
	symptr	rightsib;
	symptr	leftchild;
	int 	count;
};


/* 
 * Language codes
 * Used in .stablang pseudo.
 */
enum	stlang
{
	L_C, L_PASCAL, L_FORTRAN, L_AS, L_MACHINE, L_NIL, L_ADA,
	L_Pl1, L_COBOL, L_LAST
};

/*
 * Structure from as.h and ld
 */
struct	typatch
{
    struct typatch	*next;
    symptr		loc;
    symptr		tn;
};

struct scopelst
{
    symptr		loc;
    char		*name;
    struct scopelst	*next;
};

/*
 * Top level structures.
 */

/* Symbol table header */
struct	sym_header
{
	symptr	global_scope;		/* to a scope_header */
	symptr	module_list;		/* to a module_header */
	int	scopehash_size;		/* number of entries */
	symptr	scopehash_table;	/* not in as */
	int	file_size;		/* number of file entries */
	symptr	file_table;		/* ptr to first file file_entry */
	int	filemap_size;		/* number of filemap entries */
	symptr	filemap_table;		/* table of file# to scope */
	int	addrmap_size;		/* address-to-symbol map, # entries */
	int	addrmap_table;		/* ptr to first addrmap_entry */
};

/* File table entry */
struct	file_entry
{
	symptr		next_file;	/* to next file_entry */
	int		namelen;	/* exclusive of trailing null */
	long		timestamp;	/* mod stamp on source file */
	int		map_index;	/* index into filemap_table */
	char		*name;		/* new - used to be filled to /4 bdy */
};

/* File map entry */
struct	filemap_entry
{
	symptr		next_filemap;	/* to next filemap_entry */
	int		file_number;	/* index into file_table */
	symptr		scope;		/* ptr to a scope_header */
};

/* Address map entry */
/* Important that this be a power-of-two number of bytes long */
struct	addrmap_entry
{
	long		address;	/* value of symbol */
	short		segtype;	/* 0 = text, 1 = data, 2 = bss */
	short		segsubtype;	/* seg_desc index */
	symptr		sym;		/* ptr to xnlist for symbol */
	symptr		scope;		/* ptr to scope_header for symbol */
};
 
/* Line table entry */
struct	line_entry
{
	symptr		next_line;
	int		file_number;
	int		line_number;
	int		address;	/* relative in as output */
};

/* Module header */
struct	module_header
{
	long		module_size;	/* in bytes, all info */
	long		trans_version;	/* translator: .stablang */
	symptr		language;	/* a Languages pointer */
	/*
	 * the list contains first a scope for file-locals then
	 * scopes for each func/proc.
	 */
	symptr		scope_list;	/* to a scope_header */
	symptr		mod_sym;	/* to an xnlist for .stabmod */
	symptr		next_module;	/* to a module_header */
};

/* Scope header */
struct	scope_header
{
	long	scope_size;		/* bytes, all info for scope */
	long	sym_count;
	symptr	first_sym;		/* to an xnlist for first symbol */
	int	line_count;		/* number of entries */
	symptr	first_line;		/* ptr to line_entry */
	long	symhash_size;		/* count of entries */
	symptr	symhash_table;		/* pointers to symbols */
	symptr	parent_scope;		/* to a scope_header */
	symptr	next_scope;		/* to a scope_header */
	symptr	child_scope;		/* to a scope_header */
	symptr	mod_header;		/* to a module_header (`parent') */
};

/* hash function: hval = rotateleft(hval, HASH_ROTATE) ^ nextchar */
/* at end clear high bit and mod by table size */
#define	HASH_ROTATE	7