[Dwarf-Discuss] Generating a Dwarf description of a C header file

Jason Nyberg jasonnyberg@gmail.com
Sun Feb 25 02:59:38 GMT 2018


I'm looking for a tool, preferably gcc with the right flag recipe, that
would take a C header file and spit out an ELF library that contains an
exhaustive dwarf-format description of types, including function
declarations, which could completely describe the development API for, say,
a shared library. I've gotten close; If I create a .c file that does
nothing but include the .h file(s) I'm "packaging", and use the following
gcc command line (there may be redundant flags here...):

gcc -g3 --shared -std=gnu99 -ggdb3 -gdwarf-4
-fno-eliminate-unused-debug-types -o dwarf_api.so -c api.c

I get very nearly what I'm looking for, minus (afaict) function
declarations.

I'd like to avoid the intermediate .c file (although this is easy to script
away), and I need those function declarations... Are there any magic flags
I've missed in the gcc docs (and I've only looked at gcc so far), or is
there another tool I haven't discovered, that can do what I'm looking for?
(Google hasn't really come through for me here...)

Thanks,

Jason Nyberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/attachments/20180225/b7cc2c40/attachment.html>



More information about the Dwarf-discuss mailing list