public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Question regarding exporting data type information during compilation
@ 2010-02-19  6:34 Michael Bauer
  2010-02-23 18:24 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Bauer @ 2010-02-19  6:34 UTC (permalink / raw)
  To: gcc-help

I have a question regarding the ability to export data type information during compilation.  In a nutshell, I need to generate a list of all of my static variable names and their primitive data type.  When I say primitive type I mean like long, short, unsigned long, unsigned short, float, and char.

Knowing that some part of the compiler (pre-processor I think) is already parsing data type to give warnings for type mismatch, I presume that the compiler may have such a functionality already built in.  Essentially I want to export the symbol type information from the compiler.  

Now I know that I can get the symbol names in the map file along with their base address and size.  However, that wont give me the primitive type information.  I have done some searching but have not had much luck.  Does anyone know of an option in the compiler to output this information?  Perhaps there are options to control if this information is output in the map file or something.

Another thought that I had, if the compiler is not capable of outputting this information, then perhaps there is some debug information file that I could write a script to parse.  I'm thinking that debuggers somehow know the symbol name, address, and type so it must be output into some sort of debugging file.  If anyone has any suggestions I would be much appreciative.

Thanks in advance for any help.

Mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question regarding exporting data type information during compilation
  2010-02-19  6:34 Question regarding exporting data type information during compilation Michael Bauer
@ 2010-02-23 18:24 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-02-23 18:24 UTC (permalink / raw)
  To: Michael Bauer; +Cc: gcc-help

Michael Bauer <mvbauer@gmail.com> writes:

> Another thought that I had, if the compiler is not capable of
> outputting this information, then perhaps there is some debug
> information file that I could write a script to parse.  I'm thinking
> that debuggers somehow know the symbol name, address, and type so it
> must be output into some sort of debugging file.  If anyone has any
> suggestions I would be much appreciative.

You can use readelf --debug-dump to dump all sorts of information
about the debugging information.

The compiler won't dump it for you, unless you count looking at the
assembler output when using -S -dA.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-23 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-19  6:34 Question regarding exporting data type information during compilation Michael Bauer
2010-02-23 18:24 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).