[PATCH] D18565: Implement an "I'm dtrace, please retain all debug types" option.

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 14:19:27 PDT 2016


On Wed, Mar 30, 2016 at 10:54:32AM -0700, Adrian Prantl via cfe-commits wrote:
> > Let's take a kernel as example. I want to include certain types for
> > dtrace-like use with /dev/kmem, but not all the 100KB+ of boring types.
> > Enough for doing some basic post-mortem debugging even on embedded
> > systems.
> 
> If I understand this correctly, you want to pass a list of “interesting”
> types to clang that are guaranteed to make it into the debug info?
> At the moment this is not directly possible. What you could do is
> collect all the interesting types in a header file and then build a
> Clang module (using -gmodules) from that header. The resulting .pcm
> will be and object file that has DWARF for all types in the module.

Oh, the "makes it into the debug info" is likely the easy part. Your
patch does that :) The real question is whether there is a tool to
*reduce* the set of defined types based on a whitelist. E.g. I want to
have a new file with the DWARF definitions for "struct stat" and all
types used by that, but nothing more. That's a lot of nasty source
processing to emulate by hand, so I was curious if someone had written a
tool for that already.

Joerg


More information about the cfe-commits mailing list