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

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 10:54:32 PDT 2016


> On Mar 30, 2016, at 12:50 AM, Joerg Sonnenberger via cfe-commits <cfe-commits at lists.llvm.org> wrote:
> 
> On Tue, Mar 29, 2016 at 12:03:46PM -0700, Adrian Prantl via cfe-commits wrote:
>> 
>>> On Mar 29, 2016, at 12:00 PM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
>>> 
>>> On Tue, Mar 29, 2016 at 06:47:24PM +0000, Adrian Prantl via cfe-commits wrote:
>>>> This code in this patch listens to the driver option -gfull, and lowers it to the new cc1 option -debug-retain-types (1).
>>>> When -debug-retain-types is present, CGDebugInfo will retain every(2) type it creates.
>>> 
>>> Is there a good reason for calling it -gfull? I would find something
>>> -gall-types or -gretain-all-types to make a lot more sense. This should
>>> be orthogonal to other options like providing only line tables?
>> 
>> My thinking was this:
>> The driver already supports -gfull, but it doesn’t do anything.
>> This patch can be considered a first step towards making -gfull behave as expected.
>> Eventually it should emit debug info for *all* types.
> 
> -gfull can still be an option group, including -gall-types or whatever.
> 
>>> PS: Slightly related side question, do we have any tools for extracting
>>> a given list of types for retaining? Either by name or global variable
>>> expression.
>> 
>> Extract them from where? Can you give an example?
> 
> 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.

-- adrian

> 
> Joerg
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list