[cfe-dev] question about clang & generated debug info

Devang Patel dpatel at apple.com
Wed Aug 31 10:00:05 PDT 2011


Simon,

On Aug 21, 2011, at 9:31 PM, Simon wrote:

> I am trying to find a tool that will parse and tell me information about a C source file in a verbose manner which I can digest and use in a script I am writing. The closest I have come so far using gcc to generate debug info and then extract the debug info and parse that. However, what I'd prefer is a tool which lets me get at similar debug info (although obviously not memory offsets etc) *without* having to compile the C source code into object files. I know that clang has been re-written from scratch to be a lot more flexible than gcc. Does anybody in this list know how I could use clang (or another tool) to obtain such debug info without compiling all the way? Thanks, Simon

Clang can emit  llvm IR with debug info without generating object file. Technically you could extract these info from llvm IR for your own use, but you'll have to write it yourself. I do not know what you're trying to do, but you may want to investigate whether clang may be able to provide relevant info directly without going through debug info route.

-
Devang



More information about the cfe-dev mailing list