public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/42065]  New: DWARF .debug_macinfo contains unused macros
@ 2009-11-16 14:13 jan dot kratochvil at redhat dot com
  2009-11-16 14:31 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-11-16 14:13 UTC (permalink / raw)
  To: gcc-bugs

-g3 currently produces huge objects as it contains many unused macros.
-g2 produces no macros debug info so GDB cannot provide its expansion.

There is no way to store just the used macros.

(debuginfo compression driven by Roland McGrath may eliminate them but
still...)

While even a macro never used by a program can be helpful in most cases IMO it
is enough to provide the macro definitions touched by the code being debugged.

-feliminate-unused-debug-symbols -feliminate-unused-debug-types have no effect.

-------------------------------------------------------------------------------
#define NOT used
#define USED(x) x
int main (void) { return USED (0); }
-------------------------------------------------------------------------------

Getting:
gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
 DW_MACINFO_define - lineno : 1 macro : NOT used
 DW_MACINFO_define - lineno : 2 macro : USED(x) x

or:
gcc -g2 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
<nothing printed>

Expected output:
gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
 DW_MACINFO_define - lineno : 2 macro : USED(x) x


-- 
           Summary: DWARF .debug_macinfo contains unused macros
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan dot kratochvil at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42065


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bug debug/42065]  New: DWARF .debug_macinfo contains unused macros
  2009-11-16 14:13 [Bug debug/42065] New: DWARF .debug_macinfo contains unused macros jan dot kratochvil at redhat dot com
@ 2009-11-16 14:31 ` Andrew Pinski
  2009-11-16 14:32 ` [Bug debug/42065] " pinskia at gmail dot com
  2009-11-16 14:49 ` jan dot kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2009-11-16 14:31 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs



Sent from my iPhone

On Nov 16, 2009, at 6:12 AM, "jan dot kratochvil at redhat dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> -g3 currently produces huge objects as it contains many unused macros.
> -g2 produces no macros debug info so GDB cannot provide its expansion.
>

That is by design and the reason why -g is -g2 by default ....



> There is no way to store just the used macros.
>
> (debuginfo compression driven by Roland McGrath may eliminate them but
> still...)
>
> While even a macro never used by a program can be helpful in most  
> cases IMO it
> is enough to provide the macro definitions touched by the code being  
> debugged.
>
> -feliminate-unused-debug-symbols -feliminate-unused-debug-types have  
> no effect.
>
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------
> #define NOT used
> #define USED(x) x
> int main (void) { return USED (0); }
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------
>
> Getting:
> gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> DW_MACINFO_define - lineno : 1 macro : NOT used
> DW_MACINFO_define - lineno : 2 macro : USED(x) x
>
> or:
> gcc -g2 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> <nothing printed>
>
> Expected output:
> gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> DW_MACINFO_define - lineno : 2 macro : USED(x) x
>
>
> -- 
>           Summary: DWARF .debug_macinfo contains unused macros
>           Product: gcc
>           Version: 4.5.0
>            Status: UNCONFIRMED
>          Severity: minor
>          Priority: P3
>         Component: debug
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: jan dot kratochvil at redhat dot com
> GCC target triplet: x86_64-unknown-linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42065
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug debug/42065] DWARF .debug_macinfo contains unused macros
  2009-11-16 14:13 [Bug debug/42065] New: DWARF .debug_macinfo contains unused macros jan dot kratochvil at redhat dot com
  2009-11-16 14:31 ` Andrew Pinski
@ 2009-11-16 14:32 ` pinskia at gmail dot com
  2009-11-16 14:49 ` jan dot kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gmail dot com @ 2009-11-16 14:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gmail dot com  2009-11-16 14:31 -------
Subject: Re:   New: DWARF .debug_macinfo contains unused macros



Sent from my iPhone

On Nov 16, 2009, at 6:12 AM, "jan dot kratochvil at redhat dot com"
<gcc-bugzilla@gcc.gnu.org 
 > wrote:

> -g3 currently produces huge objects as it contains many unused macros.
> -g2 produces no macros debug info so GDB cannot provide its expansion.
>

That is by design and the reason why -g is -g2 by default ....



> There is no way to store just the used macros.
>
> (debuginfo compression driven by Roland McGrath may eliminate them but
> still...)
>
> While even a macro never used by a program can be helpful in most  
> cases IMO it
> is enough to provide the macro definitions touched by the code being  
> debugged.
>
> -feliminate-unused-debug-symbols -feliminate-unused-debug-types have  
> no effect.
>
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------
> #define NOT used
> #define USED(x) x
> int main (void) { return USED (0); }
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------
>
> Getting:
> gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> DW_MACINFO_define - lineno : 1 macro : NOT used
> DW_MACINFO_define - lineno : 2 macro : USED(x) x
>
> or:
> gcc -g2 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> <nothing printed>
>
> Expected output:
> gcc -g3 -o unusedmacro unusedmacro.c -Wall; readelf -wm unusedmacro
> DW_MACINFO_define - lineno : 2 macro : USED(x) x
>
>
> -- 
>           Summary: DWARF .debug_macinfo contains unused macros
>           Product: gcc
>           Version: 4.5.0
>            Status: UNCONFIRMED
>          Severity: minor
>          Priority: P3
>         Component: debug
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: jan dot kratochvil at redhat dot com
> GCC target triplet: x86_64-unknown-linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42065
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42065


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug debug/42065] DWARF .debug_macinfo contains unused macros
  2009-11-16 14:13 [Bug debug/42065] New: DWARF .debug_macinfo contains unused macros jan dot kratochvil at redhat dot com
  2009-11-16 14:31 ` Andrew Pinski
  2009-11-16 14:32 ` [Bug debug/42065] " pinskia at gmail dot com
@ 2009-11-16 14:49 ` jan dot kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-11-16 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jan dot kratochvil at redhat dot com  2009-11-16 14:49 -------
(In reply to comment #1)
> > -g3 currently produces huge objects as it contains many unused macros.
> > -g2 produces no macros debug info so GDB cannot provide its expansion.
> 
> That is by design and the reason why -g is -g2 by default ....

OK, thanks for info, still IMO there should be such an additional option.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42065


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-16 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-16 14:13 [Bug debug/42065] New: DWARF .debug_macinfo contains unused macros jan dot kratochvil at redhat dot com
2009-11-16 14:31 ` Andrew Pinski
2009-11-16 14:32 ` [Bug debug/42065] " pinskia at gmail dot com
2009-11-16 14:49 ` jan dot kratochvil at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).