[comp.compilers] '.stabs' info requested

bimandre@BLEKUL60.BITNET (Andre Marien) (06/06/90)

Compilers on Sun, Sequent, VAX generate symbolic info in their '.s' files when
compiling with '-g -S'. This allows to figure out what should go in there, but
not what may be possible besides what the compilers currently use. On
DECstations they 'forget' to do so, eliminating this possiblity.  This would
not be a problem if somewhere in the docu of these systems there was a
description of the format. Only in the stabs.h and a.out one can find
something, but not half of the info one needs.  The question : where do I find
this info in the docu ?  If the answer is 'nowhere', has somebody the info for
suns, decs, ... ?  Thanks a lot,

Andre' Marien
email : bimandre@cs.kuleuven.ac.be
or
email : bimandre@blekul60
[The AT&T System V.3.2 programmer's guide which is published by Prentice Hall
does a credible job of explaining the mysteries of the synbol table, though
not the assembler syntax to generate it. -John]
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.

bothner@cs.wisc.edu (06/06/90)

As an acceptable last resort, I suggest looking at the sources
of programs that generate or use stabs. I suggest gdb,
available from FSF (prep.ai.mit.edu). The next release of gdb
should be able to read DECstation/mips symbol tables - until
then you can use the diffs on pokey.cs.wisc.edu in
pub/gdb-3.5-mips-diffs.Z.
	--Per Bothner
bothner@cs.wisc.edu Computer Sciences Dept, U. of Wisconsin-Madison
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.

title@Think.COM (Richard Title) (06/06/90)

In article <1990Jun5.173819.2970@esegue.segue.boston.ma.us> Andre Marien <bimandre@BLEKUL60.BITNET> writes:
>[is there documentation on the .stabs symbols generated by cc -g]

I couldn't find any external documentation of the stabs either so I resorted
to looking at the dbx sources. The Berkeley dbx sources are freely 
available; the file that processes stabs is "stabstring.c". I'll mail
you a copy of that file. It takes a little work but you can deduce everything
from the source.

As far as I can tell, ULTRIX dbx is pretty close to Berkeley dbx so
looking at Berkeley dbx sources will probably suffice to answer questions
about what ULTRIX dbx accepts.

On the other hand, Sun has made a number of dbx extensions, including
some extensions to the stabs. You'll probably have to talk to Sun to
get more info.

I don't know anything about Sequent's dbx.

If anyone has stab documentation other than the dbx sources, I'd be
interested too.

     - Rich
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.

pardo@cs.washington.edu (David Keppel) (06/07/90)

title@Think.COM (Richard Title) writes:
>[dbx .stabs documentation: `stabstring.c']

One piece of information that you won't find in the dbx documentation:
some perfectly legal .stabs entries cause popular (e.g., BSD VAX)
assemblers to barf with a message like ``illegal .stabs value''.

The problem is severe enough that at least for a while, GNU C++ had a
compiler compile-time flag ``FASCIST_ASSEMBLER''.  The first time that I
built a version of GNU C++ that had this flag, I missed the fact that I
needed to set the flag, and assembly failed as a result.  I took the
problem to one of the authors of BSD `as', and he agreed that it was a
bug in `as'.

One moral of the story is ``do it the right way, have a flag for broken
tools.''

		;-D on  ( Undebugger )  Pardo
-- 
		    pardo@cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.

dupuy@hudson.cs.columbia.edu (Alexander Dupuy) (06/08/90)

The texinfo manual for the GNU assembler has a decent section on the .stab*
directives.  Unfortunately, said manual is not part of the standard gas
distribution.  I think I pulled it off of some host at stanford via ftp.
Anyhow, if you are interested, send me mail, and I can send you a copy (whoever
you were who asked about this first).

@alex
-- 
inet: dupuy@cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.