[comp.compilers] Search for a smarter C cross reference.

jbh@bnrunix.uucp (John B. Hampton) (06/02/89)

At BNR we have a "cross reference" facility for a proprietary language that,
among other things, will produce sizes of data items, offsets from 
module-local "0", and running totals thereof.  I would appreciate knowing
of a similar xref for the C language.  Criteria are:

	o  Need source for the xref itself in C or executables runnable on
	   Sun 4 and HP 9000/300.
	o  The sizes and offsets should appear within a "normal" (cxref-
	   type) cross reference listing along with other info.
	o  Would be nice to have running totals in a listing beside the
	   pertinent data items.

Thanks in advance.
-- 
John Hampton (rti!bnrunix!jbh), 919-991-8146
BNR, Inc.  POB 13478  RTP, NC 27709
[I suppose you could try to munge together the output of cxref and an "nm"
of the compiled version, but it'd be an interesting challenge.  -John]
--
Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU
Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request

mmengel@cuuxb.ATT.COM (Marc W. Mengel) (06/03/89)

In article <4007@ima.ima.isc.com> jbh@bnrunix.uucp (John B. Hampton) writes:
> ...  I would appreciate knowing of a similar xref for the C language...
>	o  Need source for the xref itself in C or executables runnable on
>	   Sun 4 and HP 9000/300.
>	o  The sizes and offsets should appear within a "normal" (cxref-
>	   type) cross reference listing along with other info.
>	o  Would be nice to have running totals in a listing beside the
>	   pertinent data items.

	If you compile a program with the -g option, and run "nm" on
	it, you will get a raw listing of the base information you 
	want here; piping the output to "awk" and "sort" should make
	a pretty listing in the format you want. (i.e. to compute
	running totals and/or group local variable names with their
	enclosing function's name, etc.

>John Hampton (rti!bnrunix!jbh), 919-991-8146

-- 
 Marc Mengel					mmengel@cuuxb.att.com
 						attmail!mmengel
 						...!{lll-crg|att}!cuuxb!mmengel
[If anybody actually does this, please let me know.  -John]
--
Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU
Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request