[cfe-commits] [PATCH] PR14097, no debug info for artificial/'nodebug' methods

Alexey Samsonov samsonov at google.com
Tue Oct 16 12:58:19 PDT 2012


Hi Paul,

Now this is interesting, I've filed PR13942 and sent a straightforward fix
for that
to review just today (re-attaching it to this mail in case you're not
subscribed for
cfe-commits). I found it confusing that some functions (like artificial
ones)
lack any debug info entries - it makes it harder for debugger (or other
tools)
to understand which compile unit a given function corresponds to. So,
thanks for
pointing at r158009 :)

I don't know what the right solution to this situation is. Probably,
we can provide debug info for method declarations and drop it
for method bodies if methods are artificial or have "nodebug" attribute?

On Tue, Oct 16, 2012 at 10:51 PM, Robinson, Paul
<Paul.Robinson at am.sony.com>wrote:

> Patch #1: Suppress debug info associated with the body of an
> artificial method. We already suppress debug info for its declaration
> inside the class description.
> Fixes PR14097.
>
> Patch #2: Suppress debug info for the declaration of a class method
> marked __attribute__((nodebug)). We already suppress debug info for
> the body of the method.
>
> Here's the story:
> r158009 suppressed debug-info entries for artificial (compiler
> generated) methods, typically constructors and destructors, from the
> debug info for a class. The idea is that these aren't interesting or
> useful. Which is pretty much true.
>
> Unfortunately, the method _definitions_ still get debug info, and if
> there's no declaration in the class for it to refer to, Clang
> spontaneously generates debug info for a declaration.  If a ctor has
> multiple definitions, which they sometimes do (e.g. when there's a
> virtual base class), each instance produces its own separate
> declaration.  And so the total debug info size _increases_. Patch #1
> suppresses debug-info on the definitions as well.
>
> While finding the fix, I noticed that the 'nodebug' attribute will
> suppress debug info for a method definition, but we don't suppress
> debug info for the corresponding declaration inside a class.
> (Non-class functions don't have this problem because Clang doesn't
> emit debug info for a function declaration anyway.)  Patch #2
> addresses that oversight.
>
> I renamed the Sema and CodeGen tests for the 'nodebug' attribute from
> .c to .cpp and added test points for methods, rather than add whole
> new test files. Hope that's okay.
>
> --paulr
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121016/c0a827b8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue6720044_1.diff
Type: application/octet-stream
Size: 7500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121016/c0a827b8/attachment.obj>


More information about the cfe-commits mailing list