X-Spam-Check-By: sourceware.org
From: "Siegfried Heintze" <siegfried@heintze.com>
To: <cygwin@cygwin.com>
Subject: RE: Extracting Debug (meta data) from executable images?
Date: Wed, 7 Dec 2005 22:17:41 -0700
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
In-Reply-To: <20051207212700.GC30968@trixie.casa.cgf.cx>
Message-ID: <30499572.1134019067348.JavaMail.SYSTEM@CCC-NOVA1>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


>But "extracting debug info" is way too vague of a term to offer any
>meaningful help.  You'd have to state exactly what you're trying to do.
>Try "man objdump" or "objdump -g file", or read the binutils/bfd
>internals manuals.

I basically want to implement reflection for C++ by extracting all the
metadata in the debug portion of the executable image to an xml file. Then I
can easily write programs that can enumerate all the data members of any
given struct or class. GDB can do this: too bad it produces C syntax instead
of XML. I don't want to parse C, it is too difficult.

I found a utility called gccxml which uses the gcc front end and dumps XML
for all the class and struct information. It is strange, however, because it
does not implement the -I switch that gcc does.

Neither nm, readelf or objdump enumerate the fields of a struct. It looks
like dwarfdump would, but libdwarf does not compile with cygwin/gcc 3.4 or
RedHat8/gcc 3.2.

So if I download the source code for GDB, do I compile it on cygwin using
g++? I'd just need to modify the "info variables" and "ptype" commands to
emit XML instead of C.

Siegfried


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

