forsyth20121205-174063a80cc13 years agoHistory
392 lines · 7.3 KB · Text
RawDownload
.TH SBL 6.SH NAMEsbl \- symbol table file.SH DESCRIPTIONA Limbo symbol table file provides type information for the modulein an associated Dis executable file,for use by debuggers and similar applications.They are written by the Limbo compilerwhen given the.B -goption.The files conventionally have a.B .sblsuffix; they need not be stored in the same directory asthe corresponding Dis file..PPThe file consists of a header followed by five tables:.IP.I "header file-table pc-table type-table fn-table data-table".PPEach table starts with a line containing a decimalcount of the items in that table.The count can be zero. The followingsections describe the format of table items in each table.In the description, the following terminals are used..PPA.I "string"is a sequence of letters, digits, and the characters _, ., -, and >. Letters are the Unicode characters a through z and A through Z, and all Unicode characters with encoded values greater than A0 hexadecimal..PPAn.I intis an optional minus sign followed by a sequence of digits, 0 to 9..PPIn the following description,the presence of a space is represented by.B •and a newline by.BR \en .There are no other spaces between syntactic elements in the file format.Other special characters represent themselves..SS Header.PPThe header consists of two items..ds Os "\v'0.2m'\s-3\|opt\s+3\^\v'-0.2m'.IP.EX.ft I.nfheader:	magic\f5\en\fP	module\f5\en\fPmagic:	\f5limbo .sbl 2.0\fPmodule:	string.ft R.EE.PPThere have been two previous versions of symbol table format, distinguishedby the number in.IR magic .Version.B 1.was the original; version.B 1.1added more references back to the source; and version.B 2.0replaced the originaladt table by a type table and added support for Limbo's.B pickconstruction.Only version 2.0 is described here; the others are obsolete..PP.I Moduleis the name of the module implemented in the Dis file.Symbol file references to identifiers declared by the implementation module are unqualified.A name referenced that is imported from any other module is preceded by.IB m ->where.I mis that module's identifier..SS File tableThe file table is a list of file names referenced by the rest of the tables. Each file name is terminated by a newline character; within the name, any character other than a newline is valid..SS PC tableThe PC table relates every instruction in the Dis file to the source from which it was compiled.The table is indexed by Dis PC to obtain a reference to the corresponding source.Each item consists of a source descriptionand a statement reference:.IP.EX.ft Ipc-item:	src stmt \f5\en\fPsrc:	pos\f5,\fPpos•pos:	file\f5:\fP\*(Os line\f5.\fP\*(Os charfile, line, char, stmt:	int.ft R.EE.PPA source description.I srcselects source text as a range of characters within lines of a source file..I Fileis an index into the file table (origin 0);.I "line"and.I "char"are positions within that source file, with line numbers starting at 1 and character positions at 0. If.I "file"or.I "line"is omitted, it is assumed to have the previous value, or 0 if there is no previous value..PP.I Stmtis the `statement number' of the instruction.Despite its name, the scope of a statement number is smaller than a Limbo statement:it identifies a region marked by the compiler for treatment as a unit when debugging.For instance,in a.B forstatement, the initial expression, increment, test, and body all have uniquestatement numbers.All instructions compiled from the same region in a Limbo program have the same statement number.The number is that of the innermost region that contains the instruction..SS Type tableThe type table describes the Limbo adts used in the Dis file,both locally declared and imported.Each entry describes a.IR type :.IP.EX.I "type:".ft 5	@ \fItype-index\fP \en	a \fIadt-item\fP	p \fIadt-item\fP \fItag-table\fP	t \fIsize\fP . \fIid-table\fP	m \fImodule\fP \en \fIsrc\fP	A \fItype\fP	C \fItype\fP	F \fIfn-name\fP \fItype\fP	L \fItype\fP	R \fItype\fP	n	N	B	b	i	f	s.ft Itype-index:	int.EE.PPEach leading character specifies a different Limbo type:.IP.RS.TF N.TP 5n.B @existing type referenced by type table index (not self-referential).TP.B A.B array of.I type.TP.B a.B adtwithout.B pick.TP.B B.B big.TP.B b.B byte.TP.BC.B chan of.I type.TP.BF.B fnreturning.I type.TP.B f.B real.TP.B i.B int.TP.B L.B list of.I type.TP.B m.B module.TP.B N.BR nil 'stype.TP.B nno type (eg, function with no return type).TP.B p.B adtwith.B pick.TP.B R.B ref.I type.TP.B s.B string.TP.B ttuple.PD.RE.PPA.I type-indexis an offset in the type table, representing the corresponding type..I Sizeis the size in bytes of a value of the given type.The size of basic types is known and does not appear explicitly:.B bigand.B realare 64 bits; all others including strings and reference types are 4 bytes.(Strings are represented internally by a pointer.).PPEach.I "id-table"is preceded by a count of the number of entries, followed byan.I id-itemfor each entry in the table:.IP.EX.ft Iid-table:	count \f5\en\fP id-itemsid-item:	id-offset \f5:\fP id-name \f5:\fP src type \f5\en\fPid-offset:	intid-name:	stringcount:	int.ft R.EE.PP.I Id-offsetis the number of bytes from the start of the enclosing object to the value of theobject identified by.IR "id-name" ..PPAn adt without a.B pickclause is described using an.IR adt-item :.IP.EX.ft Iadt-item:	adt-name • src size \f5\en\fP id-tableadt-name:	stringsize:	int.ft R.EE.PPThe.I id-tablehas an entry for every data element of.IR "adt-name" ..PPIf an adt has a.B pickclause, the adt's type table entry uses the.B ptype character.The invariant part of the adt is described by an.I adt-item(with zero.IR size )and the variant clause is described by a.I tag-tableof the following form:.IP.EX.ft Itag-table:	count \f5\en\fP tag-itemstag-item:	name \f5:\fP src size \f5\en\fP id-table  \f1|\fP	name \f5:\fP src \f5\en\fP.ft R.EE.PPThe.I tag-tabledescribes the variants of a Limbo adtthat includes a.B pickclause.The.I nameis the.B picktag for the associated alternative.If the.I sizeand.I id-tableare missing, the given variant has the same descriptionas the previous one..PPA tuple's.I id-tablecontains.I id-namesof the form.BI t n,where.I nis the 0-origin index of the item in the tuple..PP.I Srcis as previously defined above in the PC table section..SS Fn tableThe function table describes each function implemented by the Dis file..IP.EX.ft Ifn-item:	fn-pc \f5:\fP fn-name \f5\en\fP args locals returnfn-pc:	intfn-name:	stringargs, locals:	id-tablereturn:	type.ft R.EE.PP.I Fn-pcis the starting pc for the Dis instructions for.IR "fn-name" .If the function is a member of an adt,the member name is qualified by the adt name, so that.I fn-namehas the form.IB `adt-name . member-name'.Within the.I id-tablesfor.I argsand.IR locals ,the.I "id-offset"fields give offsets relative to the function's activation frame.Furthermore, no table entries are made for.I argsthat are declared.B nil(unused)..SS Data tableThe data table describes the global variables in the Dis file. It is an.IR "id-table" ,with one entry for each global variable..SH SEE ALSO.IR limbo (1),.IR wm-deb (1),.IR debug (2),.IR dis (6)