Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 2002 08:15:21 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        hackers@freebsd.org
Cc:        phk@freebsd.org
Subject:   Re: C-struct dismantling tool...
Message-ID:  <200203211615.g2LGFL205863@vashon.polstra.com>
In-Reply-To: <1510.1016703842@critter.freebsd.dk>
References:  <1510.1016703842@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <1510.1016703842@critter.freebsd.dk>,
Poul-Henning Kamp  <phk@FreeBSD.ORG> wrote:
> 
> Does anyone know of an existing tool which for a given C struct
> can output a list of elements, their types, size and byteoffset ?

No, but I'd like one too -- one that can handle the files in
/usr/include with all their idiosyncrasies.

> I have considered parsing the information out of .stabs records
> from "gcc -g" output, but if an existing tool already exists that
> would save me quite some time.

I thought about the .stabs approach too, and thought it seemed
promising.  Even better might be to use -gdwarf -g3, which in theory
at least would provide information about #defines.

For well-behaved structs, it's possible that rpcgen could be hacked up
to do what you want.

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Chögyam Trungpa


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203211615.g2LGFL205863>