From owner-freebsd-hackers Thu Mar 21 8:15:33 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 4402137B400; Thu, 21 Mar 2002 08:15:26 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g2LGFMu20396; Thu, 21 Mar 2002 08:15:22 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id g2LGFL205863; Thu, 21 Mar 2002 08:15:21 -0800 (PST) (envelope-from jdp) Date: Thu, 21 Mar 2002 08:15:21 -0800 (PST) Message-Id: <200203211615.g2LGFL205863@vashon.polstra.com> To: hackers@freebsd.org From: John Polstra Cc: phk@freebsd.org Subject: Re: C-struct dismantling tool... In-Reply-To: <1510.1016703842@critter.freebsd.dk> References: <1510.1016703842@critter.freebsd.dk> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In article <1510.1016703842@critter.freebsd.dk>, Poul-Henning Kamp 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